+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/mp42ts
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-LINKFLAGS=-L../../bin/gcc
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=MP42TS$(EXE)
-else
-EXT=
-PROG=MP42TS
-endif
-
-ifeq ($(STATICBUILD),yes)
-##include static modules and other deps for libgpac
-include ../../static.mak
-
-#FIXME we have to disable AAC+bifs support in mp42ts since it reuses things from aac_in already in libgpac ...
-ifeq ($(STATIC_MODULES),yes)
-CFLAGS+=-DGPAC_DISABLE_PLAYER
-endif
-
-LINKFLAGS+=-lgpac_static
-LINKFLAGS+= $(GPAC_SH_FLAGS)
-LINKFLAGS+=$(EXTRALIBS)
-else
-LINKFLAGS+=-lgpac
-ifeq ($(CONFIG_DARWIN),yes)
-#LINKFLAGS+= -Wl,-rpath,'@loader_path'
-else
-LINKFLAGS+= -Wl,-rpath,'$$ORIGIN' -Wl,-rpath-link,../../bin/gcc
-endif
-endif
-
-
-#common objs - insert after ../static if any to overwrite list of objects
-OBJS= main.o
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre, Cyril Concolato, Romain Bouqueau
- * Copyright (c) Telecom ParisTech 2005-2012
- * All rights reserved
- *
- * This file is part of GPAC / mp4-to-ts (mp42ts) application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/media_tools.h>
-#include <gpac/constants.h>
-#include <gpac/base_coding.h>
-#include <gpac/mpegts.h>
-#include <gpac/main.h>
-
-#ifndef GPAC_DISABLE_STREAMING
-#include <gpac/internal/ietf_dev.h>
-#endif
-
-#ifndef GPAC_DISABLE_SENG
-#include <gpac/scene_engine.h>
-#endif
-
-#ifndef GPAC_DISABLE_TTXT
-#include <gpac/webvtt.h>
-#endif
-
-
-#ifdef GPAC_DISABLE_MPEG2TS_MUX
-#error "Cannot compile MP42TS if GPAC is not built with MPEG2-TS Muxing support"
-#endif
-
-#define MP42TS_PRINT_TIME_MS 500 /*refresh printed info every CLOCK_REFRESH ms*/
-#define MP42TS_VIDEO_FREQ 1000 /*meant to send AVC IDR only every CLOCK_REFRESH ms*/
-
-#define GPAC_DISABLE_PLAYER
-
-
-s32 temi_id_1 = -1;
-s32 temi_id_2 = -1;
-
-u32 temi_url_insertion_delay = 1000;
-u32 temi_offset = 0;
-Bool temi_disable_loop = GF_FALSE;
-
-Double temi_period=0;
-Bool request_temi_toggle = GF_FALSE;
-Bool temi_on = GF_TRUE;
-Bool temi_single_toggle = GF_FALSE;
-u64 temi_period_last_dts = 0;
-FILE *logfile = NULL;
-
-//no longer supported for filters
-#define GPAC_DISABLE_PLAYER
-
-
-static void usage()
-{
- fprintf(stderr, "mp42ts <inputs> <destinations> [options]\n"
- "\n"
- "Inputs:\n"
- "-src filename[:OPTS] specifies an input file used for a TS service\n"
- " * currently only supports ISO files and SDP files\n"
- " * can be used several times, once for each program\n"
- "By default each source is a program in a TS. \n"
- "Source options are colon-separated list of options, as follows:\n"
- "ID=N specifies the program ID for this source.\n"
- " All sources with the same ID will be added to the same program\n"
- "name=STR program name, as used in DVB service description table\n"
- "provider=STR provider name, as used in DVB service description table\n"
- "disc the first packet of each stream will have the discontinuity marker set\n"
- "pmt=N sets version number of the PMT\n"
-
- "\n"
- "-prog filename same as -src filename\n"
- "\n"
- "Destinations:\n"
- "Several destinations may be specified as follows, at least one is mandatory\n"
- "-dst-udp UDP_address:port (multicast or unicast)\n"
- "-dst-rtp RTP_address:port\n"
- "-dst-file filename\n"
- "The following parameters may be specified when -dst-file is used\n"
- "-segment-dir dir server local directory to store segments (ends with a '/')\n"
- "-segment-duration dur segment duration in seconds\n"
- "-segment-manifest file m3u8 file basename\n"
- "-segment-http-prefix p client address for accessing server segments\n"
- "-segment-number n number of segments to list in the manifest\n"
- "\n"
- "Basic options:\n"
- "-rate R specifies target rate in kbps of the multiplex (optional)\n"
- "-real-time specifies the muxer will work in real-time mode\n"
- " * if not specified, the muxer will generate the TS as quickly as possible\n"
- " * automatically set for SDP or BT input\n"
- "-pcr-init V sets initial value V for PCR - if not set, random value is used\n"
- "-pcr-offset V offsets all timestamps from PCR by V, in 90kHz. Default value is computed based on input media.\n"
- "-psi-rate V sets PSI refresh rate V in ms (default 100ms).\n"
- " * If 0, PSI data is only send once at the beginning or before each IDR when -rap option is set.\n"
- " * This should be set to 0 for DASH streams.\n"
- "-time n request the muxer to stop after n ms\n"
- "-single-au forces 1 PES = 1 AU (disabled by default)\n"
- "-multi-au forces 1 PES = N AU for all streams (disabled by default).\n"
- " By default, audio streams pack N AUs in one PES but video and systems data use 1 AU per PES.\n"
- "-rap forces RAP/IDR to be aligned with PES start for video streams (disabled by default)\n"
- " in this mode, PAT, PMT and PCR will be inserted before the first TS packet of the RAP PES\n"
- "-flush-rap same as -rap but flushes all other streams (sends remaining PES packets) before inserting PAT/PMT\n"
- "-nb-pack N specifies to pack up to N TS packets together before sending on network or writing to file\n"
- "-pcr-ms N sets max interval in ms between 2 PCR. Default is 100 ms or at each PES header\n"
- "-force-pcr-only allows sending PCR-only packets to enforce the requested PCR rate - STILL EXPERIMENTAL.\n"
- "-ttl N specifies Time-To-Live for multicast. Default is 1.\n"
- "-ifce IPIFCE specifies default IP interface to use. Default is IF_ANY.\n"
- "-temi [URL] Inserts TEMI time codes in adaptation field. URL is optional, and can be a number for external timeline IDs\n"
- "-temi-delay DelayMS Specifies delay between two TEMI url descriptors (default is 1000)\n"
- "-temi-offset OffsetMS Specifies an offset in ms to add to TEMI (by default TEMI starts at 0)\n"
- "-temi-noloop Do not restart the TEMI timeline at the end of the source\n"
- "-temi2 ID Inserts a secondary TEMI time codes in adaptation field of the audio PID if any. ID shall be set to the desired external timeline IDs\n"
- "-insert-ntp Inserts NTP timestamp in TEMI timeline descriptor\n"
- "-sdt-rate MS Gives the SDT carrousel rate in milliseconds. If 0 (default), SDT is not sent\n"
- "\n"
- "MPEG-4/T-DMB options:\n"
- "-bifs-src filename update file: must be either an .sdp or a .bt file\n"
- "-audio url may be mp3/udp or aac/http (shoutcast/icecast)\n"
- "-video url shall be a raw h264 frame\n"
- "-mpeg4-carousel n carousel period in ms\n"
- "-mpeg4 or -4on2 forces usage of MPEG-4 signaling (IOD and SL Config)\n"
- "-4over2 same as -4on2 and uses PMT to carry OD Updates\n"
- "-bifs-pes carries BIFS over PES instead of sections\n"
- "-bifs-pes-ex carries BIFS over PES without writing timestamps in SL\n"
- "\n"
- "Misc options\n"
-#ifdef GPAC_MEMORY_TRACKING
- "-mem-track enables memory tracker\n"
- "-mem-track-stack enables memory tracker stack dumping\n"
-#endif
- "-h or -help print this screen\n"
- "-hc print libgpac options\n"
- "\n"
- "GPAC version %s\n"
- "(c) Telecom ParisTech 2000-2018 - Licence LGPL v2\n"
- "GPAC Configuration: " GPAC_CONFIGURATION "\n"
- "Features: %s %s\n\n", gf_gpac_version(), gf_enabled_features(), gf_disabled_features()
- );
-}
-
-
-#define MAX_MUX_SRC_PROG 100
-typedef struct
-{
-
-#ifndef GPAC_DISABLE_ISOM
- GF_ISOFile *mp4;
-#endif
-
- u32 nb_streams, pcr_idx;
- GF_ESInterface streams[40];
- GF_Descriptor *iod;
-#ifndef GPAC_DISABLE_SENG
- GF_SceneEngine *seng;
-#endif
- GF_Thread *th;
- char *bifs_src_name;
- u32 rate;
- Bool repeat;
- u32 mpeg4_signaling;
- Bool audio_configured;
- u64 samples_done, samples_count;
- u32 nb_real_streams;
- Bool real_time;
- GF_List *od_updates;
-
- u32 max_sample_size;
-
- char program_name[20];
- char provider_name[20];
- u32 ID;
- Bool is_not_program_declaration;
- Bool set_disc;
- u32 pmt_version;
-
- Double last_ntp;
-} M2TSSource;
-
-#ifndef GPAC_DISABLE_ISOM
-typedef struct
-{
- GF_ISOFile *mp4;
- u32 track, sample_number, sample_count;
- u32 mstype, mtype;
- GF_ISOSample *sample;
- /*refresh rate for images*/
- u32 image_repeat_ms, nb_repeat_last;
- void *dsi;
- u32 dsi_size;
-
- void *dsi_and_rap;
- Bool loop;
- Bool is_repeat;
- s64 ts_offset, cts_dts_shift;
- M2TSSource *source;
-
- const char *temi_url;
- u32 last_temi_url, timeline_id;
- Bool insert_ntp;
-
-} GF_ESIMP4;
-#endif
-
-typedef struct
-{
- u32 carousel_period, ts_delta;
- u16 aggregate_on_stream;
- Bool adjust_carousel_time;
- Bool discard;
- Bool rap;
- Bool critical;
- Bool vers_inc;
-} GF_ESIStream;
-
-typedef struct
-{
- u32 size;
- char *data;
-} GF_SimpleDataDescriptor;
-
-//TODO: find a clean way to save this data
-#ifndef GPAC_DISABLE_PLAYER
-static u32 audio_OD_stream_id = (u32)-1;
-#endif
-
-#define AUDIO_OD_ESID 100
-#define AUDIO_DATA_ESID 101
-#define VIDEO_DATA_ESID 105
-
-/*output types*/
-enum
-{
- GF_MP42TS_FILE, /*open mpeg2ts file*/
- GF_MP42TS_UDP, /*open udp socket*/
- GF_MP42TS_RTP, /*open rtp socket*/
-#ifndef GPAC_DISABLE_PLAYER
- GF_MP42TS_HTTP, /*open http downloader*/
-#endif
-};
-
-static u32 format_af_descriptor(char *af_data, u32 timeline_id, u64 timecode, u32 timescale, u64 ntp, const char *temi_url, u32 *last_url_time)
-{
- u32 res;
- u32 len;
- u32 last_time=0;
- GF_BitStream *bs = gf_bs_new(af_data, 188, GF_BITSTREAM_WRITE);
-
- if (ntp) {
- last_time = 1000*(ntp>>32);
- last_time += 1000*(ntp&0xFFFFFFFF)/0xFFFFFFFF;
- } else if (timescale) {
- last_time = (u32) (1000*timecode/timescale);
- }
- if (temi_url && (!*last_url_time || (last_time - *last_url_time + 1 >= temi_url_insertion_delay)) ) {
- *last_url_time = last_time + 1;
- len = 0;
- gf_bs_write_int(bs, GF_M2TS_AFDESC_LOCATION_DESCRIPTOR, 8);
- gf_bs_write_int(bs, len, 8);
-
- gf_bs_write_int(bs, 0, 1); //force_reload
- gf_bs_write_int(bs, 0, 1); //is_announcement
- gf_bs_write_int(bs, 0, 1); //splicing_flag
- gf_bs_write_int(bs, 0, 1); //use_base_temi_url
- gf_bs_write_int(bs, 0xFF, 5); //reserved
- gf_bs_write_int(bs, timeline_id, 7); //timeline_id
-
- if (temi_url) {
- char *url = (char *)temi_url;
- if (!strnicmp(temi_url, "http://", 7)) {
- gf_bs_write_int(bs, 1, 8); //url_scheme
- url = (char *) temi_url + 7;
- } else if (!strnicmp(temi_url, "https://", 8)) {
- gf_bs_write_int(bs, 2, 8); //url_scheme
- url = (char *) temi_url + 8;
- } else {
- gf_bs_write_int(bs, 0, 8); //url_scheme
- }
- gf_bs_write_u8(bs, (u32) strlen(url)); //url_path_len
- gf_bs_write_data(bs, url, (u32) strlen(url) ); //url
- gf_bs_write_u8(bs, 0); //nb_addons
- }
- //rewrite len
- len = (u32) gf_bs_get_position(bs) - 2;
- af_data[1] = len;
- }
-
- if (timescale || ntp) {
- Bool use64 = (timecode > 0xFFFFFFFFUL) ? GF_TRUE : GF_FALSE;
- len = 3; //3 bytes flags
-
- if (timescale) len += 4 + (use64 ? 8 : 4);
- if (ntp) len += 8;
-
- //write timeline descriptor
- gf_bs_write_int(bs, GF_M2TS_AFDESC_TIMELINE_DESCRIPTOR, 8);
- gf_bs_write_int(bs, len, 8);
-
- gf_bs_write_int(bs, timescale ? (use64 ? 2 : 1) : 0, 2); //has_timestamp
- gf_bs_write_int(bs, ntp ? 1 : 0, 1); //has_ntp
- gf_bs_write_int(bs, 0, 1); //has_ptp
- gf_bs_write_int(bs, 0, 2); //has_timecode
- gf_bs_write_int(bs, 0, 1); //force_reload
- gf_bs_write_int(bs, 0, 1); //paused
- gf_bs_write_int(bs, 0, 1); //discontinuity
- gf_bs_write_int(bs, 0xFF, 7); //reserved
- gf_bs_write_int(bs, timeline_id, 8); //timeline_id
- if (timescale) {
- gf_bs_write_u32(bs, timescale); //timescale
- if (use64)
- gf_bs_write_u64(bs, timecode); //timestamp
- else
- gf_bs_write_u32(bs, (u32) timecode); //timestamp
- }
- if (ntp) {
- gf_bs_write_u64(bs, ntp); //ntp
- }
- }
- res = (u32) gf_bs_get_position(bs);
- gf_bs_del(bs);
- return res;
-}
-
-#ifndef GPAC_DISABLE_ISOM
-
-static GF_Err mp4_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
-{
- char af_data[188];
- GF_ESIMP4 *priv = (GF_ESIMP4 *)ifce->input_udta;
- if (!priv) return GF_BAD_PARAM;
-
- switch (act_type) {
- case GF_ESI_INPUT_DATA_FLUSH:
- {
- GF_ESIPacket pck;
-#ifndef GPAC_DISABLE_TTXT
- GF_List *cues = NULL;
-#endif
- if (!priv->sample)
- priv->sample = gf_isom_get_sample(priv->mp4, priv->track, priv->sample_number+1, NULL);
-
- if (!priv->sample) {
- return GF_IO_ERR;
- }
-
- memset(&pck, 0, sizeof(GF_ESIPacket));
-
- pck.flags = GF_ESI_DATA_AU_START | GF_ESI_DATA_HAS_CTS;
- if (priv->sample->IsRAP) pck.sap_type = priv->sample->IsRAP;
- pck.cts = priv->sample->DTS + priv->ts_offset;
- if (priv->is_repeat) pck.flags |= GF_ESI_DATA_REPEAT;
-
- if (priv->timeline_id) {
- Bool deactivate_temi=GF_FALSE;
- u64 ntp=0;
- u64 tc = priv->sample->DTS + priv->sample->CTS_Offset + priv->cts_dts_shift;
- Bool insert_temi=GF_FALSE;
- if (temi_disable_loop) {
- tc += priv->ts_offset;
- }
-
- if (temi_offset) {
- tc += ((u64) temi_offset) * ifce->timescale / 1000;
- }
-
- if (priv->insert_ntp) {
- u32 sec, frac;
- gf_net_get_ntp(&sec, &frac);
- ntp = sec;
- ntp <<= 32;
- ntp |= frac;
- }
- if (!temi_period) {
- //toggle temi at RAP POINTS ONLY
- if (request_temi_toggle && priv->sample->IsRAP) {
- temi_on = !temi_on;
- if (!temi_on) {
- deactivate_temi = GF_TRUE;
- }
- fprintf(stderr, "Turning TEMI %st at DTS "LLU" (%g sec)\n", temi_on ? "on" : "off" , priv->sample->DTS, ((Double)priv->sample->DTS)/ifce->timescale);
- request_temi_toggle = GF_FALSE;
- }
- insert_temi = temi_on;
- } else {
-
- if (!temi_on) {
- if (priv->sample->IsRAP && ((priv->sample->DTS - temi_period_last_dts) >= temi_period * ifce->timescale)) {
- temi_on = GF_TRUE;
- temi_period_last_dts = priv->sample->DTS;
- fprintf(stderr, "Turning TEMI on at DTS "LLU" (%g sec)\n", priv->sample->DTS, ((Double)priv->sample->DTS)/ifce->timescale);
- }
- } else {
- if (!temi_single_toggle && priv->sample->IsRAP && ((priv->sample->DTS - temi_period_last_dts) >= temi_period * ifce->timescale)) {
- temi_on = GF_FALSE;
- temi_period_last_dts = priv->sample->DTS;
- fprintf(stderr, "Turning TEMI off at DTS "LLU" (%g sec)\n", priv->sample->DTS, ((Double)priv->sample->DTS)/ifce->timescale);
- deactivate_temi = GF_TRUE;
- }
- }
- insert_temi = temi_on;
- }
-
- if (insert_temi) {
- pck.mpeg2_af_descriptors_size = format_af_descriptor(af_data, priv->timeline_id - 1, tc, ifce->timescale, ntp, priv->temi_url, &priv->last_temi_url);
- pck.mpeg2_af_descriptors = af_data;
- } else if (deactivate_temi) {
- pck.mpeg2_af_descriptors_size = format_af_descriptor(af_data, priv->timeline_id - 1, 0, 0, 0, "", &priv->last_temi_url);
- pck.mpeg2_af_descriptors = af_data;
- }
- }
-
- if (priv->nb_repeat_last) {
- pck.cts += priv->nb_repeat_last*ifce->timescale * priv->image_repeat_ms / 1000;
- }
-
- pck.dts = pck.cts;
- if (priv->cts_dts_shift) {
- pck.cts += + priv->cts_dts_shift;
- pck.flags |= GF_ESI_DATA_HAS_DTS;
- }
-
- if (priv->sample->CTS_Offset) {
- pck.cts += priv->sample->CTS_Offset;
- pck.flags |= GF_ESI_DATA_HAS_DTS;
- }
-
- if (priv->sample->IsRAP && priv->dsi && priv->dsi_size) {
- pck.data = (char*)priv->dsi;
- pck.data_len = priv->dsi_size;
- ifce->output_ctrl(ifce, GF_ESI_OUTPUT_DATA_DISPATCH, &pck);
- pck.flags &= ~GF_ESI_DATA_AU_START;
- }
-
- pck.flags |= GF_ESI_DATA_AU_END;
- pck.data = priv->sample->data;
- pck.data_len = priv->sample->dataLength;
- pck.duration = gf_isom_get_sample_duration(priv->mp4, priv->track, priv->sample_number+1);
-#ifndef GPAC_DISABLE_TTXT
- if (priv->mtype==GF_ISOM_MEDIA_TEXT && priv->mstype==GF_ISOM_SUBTYPE_WVTT) {
- u64 start;
- GF_WebVTTCue *cue;
- GF_List *gf_webvtt_parse_iso_cues(GF_ISOSample *iso_sample, u64 start);
- start = (priv->sample->DTS * 1000) / ifce->timescale;
- cues = gf_webvtt_parse_iso_cues(priv->sample, start);
- if (gf_list_count(cues)>1) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[MPEG-2 TS Muxer] More than one cue in sample\n"));
- }
- cue = (GF_WebVTTCue *)gf_list_get(cues, 0);
- if (cue) {
- pck.data = cue->text;
- pck.data_len = (u32)strlen(cue->text)+1;
- } else {
- pck.data = NULL;
- pck.data_len = 0;
- }
- }
-#endif
- ifce->output_ctrl(ifce, GF_ESI_OUTPUT_DATA_DISPATCH, &pck);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[MPEG-2 TS Muxer] Track %d: sample %d CTS %d\n", priv->track, priv->sample_number+1, pck.cts));
-
-#ifndef GPAC_DISABLE_VTT
- if (cues) {
- while (gf_list_count(cues)) {
- GF_WebVTTCue *cue = (GF_WebVTTCue *)gf_list_get(cues, 0);
- gf_list_rem(cues, 0);
- gf_webvtt_cue_del(cue);
- }
- gf_list_del(cues);
- cues = NULL;
- }
-#endif
- gf_isom_sample_del(&priv->sample);
- priv->sample_number++;
-
- if (!priv->source->real_time && !priv->is_repeat) {
- priv->source->samples_done++;
- gf_set_progress("MPEG-2 TS Muxing", priv->source->samples_done, priv->source->samples_count);
- }
-
- if (priv->sample_number==priv->sample_count) {
- if (priv->loop) {
- Double scale;
- u64 duration;
- /*increment ts offset*/
- scale = gf_isom_get_media_timescale(priv->mp4, priv->track);
- scale /= gf_isom_get_timescale(priv->mp4);
- duration = (u64) (gf_isom_get_duration(priv->mp4) * scale);
- priv->ts_offset += duration;
- priv->sample_number = 0;
- priv->is_repeat = (priv->sample_count==1) ? GF_TRUE : GF_FALSE;
- }
- else if (priv->image_repeat_ms && priv->source->nb_real_streams) {
- priv->nb_repeat_last++;
- priv->sample_number--;
- priv->is_repeat = GF_TRUE;
- } else {
- if (!(ifce->caps & GF_ESI_STREAM_IS_OVER)) {
- ifce->caps |= GF_ESI_STREAM_IS_OVER;
- if (priv->sample_count>1) {
- assert(priv->source->nb_real_streams);
- priv->source->nb_real_streams--;
- }
- }
- }
- }
- }
- return GF_OK;
-
- case GF_ESI_INPUT_DESTROY:
- if (priv->dsi) gf_free(priv->dsi);
- if (ifce->decoder_config) {
- gf_free(ifce->decoder_config);
- ifce->decoder_config = NULL;
- }
- gf_free(priv);
- ifce->input_udta = NULL;
- return GF_OK;
- default:
- return GF_BAD_PARAM;
- }
-}
-
-static void fill_isom_es_ifce(M2TSSource *source, GF_ESInterface *ifce, GF_ISOFile *mp4, u32 track_num, u32 bifs_use_pes, Bool compute_max_size)
-{
- GF_ESIMP4 *priv;
- char *_lan;
- GF_ESD *esd;
- Bool is_hevc=GF_FALSE;
- u64 avg_rate, duration;
- s32 ref_count;
- s64 mediaOffset;
-
- GF_SAFEALLOC(priv, GF_ESIMP4);
- if (!priv) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_APP, ("Failed to allocate MP4 input handler\n"));
- return;
- }
-
- priv->mp4 = mp4;
- priv->track = track_num;
- priv->mtype = gf_isom_get_media_type(priv->mp4, priv->track);
- priv->mstype = gf_isom_get_media_subtype(priv->mp4, priv->track, 1);
- priv->loop = source->real_time ? GF_TRUE : GF_FALSE;
- priv->sample_count = gf_isom_get_sample_count(mp4, track_num);
- source->samples_count += priv->sample_count;
- if (priv->sample_count>1)
- source->nb_real_streams++;
-
- priv->source = source;
- memset(ifce, 0, sizeof(GF_ESInterface));
- ifce->stream_id = gf_isom_get_track_id(mp4, track_num);
-
- esd = gf_media_map_esd(mp4, track_num, 0);
-
- if (esd) {
- ifce->stream_type = esd->decoderConfig->streamType;
- ifce->object_type_indication = esd->decoderConfig->objectTypeIndication;
- if (esd->decoderConfig->decoderSpecificInfo && esd->decoderConfig->decoderSpecificInfo->dataLength) {
- switch (esd->decoderConfig->objectTypeIndication) {
- case GF_CODECID_AAC_MPEG4:
- case GF_CODECID_AAC_MPEG2_MP:
- case GF_CODECID_AAC_MPEG2_LCP:
- case GF_CODECID_AAC_MPEG2_SSRP:
- case GF_CODECID_MPEG4_PART2:
- ifce->decoder_config = (char *)gf_malloc(sizeof(char)*esd->decoderConfig->decoderSpecificInfo->dataLength);
- ifce->decoder_config_size = esd->decoderConfig->decoderSpecificInfo->dataLength;
- memcpy(ifce->decoder_config, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength);
- if (esd->decoderConfig->objectTypeIndication == GF_CODECID_MPEG4_PART2) {
- priv->dsi = (char *)gf_malloc(sizeof(char)*esd->decoderConfig->decoderSpecificInfo->dataLength);
- priv->dsi_size = esd->decoderConfig->decoderSpecificInfo->dataLength;
- memcpy(priv->dsi, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength);
- }
- break;
- case GF_CODECID_HEVC:
- case GF_CODECID_LHVC:
- is_hevc=GF_TRUE;
- case GF_CODECID_AVC:
- case GF_CODECID_SVC:
- case GF_CODECID_MVC:
- gf_isom_set_nalu_extract_mode(mp4, track_num, GF_ISOM_NALU_EXTRACT_LAYER_ONLY | GF_ISOM_NALU_EXTRACT_INBAND_PS_FLAG | GF_ISOM_NALU_EXTRACT_ANNEXB_FLAG | GF_ISOM_NALU_EXTRACT_VDRD_FLAG);
- break;
- case GF_CODECID_WEBVTT:
- ifce->decoder_config = (char *)gf_malloc(sizeof(char)*esd->decoderConfig->decoderSpecificInfo->dataLength);
- ifce->decoder_config_size = esd->decoderConfig->decoderSpecificInfo->dataLength;
- memcpy(ifce->decoder_config, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength);
- break;
- }
- }
- gf_odf_desc_del((GF_Descriptor *)esd);
- }
- gf_isom_get_media_language(mp4, track_num, &_lan);
- if (!_lan || !strcmp(_lan, "und")) {
- ifce->lang = 0;
- } else {
- ifce->lang = GF_4CC(_lan[0],_lan[1],_lan[2],' ');
- }
- if (_lan) {
- gf_free(_lan);
- }
-
- ifce->timescale = gf_isom_get_media_timescale(mp4, track_num);
- ifce->duration = gf_isom_get_media_timescale(mp4, track_num);
- avg_rate = gf_isom_get_media_data_size(mp4, track_num);
- if (!avg_rate) return;
- avg_rate *= ifce->timescale * 8;
- if (0!=(duration=gf_isom_get_media_duration(mp4, track_num)))
- avg_rate /= duration;
-
- ifce->bit_rate = (u32) avg_rate;
- ifce->duration = (Double) (s64) gf_isom_get_media_duration(mp4, track_num);
- ifce->duration /= ifce->timescale;
-
- GF_SAFEALLOC(ifce->sl_config, GF_SLConfig);
- if (!ifce->sl_config) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_APP, ("Failed to allocate interface SLConfig\n"));
- return;
- }
-
- ifce->sl_config->tag = GF_ODF_SLC_TAG;
- ifce->sl_config->useAccessUnitStartFlag = 1;
- ifce->sl_config->useAccessUnitEndFlag = 1;
- ifce->sl_config->useRandomAccessPointFlag = 1;
- ifce->sl_config->useTimestampsFlag = 1;
- ifce->sl_config->timestampLength = 33;
- ifce->sl_config->timestampResolution = ifce->timescale;
-
- /*test mode in which time stamps are 90khz and not coded but copied over from PES header*/
- if (bifs_use_pes==2) {
- ifce->sl_config->timestampLength = 0;
- ifce->sl_config->timestampResolution = 90000;
- }
-
-#ifdef GPAC_DISABLE_ISOM_WRITE
- fprintf(stderr, "Warning: GPAC was compiled without ISOM Write support, can't set SL Config!\n");
-#else
- gf_isom_set_extraction_slc(mp4, track_num, 1, ifce->sl_config);
-#endif
-
- ifce->input_ctrl = mp4_input_ctrl;
- if (priv != ifce->input_udta) {
- if (ifce->input_udta)
- gf_free(ifce->input_udta);
- ifce->input_udta = priv;
- }
-
-
- if (! gf_isom_get_edit_list_type(mp4, track_num, &mediaOffset)) {
- priv->ts_offset = mediaOffset;
- }
-
- if (gf_isom_has_time_offset(mp4, track_num)==2) {
- priv->cts_dts_shift = gf_isom_get_cts_to_dts_shift(mp4, track_num);
- }
-
- ifce->depends_on_stream = 0;
- ref_count = gf_isom_get_reference_count(mp4, track_num, GF_ISOM_REF_SCAL);
- if (ref_count > 0) {
- gf_isom_get_reference_ID(mp4, track_num, GF_ISOM_REF_SCAL, (u32) ref_count, &ifce->depends_on_stream);
- } else if (is_hevc) {
- ref_count = gf_isom_get_reference_count(mp4, track_num, GF_ISOM_REF_BASE);
- if (ref_count > 0) {
- gf_isom_get_reference_ID(mp4, track_num, GF_ISOM_REF_BASE, (u32) ref_count, &ifce->depends_on_stream);
- }
- }
-
- if (compute_max_size) {
- u32 i;
- for (i=0; i < priv->sample_count; i++) {
- u32 s = gf_isom_get_sample_size(mp4, track_num, i+1);
- if (s>source->max_sample_size) source->max_sample_size = s;
- }
- }
-
-}
-
-#endif //GPAC_DISABLE_ISOM
-
-
-#ifndef GPAC_DISABLE_SENG
-static GF_Err seng_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
-{
- if (act_type==GF_ESI_INPUT_DESTROY) {
- //TODO: free my data
- if (ifce->input_udta)
- gf_free(ifce->input_udta);
- ifce->input_udta = NULL;
- return GF_OK;
- }
-
- return GF_OK;
-}
-#endif
-
-
-#ifndef GPAC_DISABLE_STREAMING
-typedef struct
-{
- /*RTP channel*/
- GF_RTPChannel *rtp_ch;
-
- /*depacketizer*/
- GF_RTPDepacketizer *depacketizer;
-
- GF_ESIPacket pck;
-
- GF_ESInterface *ifce;
-
- Bool cat_dsi, is_264;
- void *dsi_and_rap;
- u32 avc_dsi_size;
-
- Bool use_carousel;
- u32 au_sn;
-
- s64 ts_offset;
- Bool rtcp_init;
- M2TSSource *source;
-
- u32 min_dts_inc;
- u64 prev_cts;
- u64 prev_dts;
-} GF_ESIRTP;
-
-static GF_Err rtp_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
-{
- u32 size, PayloadStart;
- GF_Err e;
- GF_RTPHeader hdr;
- char buffer[8000];
- GF_ESIRTP *rtp = (GF_ESIRTP*)ifce->input_udta;
-
- if (!ifce->input_udta) return GF_BAD_PARAM;
-
- switch (act_type) {
- case GF_ESI_INPUT_DATA_FLUSH:
- /*flush rtcp channel*/
- while (1) {
- Bool has_sr = GF_FALSE;
- size = gf_rtp_read_rtcp(rtp->rtp_ch, buffer, 8000);
- if (!size) break;
- e = gf_rtp_decode_rtcp(rtp->rtp_ch, buffer, size, &has_sr);
-
- if (e == GF_EOS) ifce->caps |= GF_ESI_STREAM_IS_OVER;
-
- if (has_sr && !rtp->rtcp_init) {
- Double time = rtp->rtp_ch->last_SR_NTP_sec;
- time += ((Double)rtp->rtp_ch->last_SR_NTP_frac)/0xFFFFFFFF;
- if (!rtp->source->last_ntp) {
- rtp->source->last_ntp = time;
- }
- if (time >= rtp->source->last_ntp) {
- time -= rtp->source->last_ntp;
- } else {
- time = 0;
- }
- rtp->ts_offset = rtp->rtp_ch->last_SR_rtp_time;
- rtp->ts_offset -= (s64) (time * rtp->rtp_ch->TimeScale);
- rtp->rtcp_init = GF_TRUE;
- }
- }
- /*flush rtp channel*/
- while (1) {
- size = gf_rtp_read_rtp(rtp->rtp_ch, buffer, 8000);
- if (!size) break;
- e = gf_rtp_decode_rtp(rtp->rtp_ch, buffer, size, &hdr, &PayloadStart);
- if (e) return e;
- gf_rtp_depacketizer_process(rtp->depacketizer, &hdr, buffer + PayloadStart, size - PayloadStart);
- }
- return GF_OK;
- case GF_ESI_INPUT_DESTROY:
- gf_rtp_depacketizer_del(rtp->depacketizer);
- if (rtp->dsi_and_rap) gf_free(rtp->dsi_and_rap);
- gf_rtp_del(rtp->rtp_ch);
- gf_free(rtp);
-
- if (ifce->decoder_config) {
- gf_free(ifce->decoder_config);
- ifce->decoder_config = NULL;
- }
- ifce->input_udta = NULL;
- return GF_OK;
- }
- return GF_OK;
-}
-
-static void rtp_sl_packet_cbk(void *udta, char *payload, u32 size, GF_SLHeader *hdr, GF_Err e)
-{
- GF_ESIRTP *rtp = (GF_ESIRTP*)udta;
-
- /*sync not found yet, cannot start (since we don't support PCR discontinuities yet ...)*/
- if (!rtp->rtcp_init) return;
-
- /*try to compute a DTS*/
- if (hdr->accessUnitStartFlag && !hdr->decodingTimeStampFlag) {
- if (!rtp->prev_cts) {
- rtp->prev_cts = rtp->prev_dts = hdr->compositionTimeStamp;
- }
-
- if (hdr->compositionTimeStamp > rtp->prev_cts) {
- u32 diff = (u32) (hdr->compositionTimeStamp - rtp->prev_cts);
- if (!rtp->min_dts_inc || (rtp->min_dts_inc > diff)) {
- rtp->min_dts_inc = diff;
- rtp->prev_dts = hdr->compositionTimeStamp - diff;
- }
- }
- hdr->decodingTimeStampFlag = 1;
- hdr->decodingTimeStamp = rtp->prev_dts + rtp->min_dts_inc;
- rtp->prev_dts += rtp->min_dts_inc;
- if (hdr->compositionTimeStamp < hdr->decodingTimeStamp) {
- hdr->decodingTimeStamp = hdr->compositionTimeStamp;
- }
- }
-
- rtp->pck.data = payload;
- rtp->pck.data_len = size;
- rtp->pck.dts = hdr->decodingTimeStamp + rtp->ts_offset;
- rtp->pck.cts = hdr->compositionTimeStamp + rtp->ts_offset;
- rtp->pck.flags = 0;
- if (hdr->compositionTimeStampFlag) rtp->pck.flags |= GF_ESI_DATA_HAS_CTS;
- if (hdr->decodingTimeStampFlag) rtp->pck.flags |= GF_ESI_DATA_HAS_DTS;
- if (hdr->accessUnitStartFlag) rtp->pck.flags |= GF_ESI_DATA_AU_START;
- if (hdr->accessUnitEndFlag) rtp->pck.flags |= GF_ESI_DATA_AU_END;
- if (hdr->randomAccessPointFlag) rtp->pck.sap_type = 1;
-
- if (rtp->use_carousel) {
- if ((hdr->AU_sequenceNumber==rtp->au_sn) && hdr->randomAccessPointFlag) rtp->pck.flags |= GF_ESI_DATA_REPEAT;
- rtp->au_sn = hdr->AU_sequenceNumber;
- }
-
- if (rtp->is_264) {
- if (!payload) return;
-
- /*send a NALU delim: copy over NAL ref idc*/
- if (hdr->accessUnitStartFlag) {
- char sc[6];
- sc[0] = sc[1] = sc[2] = 0;
- sc[3] = 1;
- sc[4] = (payload[4] & 0x60) | GF_AVC_NALU_ACCESS_UNIT;
- sc[5] = 0xF0 /*7 "all supported NALUs" (=111) + rbsp trailing (10000)*/;
-
- rtp->pck.data = sc;
- rtp->pck.data_len = 6;
- rtp->ifce->output_ctrl(rtp->ifce, GF_ESI_OUTPUT_DATA_DISPATCH, &rtp->pck);
-
- rtp->pck.flags &= ~GF_ESI_DATA_AU_START;
-
- /*since we don't inspect the RTP content, we can only concatenate SPS and PPS indicated in SDP*/
- if (hdr->randomAccessPointFlag && rtp->dsi_and_rap) {
- rtp->pck.data = (char*)rtp->dsi_and_rap;
- rtp->pck.data_len = rtp->avc_dsi_size;
-
- rtp->ifce->output_ctrl(rtp->ifce, GF_ESI_OUTPUT_DATA_DISPATCH, &rtp->pck);
- }
-
- rtp->pck.data = payload;
- rtp->pck.data_len = size;
- }
-
- rtp->ifce->output_ctrl(rtp->ifce, GF_ESI_OUTPUT_DATA_DISPATCH, &rtp->pck);
- } else {
- if (rtp->cat_dsi && hdr->randomAccessPointFlag && hdr->accessUnitStartFlag) {
- if (rtp->dsi_and_rap) gf_free(rtp->dsi_and_rap);
- rtp->pck.data_len = size + rtp->depacketizer->sl_map.configSize;
- rtp->dsi_and_rap = gf_malloc(sizeof(char)*(rtp->pck.data_len));
- memcpy(rtp->dsi_and_rap, rtp->depacketizer->sl_map.config, rtp->depacketizer->sl_map.configSize);
- memcpy((char *) rtp->dsi_and_rap + rtp->depacketizer->sl_map.configSize, payload, size);
- rtp->pck.data = (char*)rtp->dsi_and_rap;
- }
- rtp->ifce->output_ctrl(rtp->ifce, GF_ESI_OUTPUT_DATA_DISPATCH, &rtp->pck);
- }
-}
-
-static void fill_rtp_es_ifce(GF_ESInterface *ifce, GF_SDPMedia *media, GF_SDPInfo *sdp, M2TSSource *source)
-{
- u32 i;
- GF_Err e;
- GF_X_Attribute*att;
- GF_ESIRTP *rtp;
- GF_RTPMap*map;
- GF_SDPConnection *conn;
- GF_RTSPTransport trans;
-
- /*check connection*/
- conn = sdp->c_connection;
- if (!conn) conn = (GF_SDPConnection*)gf_list_get(media->Connections, 0);
-
- /*check payload type*/
- map = (GF_RTPMap*)gf_list_get(media->RTPMaps, 0);
- GF_SAFEALLOC(rtp, GF_ESIRTP);
- if (!rtp) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_APP, ("Failed to allocate RTP input handler\n"));
- return;
- }
-
- memset(ifce, 0, sizeof(GF_ESInterface));
- rtp->rtp_ch = gf_rtp_new();
- i=0;
- while ((att = (GF_X_Attribute*)gf_list_enum(media->Attributes, &i))) {
- if (!stricmp(att->Name, "mpeg4-esid") && att->Value) ifce->stream_id = atoi(att->Value);
- }
-
- memset(&trans, 0, sizeof(GF_RTSPTransport));
- trans.Profile = media->Profile;
- trans.source = conn ? conn->host : sdp->o_address;
- trans.IsUnicast = gf_sk_is_multicast_address(trans.source) ? GF_FALSE : GF_TRUE;
- if (!trans.IsUnicast) {
- trans.port_first = media->PortNumber;
- trans.port_last = media->PortNumber + 1;
- trans.TTL = conn ? conn->TTL : 0;
- } else {
- trans.client_port_first = media->PortNumber;
- trans.client_port_last = media->PortNumber + 1;
- }
-
- if (gf_rtp_setup_transport(rtp->rtp_ch, &trans, NULL) != GF_OK) {
- gf_rtp_del(rtp->rtp_ch);
- fprintf(stderr, "Cannot initialize RTP transport\n");
- return;
- }
- /*setup depacketizer*/
- rtp->depacketizer = gf_rtp_depacketizer_new(media, rtp_sl_packet_cbk, rtp);
- if (!rtp->depacketizer) {
- gf_rtp_del(rtp->rtp_ch);
- fprintf(stderr, "Cannot create RTP depacketizer\n");
- return;
- }
- /*setup channel*/
- gf_rtp_setup_payload(rtp->rtp_ch, map->PayloadType, map->ClockRate);
- ifce->input_udta = rtp;
- ifce->input_ctrl = rtp_input_ctrl;
- rtp->ifce = ifce;
- rtp->source = source;
-
- ifce->object_type_indication = rtp->depacketizer->sl_map.CodecID;
- ifce->stream_type = rtp->depacketizer->sl_map.StreamType;
- ifce->timescale = gf_rtp_get_clockrate(rtp->rtp_ch);
- if (rtp->depacketizer->sl_map.config) {
- switch (ifce->object_type_indication) {
- case GF_CODECID_MPEG4_PART2:
- rtp->cat_dsi = GF_TRUE;
- break;
- case GF_CODECID_AVC:
- case GF_CODECID_SVC:
- case GF_CODECID_MVC:
- rtp->is_264 = GF_TRUE;
- rtp->depacketizer->flags |= GF_RTP_AVC_USE_ANNEX_B;
- {
-#ifndef GPAC_DISABLE_AV_PARSERS
- GF_AVCConfig *avccfg = gf_odf_avc_cfg_read(rtp->depacketizer->sl_map.config, rtp->depacketizer->sl_map.configSize);
- if (avccfg) {
- GF_AVCConfigSlot *slc;
- u32 i;
- GF_BitStream *bs;
-
- bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- for (i=0; i<gf_list_count(avccfg->sequenceParameterSets); i++) {
- slc = (GF_AVCConfigSlot*)gf_list_get(avccfg->sequenceParameterSets, i);
- gf_bs_write_u32(bs, 1);
- gf_bs_write_data(bs, slc->data, slc->size);
- }
- for (i=0; i<gf_list_count(avccfg->pictureParameterSets); i++) {
- slc = (GF_AVCConfigSlot*)gf_list_get(avccfg->pictureParameterSets, i);
- gf_bs_write_u32(bs, 1);
- gf_bs_write_data(bs, slc->data, slc->size);
- }
- gf_bs_get_content(bs, (char **) &rtp->dsi_and_rap, &rtp->avc_dsi_size);
- gf_bs_del(bs);
- }
- gf_odf_avc_cfg_del(avccfg);
-#endif
- }
- break;
- case GF_CODECID_AAC_MPEG4:
- ifce->decoder_config = (char*)gf_malloc(sizeof(char) * rtp->depacketizer->sl_map.configSize);
- ifce->decoder_config_size = rtp->depacketizer->sl_map.configSize;
- memcpy(ifce->decoder_config, rtp->depacketizer->sl_map.config, rtp->depacketizer->sl_map.configSize);
- break;
- }
- }
- if (rtp->depacketizer->sl_map.StreamStateIndication) {
- rtp->use_carousel = GF_TRUE;
- rtp->au_sn=0;
- }
-
- gf_rtp_depacketizer_reset(rtp->depacketizer, GF_TRUE);
- e = gf_rtp_initialize(rtp->rtp_ch, 0x100000ul, GF_FALSE, 0, 10, 200, NULL);
- if (e!=GF_OK) {
- gf_rtp_del(rtp->rtp_ch);
- fprintf(stderr, "Cannot initialize RTP channel: %s\n", gf_error_to_string(e));
- return;
- }
- fprintf(stderr, "RTP interface initialized\n");
-}
-#endif /*GPAC_DISABLE_STREAMING*/
-
-#ifndef GPAC_DISABLE_SENG
-static GF_Err void_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
-{
- return GF_OK;
-}
-#endif
-
-/*AAC import features*/
-#ifndef GPAC_DISABLE_PLAYER
-
-void *audio_prog = NULL;
-static void SampleCallBack(void *calling_object, u16 ESID, char *data, u32 size, u64 ts);
-#define DONT_USE_TERMINAL_MODULE_API
-#include "../../modules/aac_in/aac_in.c"
-AACReader *aac_reader = NULL;
-u64 audio_discontinuity_offset = 0;
-
-/*create an OD codec and encode the descriptor*/
-static GF_Err encode_audio_desc(GF_ESD *esd, GF_SimpleDataDescriptor *audio_desc)
-{
- GF_Err e;
- GF_ODCodec *odc = gf_odf_codec_new();
- GF_ODUpdate *od_com = (GF_ODUpdate*)gf_odf_com_new(GF_ODF_OD_UPDATE_TAG);
- GF_ObjectDescriptor *od = (GF_ObjectDescriptor*)gf_odf_desc_new(GF_ODF_OD_TAG);
- assert( esd );
- assert( audio_desc );
- gf_list_add(od->ESDescriptors, esd);
- od->objectDescriptorID = AUDIO_DATA_ESID;
- gf_list_add(od_com->objectDescriptors, od);
-
- e = gf_odf_codec_add_com(odc, (GF_ODCom*)od_com);
- if (e) {
- fprintf(stderr, "Audio input error add the command to be encoded\n");
- return e;
- }
- e = gf_odf_codec_encode(odc, 0);
- if (e) {
- fprintf(stderr, "Audio input error encoding the descriptor\n");
- return e;
- }
- e = gf_odf_codec_get_au(odc, &audio_desc->data, &audio_desc->size);
- if (e) {
- fprintf(stderr, "Audio input error getting the descriptor\n");
- return e;
- }
- e = gf_odf_com_del((GF_ODCom**)&od_com);
- if (e) {
- fprintf(stderr, "Audio input error deleting the command\n");
- return e;
- }
- gf_odf_codec_del(odc);
-
- return GF_OK;
-}
-
-#endif
-
-
-static void SampleCallBack(void *calling_object, u16 ESID, char *data, u32 size, u64 ts)
-{
- u32 i;
- //fprintf(stderr, "update: ESID=%d - size=%d - ts="LLD"\n", ESID, size, ts);
-
- if (calling_object) {
- M2TSSource *source = (M2TSSource *)calling_object;
-
-#ifndef GPAC_DISABLE_PLAYER
- if (ESID == AUDIO_DATA_ESID) {
- if (audio_OD_stream_id != (u32)-1) {
- /*this is the first time we get some audio data. Therefore we are sure we can retrieve the audio descriptor. Then we'll
- send it by calling this callback recursively so that a player gets the audio descriptor before audio data.
- Hack: the descriptor is carried thru the input_udta, you shall delete it*/
- GF_SimpleDataDescriptor *audio_desc = source->streams[audio_OD_stream_id].input_udta;
- if (audio_desc && !audio_desc->data) /*intended for HTTP/AAC: an empty descriptor was set (vs already filled for RTP/UDP MP3)*/
- {
- /*get the audio descriptor and encode it*/
- GF_ESD *esd = AAC_GetESD(aac_reader);
- assert(esd->slConfig->timestampResolution);
- esd->slConfig->useAccessUnitStartFlag = 1;
- esd->slConfig->useAccessUnitEndFlag = 1;
- esd->slConfig->useTimestampsFlag = 1;
- esd->slConfig->timestampLength = 33;
- /*audio stream, all samples are RAPs*/
- esd->slConfig->useRandomAccessPointFlag = 0;
- esd->slConfig->hasRandomAccessUnitsOnlyFlag = 1;
- for (i=0; i<source->nb_streams; i++) {
- if (source->streams[i].stream_id == AUDIO_DATA_ESID) {
- GF_Err e;
- source->streams[i].timescale = esd->slConfig->timestampResolution;
- e = gf_m2ts_program_stream_update_ts_scale(&source->streams[i], esd->slConfig->timestampResolution);
- if (e != GF_OK) {
- fprintf(stderr, "Failed updating TS program timescale\n");
- }
- else if (!source->streams[i].sl_config)
- source->streams[i].sl_config = (GF_SLConfig *)gf_odf_desc_new(GF_ODF_SLC_TAG);
-
- memcpy(source->streams[i].sl_config, esd->slConfig, sizeof(GF_SLConfig));
- break;
- }
- }
- esd->ESID = AUDIO_DATA_ESID;
- assert(audio_OD_stream_id != (u32)-1);
- encode_audio_desc(esd, audio_desc);
-
- /*build the ESI*/
- {
- /*audio OD descriptor: rap=1 and vers_inc=0*/
- GF_SAFEALLOC(source->streams[audio_OD_stream_id].input_udta, GF_ESIStream);
- if (!source->streams[audio_OD_stream_id].input_udta) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_APP, ("Failed to allocate aac input handler\n"));
- return;
- }
- ((GF_ESIStream*)source->streams[audio_OD_stream_id].input_udta)->rap = 1;
-
- /*we have the descriptor; now call this callback recursively so that a player gets the audio descriptor before audio data.*/
- source->repeat = 1;
- SampleCallBack(source, AUDIO_OD_ESID, audio_desc->data, audio_desc->size, 0/*gf_m2ts_get_sys_clock(muxer)*/);
- source->repeat = 0;
-
- /*clean*/
- gf_free(audio_desc->data);
- gf_free(audio_desc);
- gf_free(source->streams[audio_OD_stream_id].input_udta);
- source->streams[audio_OD_stream_id].input_udta = NULL;
- }
- }
- }
- /*update the timescale if needed*/
- else if (!source->audio_configured) {
- GF_ESD *esd = AAC_GetESD(aac_reader);
- assert(esd->slConfig->timestampResolution);
- for (i=0; i<source->nb_streams; i++) {
- if (source->streams[i].stream_id == AUDIO_DATA_ESID) {
- GF_Err e;
- source->streams[i].timescale = esd->slConfig->timestampResolution;
- source->streams[i].decoder_config = esd->decoderConfig->decoderSpecificInfo->data;
- source->streams[i].decoder_config_size = esd->decoderConfig->decoderSpecificInfo->dataLength;
- esd->decoderConfig->decoderSpecificInfo->data = NULL;
- esd->decoderConfig->decoderSpecificInfo->dataLength = 0;
- e = gf_m2ts_program_stream_update_ts_scale(&source->streams[i], esd->slConfig->timestampResolution);
- if (!e)
- source->audio_configured = 1;
- break;
- }
- }
- gf_odf_desc_del((GF_Descriptor *)esd);
- }
-
- /*overwrite timing as it is flushed to 0 on discontinuities*/
- ts += audio_discontinuity_offset;
- }
-#endif
- i=0;
- while (i<source->nb_streams) {
- if (source->streams[i].output_ctrl==NULL) {
- fprintf(stderr, "MULTIPLEX NOT YET CREATED\n");
- return;
- }
- if (source->streams[i].stream_id == ESID) {
- GF_ESIStream *priv = (GF_ESIStream *)source->streams[i].input_udta;
- GF_ESIPacket pck;
- memset(&pck, 0, sizeof(GF_ESIPacket));
- pck.data = data;
- pck.data_len = size;
- pck.flags |= GF_ESI_DATA_HAS_CTS;
- pck.flags |= GF_ESI_DATA_HAS_DTS;
- pck.flags |= GF_ESI_DATA_AU_START;
- pck.flags |= GF_ESI_DATA_AU_END;
- if (ts) pck.cts = pck.dts = ts;
-
- if (priv->rap)
- pck.sap_type = 1;
- if (source->repeat || !priv->vers_inc) {
- pck.flags |= GF_ESI_DATA_REPEAT;
- fprintf(stderr, "RAP carousel from scene engine sent: ESID=%d - size=%d - ts="LLD"\n", ESID, size, ts);
- } else {
- if (ESID != AUDIO_DATA_ESID && ESID != VIDEO_DATA_ESID) /*don't log A/V inputs*/
- fprintf(stderr, "Update from scene engine sent: ESID=%d - size=%d - ts="LLD"\n", ESID, size, ts);
- }
- source->streams[i].output_ctrl(&source->streams[i], GF_ESI_OUTPUT_DATA_DISPATCH, &pck);
- return;
- }
- i++;
- }
- }
- return;
-}
-
-//static gf_seng_callback * SampleCallBack = &mySampleCallBack;
-
-
-static volatile Bool run = 1;
-
-#ifndef GPAC_DISABLE_SENG
-static GF_ESIStream * set_broadcast_params(M2TSSource *source, u16 esid, u32 period, u32 ts_delta, u16 aggregate_on_stream, Bool adjust_carousel_time, Bool force_rap, Bool aggregate_au, Bool discard_pending, Bool signal_rap, Bool signal_critical, Bool version_inc)
-{
- u32 i=0;
- GF_ESIStream *priv=NULL;
- GF_ESInterface *esi=NULL;
-
- /*locate our stream*/
- if (esid) {
- while (i<source->nb_streams) {
- if (source->streams[i].stream_id == esid) {
- priv = (GF_ESIStream *)source->streams[i].input_udta;
- esi = &source->streams[i];
- break;
- }
- else {
- i++;
- }
- }
- /*TODO: stream not found*/
- }
-
- /*TODO - set/reset the ESID for the parsers*/
- if (!priv) return NULL;
-
- /*TODO - if discard is set, abort current carousel*/
- if (discard_pending) {
- }
-
- /*remember RAP flag*/
- priv->rap = signal_rap;
- priv->critical = signal_critical;
- priv->vers_inc = version_inc;
-
- priv->ts_delta = ts_delta;
- priv->adjust_carousel_time = adjust_carousel_time;
-
- /*change stream aggregation mode*/
- if ((aggregate_on_stream != (u16)-1) && (priv->aggregate_on_stream != aggregate_on_stream)) {
- gf_seng_enable_aggregation(source->seng, esid, aggregate_on_stream);
- priv->aggregate_on_stream = aggregate_on_stream;
- }
- /*change stream aggregation mode*/
- if (priv->aggregate_on_stream==esi->stream_id) {
- if (priv->aggregate_on_stream && (period!=(u32)-1) && (esi->repeat_rate != period)) {
- esi->repeat_rate = period;
- }
- } else {
- esi->repeat_rate = 0;
- }
- return priv;
-}
-#endif
-
-#ifndef GPAC_DISABLE_SENG
-
-static u32 seng_output(void *param)
-{
- GF_Err e;
- u64 last_src_modif, mod_time;
- M2TSSource *source = (M2TSSource *)param;
- GF_SceneEngine *seng = source->seng;
-#ifndef GPAC_DISABLE_PLAYER
- GF_SimpleDataDescriptor *audio_desc;
-#endif
- Bool update_context=0;
- Bool force_rap, adjust_carousel_time, discard_pending, signal_rap, signal_critical, version_inc, aggregate_au;
- u32 period, ts_delta;
- u16 es_id, aggregate_on_stream;
- e = GF_OK;
- gf_sleep(2000); /*TODO: events instead? What are we waiting for?*/
- gf_seng_encode_context(seng, SampleCallBack);
-
- last_src_modif = source->bifs_src_name ? gf_file_modification_time(source->bifs_src_name) : 0;
-
- /*send the audio descriptor*/
-#ifndef GPAC_DISABLE_PLAYER
- if (source->mpeg4_signaling==GF_M2TS_MPEG4_SIGNALING_FULL && audio_OD_stream_id!=(u32)-1) {
- audio_desc = source->streams[audio_OD_stream_id].input_udta;
- if (audio_desc && audio_desc->data) /*RTP/UDP + MP3 case*/
- {
- assert(audio_OD_stream_id != (u32)-1);
- assert(!aac_reader); /*incompatible with AAC*/
- source->repeat = 1;
- SampleCallBack(source, AUDIO_OD_ESID, audio_desc->data, audio_desc->size, 0/*gf_m2ts_get_sys_clock(muxer)*/);
- source->repeat = 0;
- gf_free(audio_desc->data);
- gf_free(audio_desc);
- source->streams[audio_OD_stream_id].input_udta = NULL;
- }
- }
-#endif
-
- while (run) {
- if (!gf_prompt_has_input()) {
- if (source->bifs_src_name) {
- mod_time = gf_file_modification_time(source->bifs_src_name);
- if (mod_time != last_src_modif) {
- FILE *srcf;
- char flag_buf[201], *flag;
- fprintf(stderr, "Update file modified - processing\n");
- last_src_modif = mod_time;
-
- srcf = gf_fopen(source->bifs_src_name, "rt");
- if (!srcf) continue;
-
- /*checks if we have a broadcast config*/
- if (!fgets(flag_buf, 200, srcf))
- flag_buf[0] = '\0';
- gf_fclose(srcf);
-
- aggregate_au = force_rap = adjust_carousel_time = discard_pending = signal_rap = signal_critical = 0;
- version_inc = 1;
- period = -1;
- aggregate_on_stream = -1;
- ts_delta = 0;
- es_id = 0;
-
- /*find our keyword*/
- flag = strstr(flag_buf, "gpac_broadcast_config ");
- if (flag) {
- flag += strlen("gpac_broadcast_config ");
- /*move to next word*/
- while (flag && (flag[0]==' ')) flag++;
-
- while (1) {
- char *sep = strchr(flag, ' ');
- if (sep) sep[0] = 0;
- if (!strnicmp(flag, "esid=", 5)) {
- /*ESID on which the update is applied*/
- es_id = atoi(flag+5);
- } else if (!strnicmp(flag, "period=", 7)) {
- /*TODO: target period carousel for ESID ??? (ESID/carousel)*/
- period = atoi(flag+7);
- } else if (!strnicmp(flag, "ts=", 3)) {
- /*TODO: */
- ts_delta = atoi(flag+3);
- } else if (!strnicmp(flag, "carousel=", 9)) {
- /*TODO: why? => sends the update on carousel id specified by this argument*/
- aggregate_on_stream = atoi(flag+9);
- } else if (!strnicmp(flag, "restamp=", 8)) {
- /*CTS is updated when carouselled*/
- adjust_carousel_time = atoi(flag+8);
- } else if (!strnicmp(flag, "discard=", 8)) {
- /*when we receive several updates during a single carousel period, this attribute specifies whether the current update discard pending ones*/
- discard_pending = atoi(flag+8);
- } else if (!strnicmp(flag, "aggregate=", 10)) {
- /*Boolean*/
- aggregate_au = atoi(flag+10);
- } else if (!strnicmp(flag, "force_rap=", 10)) {
- /*TODO: */
- force_rap = atoi(flag+10);
- } else if (!strnicmp(flag, "rap=", 4)) {
- /*TODO: */
- signal_rap = atoi(flag+4);
- } else if (!strnicmp(flag, "critical=", 9)) {
- /*TODO: */
- signal_critical = atoi(flag+9);
- } else if (!strnicmp(flag, "vers_inc=", 9)) {
- /*Boolean to increment m2ts section version number*/
- version_inc = atoi(flag+9);
- }
- if (sep) {
- sep[0] = ' ';
- flag = sep+1;
- } else {
- break;
- }
- }
-
- set_broadcast_params(source, es_id, period, ts_delta, aggregate_on_stream, adjust_carousel_time, force_rap, aggregate_au, discard_pending, signal_rap, signal_critical, version_inc);
- }
-
- e = gf_seng_encode_from_file(seng, es_id, aggregate_au ? 0 : 1, source->bifs_src_name, SampleCallBack);
- if (e) {
- fprintf(stderr, "Processing command failed: %s\n", gf_error_to_string(e));
- } else
- gf_seng_aggregate_context(seng, 0);
-
- update_context=1;
-
-
-
- }
- }
- if (update_context) {
- source->repeat = 1;
- e = gf_seng_encode_context(seng, SampleCallBack);
- source->repeat = 0;
- update_context = 0;
- }
-
- gf_sleep(10);
- } else { /*gf_prompt_has_input()*/
- char c = gf_prompt_get_char();
- switch (c) {
- case 'u':
- {
- GF_Err e;
- char szCom[8192];
- fprintf(stderr, "Enter command to send:\n");
- fflush(stdin);
- szCom[0] = 0;
- if (1 > scanf("%[^\t\n]", szCom)) {
- fprintf(stderr, "No command has been properly entered, aborting.\n");
- break;
- }
- e = gf_seng_encode_from_string(seng, 0, 0, szCom, SampleCallBack);
- if (e) {
- fprintf(stderr, "Processing command failed: %s\n", gf_error_to_string(e));
- }
- update_context=1;
- }
- break;
- case 'p':
- {
- char rad[GF_MAX_PATH];
- fprintf(stderr, "Enter output file name - \"std\" for stderr: ");
- if (1 > scanf("%s", rad)) {
- fprintf(stderr, "No outfile name has been entered, aborting.\n");
- break;
- }
- e = gf_seng_save_context(seng, !strcmp(rad, "std") ? NULL : rad);
- fprintf(stderr, "Dump done (%s)\n", gf_error_to_string(e));
- }
- break;
- case 'q':
- {
- run = 0;
- }
- }
- e = GF_OK;
- }
- }
-
-
- return e ? 1 : 0;
-}
-
-void fill_seng_es_ifce(GF_ESInterface *ifce, u32 i, GF_SceneEngine *seng, u32 period)
-{
- GF_Err e = GF_OK;
- u32 len;
- GF_ESIStream *stream;
- char *config_buffer = NULL;
-
- memset(ifce, 0, sizeof(GF_ESInterface));
- e = gf_seng_get_stream_config(seng, i, (u16*) &(ifce->stream_id), &config_buffer, &len, (u32*) &(ifce->stream_type), (u32*) &(ifce->object_type_indication), &(ifce->timescale));
- if (e) {
- fprintf(stderr, "Cannot set the stream config for stream %d to %d: %s\n", ifce->stream_id, period, gf_error_to_string(e));
- }
-
- ifce->repeat_rate = period;
- GF_SAFEALLOC(stream, GF_ESIStream);
- if (!stream) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_APP, ("Failed to allocate SENG input handler\n"));
- return;
- }
-
- stream->rap = 1;
- if (ifce->input_udta)
- gf_free(ifce->input_udta);
- ifce->input_udta = stream;
-
- //fprintf(stderr, "Caroussel period: %d\n", period);
-// e = gf_seng_set_carousel_time(seng, ifce->stream_id, period);
- if (e) {
- fprintf(stderr, "Cannot set carousel time on stream %d to %d: %s\n", ifce->stream_id, period, gf_error_to_string(e));
- }
- ifce->input_ctrl = seng_input_ctrl;
-
-}
-#endif
-
-static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mpeg4_signaling, char *update, char *audio_input_ip, u16 audio_input_port, char *video_buffer, Bool force_real_time, u32 bifs_use_pes, const char *temi_url, Bool compute_max_size, Bool insert_ntp)
-{
-#ifndef GPAC_DISABLE_STREAMING
- GF_SDPInfo *sdp;
-#endif
-
- memset(source, 0, sizeof(M2TSSource));
- source->mpeg4_signaling = mpeg4_signaling;
-
- /*open ISO file*/
-#ifndef GPAC_DISABLE_ISOM
- if (gf_isom_probe_file(src)) {
- u32 i;
- u32 nb_tracks;
- Bool has_bifs_od = 0;
- Bool temi_assigned = 0;
- u32 first_audio = 0;
- u32 first_other = 0;
- s64 min_offset = 0;
- u32 min_offset_timescale = 0;
- source->mp4 = gf_isom_open(src, GF_ISOM_OPEN_READ, 0);
- if (!source->mp4)
- return GF_FALSE;
- source->nb_streams = 0;
- source->real_time = force_real_time;
- /*on MPEG-2 TS, carry 3GPP timed text as MPEG-4 Part17*/
- gf_isom_text_set_streaming_mode(source->mp4, 1);
- nb_tracks = gf_isom_get_track_count(source->mp4);
-
- for (i=0; i<nb_tracks; i++) {
- Bool check_deps = 0;
- if (gf_isom_get_media_type(source->mp4, i+1) == GF_ISOM_MEDIA_HINT)
- continue;
-
- fill_isom_es_ifce(source, &source->streams[i], source->mp4, i+1, bifs_use_pes, compute_max_size);
- if (!source->streams[i].input_udta) continue;
- if (min_offset > ((GF_ESIMP4 *)source->streams[i].input_udta)->ts_offset) {
- min_offset = ((GF_ESIMP4 *)source->streams[i].input_udta)->ts_offset;
- min_offset_timescale = source->streams[i].timescale;
- }
-
- switch(source->streams[i].stream_type) {
- case GF_STREAM_OD:
- has_bifs_od = 1;
- source->streams[i].repeat_rate = carousel_rate;
- break;
- case GF_STREAM_SCENE:
- has_bifs_od = 1;
- source->streams[i].repeat_rate = carousel_rate;
- break;
- case GF_STREAM_VISUAL:
- /*turn on image repeat*/
- switch (source->streams[i].object_type_indication) {
- case GF_CODECID_JPEG:
- case GF_CODECID_PNG:
- ((GF_ESIMP4 *)source->streams[i].input_udta)->image_repeat_ms = carousel_rate;
- break;
- default:
- check_deps = 1;
- if (gf_isom_get_sample_count(source->mp4, i+1)>1) {
- /*get first visual stream as PCR*/
- if (!source->pcr_idx) {
- source->pcr_idx = i+1;
- if ((temi_id_1>=0) || (temi_id_2>=0)) {
- temi_assigned = GF_TRUE;
- ((GF_ESIMP4 *)source->streams[i].input_udta)->timeline_id = (u32) ( (temi_id_1>=0) ? temi_id_1 + 1 : temi_id_2 + 1 );
- ((GF_ESIMP4 *)source->streams[i].input_udta)->insert_ntp = insert_ntp;
-
- if (temi_url && (temi_id_1>=0))
- ((GF_ESIMP4 *)source->streams[i].input_udta)->temi_url = temi_url;
-
- if (temi_id_1>=0) temi_id_1 = -1;
- else temi_id_2 = -1;
- }
- }
- }
- break;
- }
- break;
- case GF_STREAM_AUDIO:
- if (!first_audio) first_audio = i+1;
- check_deps = 1;
- break;
- default:
- /*log not supported stream type: %s*/
- break;
- }
- source->nb_streams++;
- if (gf_isom_get_sample_count(source->mp4, i+1)>1) first_other = i+1;
-
- if (check_deps) {
- u32 k;
- Bool found_dep = 0;
- for (k=0; k<nb_tracks; k++) {
- if (gf_isom_get_media_type(source->mp4, k+1) != GF_ISOM_MEDIA_OD)
- continue;
-
- /*this stream is not refered to by any OD, send as regular PES*/
- if (gf_isom_has_track_reference(source->mp4, k+1, GF_ISOM_REF_OD, gf_isom_get_track_id(source->mp4, i+1) )==1) {
- found_dep = 1;
- break;
- }
- }
- if (!found_dep) {
- source->streams[i].caps |= GF_ESI_STREAM_WITHOUT_MPEG4_SYSTEMS;
- }
- }
- }
- if (has_bifs_od && !source->mpeg4_signaling) source->mpeg4_signaling = GF_M2TS_MPEG4_SIGNALING_FULL;
- if ( !temi_assigned && first_audio && ((temi_id_1>=0) || (temi_id_2>=0) ) ) {
- ((GF_ESIMP4 *)source->streams[first_audio-1].input_udta)->timeline_id = (u32) ( (temi_id_1>=0) ? temi_id_1 + 1 : temi_id_2 + 1 );
- ((GF_ESIMP4 *)source->streams[first_audio-1].input_udta)->insert_ntp = insert_ntp;
-
- if (temi_url && (temi_id_1>=0) )
- ((GF_ESIMP4 *)source->streams[first_audio-1].input_udta)->temi_url = temi_url;
-
- if (temi_id_1>=0) temi_id_1 = -1;
- else temi_id_2 = -1;
- }
-
- /*if no visual PCR found, use first audio*/
- if (!source->pcr_idx) source->pcr_idx = first_audio;
- if (!source->pcr_idx) source->pcr_idx = first_other;
- if (source->pcr_idx) {
- GF_ESIMP4 *priv;
- source->pcr_idx-=1;
- priv = source->streams[source->pcr_idx].input_udta;
- gf_isom_set_default_sync_track(source->mp4, priv->track);
- }
-
- if (min_offset < 0) {
- for (i=0; i<source->nb_streams; i++) {
- Double scale = source->streams[i].timescale;
- scale /= min_offset_timescale;
- ((GF_ESIMP4 *)source->streams[i].input_udta)->ts_offset += (s64) (-min_offset * scale);
- }
- }
-
- source->iod = gf_isom_get_root_od(source->mp4);
- if (source->iod) {
- GF_ObjectDescriptor*iod = (GF_ObjectDescriptor*)source->iod;
- if (gf_list_count( ((GF_ObjectDescriptor*)source->iod)->ESDescriptors) == 0) {
- gf_odf_desc_del(source->iod);
- source->iod = NULL;
- } else {
- fprintf(stderr, "IOD found for program %s\n", src);
-
- /*if using 4over2, get rid of OD tracks*/
- if (source->mpeg4_signaling==GF_M2TS_MPEG4_SIGNALING_SCENE) {
- for (i=0; i<gf_list_count(iod->ESDescriptors); i++) {
- u32 track_num, k;
- GF_M2TSDescriptor *oddesc;
- GF_ISOSample *sample;
- GF_ESD *esd = gf_list_get(iod->ESDescriptors, i);
- if (esd->decoderConfig->streamType!=GF_STREAM_OD) continue;
- track_num = gf_isom_get_track_by_id(source->mp4, esd->ESID);
- if (gf_isom_get_sample_count(source->mp4, track_num)>1) continue;
-
- sample = gf_isom_get_sample(source->mp4, track_num, 1, NULL);
- if (sample->dataLength >= 255-2) {
- gf_isom_sample_del(&sample);
- continue;
- }
- /*rewrite ESD dependencies*/
- for (k=0; k<gf_list_count(iod->ESDescriptors); k++) {
- GF_ESD *dep_esd = gf_list_get(iod->ESDescriptors, k);
- if (dep_esd->dependsOnESID==esd->ESID) dep_esd->dependsOnESID = esd->dependsOnESID;
- }
-
- for (k=0; k<source->nb_streams; k++) {
- if (source->streams[k].stream_id==esd->ESID) {
- source->streams[k].stream_type = 0;
- break;
- }
- }
-
- if (!source->od_updates) source->od_updates = gf_list_new();
- GF_SAFEALLOC(oddesc, GF_M2TSDescriptor);
- oddesc->data_len = sample->dataLength;
- oddesc->data = sample->data;
- oddesc->tag = GF_M2TS_MPEG4_ODUPDATE_DESCRIPTOR;
- sample->data = NULL;
- gf_isom_sample_del(&sample);
- gf_list_add(source->od_updates, oddesc);
-
- gf_list_rem(iod->ESDescriptors, i);
- i--;
- gf_odf_desc_del((GF_Descriptor *) esd);
- source->samples_count--;
- }
- }
-
- }
- }
- return 1;
- }
-#endif
-
-
-#ifndef GPAC_DISABLE_STREAMING
- /*open SDP file*/
- if (strstr(src, ".sdp")) {
- GF_X_Attribute *att;
- char *sdp_buf;
- u32 sdp_size, i;
- GF_Err e;
-
- e = gf_file_load_data(src, (u8 **) &sdp_buf, &sdp_size);
- if (e) {
- fprintf(stderr, "Error opening %s\n", src);
- return 0;
- }
-
- sdp = gf_sdp_info_new();
- e = gf_sdp_info_parse(sdp, sdp_buf, sdp_size);
- gf_free(sdp_buf);
- if (e) {
- fprintf(stderr, "Error opening %s : %s\n", src, gf_error_to_string(e));
- gf_sdp_info_del(sdp);
- return 0;
- }
-
- i=0;
- while ((att = (GF_X_Attribute*)gf_list_enum(sdp->Attributes, &i))) {
- char buf[2000];
- u32 size;
- char *buf64;
- u32 size64;
- char *iod_str;
- if (strcmp(att->Name, "mpeg4-iod") ) continue;
- iod_str = att->Value + 1;
- if (strnicmp(iod_str, "data:application/mpeg4-iod;base64", strlen("data:application/mpeg4-iod;base64"))) continue;
-
- buf64 = strstr(iod_str, ",");
- if (!buf64) break;
- buf64 += 1;
- size64 = (u32) strlen(buf64) - 1;
- size = gf_base64_decode(buf64, size64, buf, 2000);
-
- gf_odf_desc_read(buf, size, &source->iod);
- break;
- }
-
- source->nb_streams = gf_list_count(sdp->media_desc);
- for (i=0; i<source->nb_streams; i++) {
- GF_SDPMedia *media = gf_list_get(sdp->media_desc, i);
- fill_rtp_es_ifce(&source->streams[i], media, sdp, source);
- switch(source->streams[i].stream_type) {
- case GF_STREAM_OD:
- case GF_STREAM_SCENE:
- source->mpeg4_signaling = GF_M2TS_MPEG4_SIGNALING_FULL;
- source->streams[i].repeat_rate = carousel_rate;
- break;
- }
- if (!source->pcr_idx && (source->streams[i].stream_type == GF_STREAM_VISUAL)) {
- source->pcr_idx = i+1;
- }
- }
-
- if (source->pcr_idx) source->pcr_idx-=1;
- gf_sdp_info_del(sdp);
-
- return 2;
- } else
-#endif /*GPAC_DISABLE_STREAMING*/
-
-#ifndef GPAC_DISABLE_SENG
- if (strstr(src, ".bt")) //open .bt file
- {
- u32 i;
- u32 load_type=0;
- source->seng = gf_seng_init(source, src, load_type, NULL, (load_type == GF_SM_LOAD_DIMS) ? 1 : 0);
- if (!source->seng) {
- fprintf(stderr, "Cannot create scene engine\n");
- exit(1);
- }
- else {
- fprintf(stderr, "Scene engine created.\n");
- }
- assert( source );
- assert( source->seng);
- source->iod = gf_seng_get_iod(source->seng);
- if (! source->iod) {
- fprintf(stderr, __FILE__": No IOD\n");
- }
-
- source->nb_streams = gf_seng_get_stream_count(source->seng);
- source->rate = carousel_rate;
- source->mpeg4_signaling = GF_M2TS_MPEG4_SIGNALING_FULL;
-
- for (i=0; i<source->nb_streams; i++) {
- fill_seng_es_ifce(&source->streams[i], i, source->seng, source->rate);
- //fprintf(stderr, "Fill interface\n");
- if (!source->pcr_idx && (source->streams[i].stream_type == GF_STREAM_AUDIO)) {
- source->pcr_idx = i+1;
- }
- }
-
-#ifndef GPAC_DISABLE_PLAYER
- /*when an audio input is present, declare it and store OD + ESD_U*/
- if (audio_input_ip) {
- /*add the audio program*/
- source->pcr_idx = source->nb_streams;
- source->streams[source->nb_streams].stream_type = GF_STREAM_AUDIO;
- /*hack: http urls are not decomposed therefore audio_input_port remains null*/
- if (audio_input_port) { /*UDP/RTP*/
- source->streams[source->nb_streams].object_type_indication = GF_CODECID_MPEG_AUDIO;
- } else { /*HTTP*/
- aac_reader->oti = source->streams[source->nb_streams].object_type_indication = GF_CODECID_AAC_MPEG4;
- }
- source->streams[source->nb_streams].input_ctrl = void_input_ctrl;
- source->streams[source->nb_streams].stream_id = AUDIO_DATA_ESID;
- source->streams[source->nb_streams].timescale = 1000;
-
- GF_SAFEALLOC(source->streams[source->nb_streams].input_udta, GF_ESIStream);
- if (!source->streams[source->nb_streams].input_udta) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_APP, ("Failed to allocate audio input handler\n"));
- return 0;
- }
-
- ((GF_ESIStream*)source->streams[source->nb_streams].input_udta)->vers_inc = 1; /*increment version number at every audio update*/
- assert( source );
- //assert( source->iod);
- if (source->iod && ((source->iod->tag!=GF_ODF_IOD_TAG) || (mpeg4_signaling != GF_M2TS_MPEG4_SIGNALING_SCENE))) {
- /*create the descriptor*/
- GF_ESD *esd;
- GF_SimpleDataDescriptor *audio_desc;
- GF_SAFEALLOC(audio_desc, GF_SimpleDataDescriptor);
- if (audio_input_port) { /*UDP/RTP*/
- esd = gf_odf_desc_esd_new(0);
- esd->decoderConfig->streamType = source->streams[source->nb_streams].stream_type;
- esd->decoderConfig->objectTypeIndication = source->streams[source->nb_streams].object_type_indication;
- } else { /*HTTP*/
- esd = AAC_GetESD(aac_reader); /*in case of AAC, we have to wait the first ADTS chunk*/
- }
- assert( esd );
- esd->ESID = source->streams[source->nb_streams].stream_id;
- if (esd->slConfig->timestampResolution) /*in case of AAC, we have to wait the first ADTS chunk*/
- encode_audio_desc(esd, audio_desc);
- else
- gf_odf_desc_del((GF_Descriptor *)esd);
-
- /*find the audio OD stream and attach its descriptor*/
- for (i=0; i<source->nb_streams; i++) {
- if (source->streams[i].stream_id == AUDIO_OD_ESID) {
- if (source->streams[i].input_udta)
- gf_free(source->streams[i].input_udta);
- source->streams[i].input_udta = (void*)audio_desc; /*Hack: the real input_udta type (for our SampleCallBack function) is GF_ESIStream*/
- audio_OD_stream_id = i;
- break;
- }
- }
- if (audio_OD_stream_id == (u32)-1) {
- fprintf(stderr, "Error: could not find an audio OD stream with ESID=100 in '%s'\n", src);
- return 0;
- }
- } else {
- source->mpeg4_signaling = GF_M2TS_MPEG4_SIGNALING_SCENE;
- }
- source->nb_streams++;
- }
-#endif
-
- /*when an audio input is present, declare it and store OD + ESD_U*/
- if (video_buffer) {
- /*add the video program*/
- source->streams[source->nb_streams].stream_type = GF_STREAM_VISUAL;
- source->streams[source->nb_streams].object_type_indication = GF_CODECID_AVC;
- source->streams[source->nb_streams].input_ctrl = void_input_ctrl;
- source->streams[source->nb_streams].stream_id = VIDEO_DATA_ESID;
- source->streams[source->nb_streams].timescale = 1000;
-
- GF_SAFEALLOC(source->streams[source->nb_streams].input_udta, GF_ESIStream);
- if (!source->streams[source->nb_streams].input_udta) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_APP, ("Failed to allocate video input handler\n"));
- return 0;
- }
- ((GF_ESIStream*)source->streams[source->nb_streams].input_udta)->vers_inc = 1; /*increment version number at every video update*/
- assert(source);
-
- if (source->iod && ((source->iod->tag!=GF_ODF_IOD_TAG) || (mpeg4_signaling != GF_M2TS_MPEG4_SIGNALING_SCENE))) {
- assert(0); /*TODO*/
-#if 0
- /*create the descriptor*/
- GF_ESD *esd;
- GF_SimpleDataDescriptor *video_desc;
- GF_SAFEALLOC(video_desc, GF_SimpleDataDescriptor);
- esd = gf_odf_desc_esd_new(0);
- esd->decoderConfig->streamType = source->streams[source->nb_streams].stream_type;
- esd->decoderConfig->objectTypeIndication = source->streams[source->nb_streams].object_type_indication;
- esd->ESID = source->streams[source->nb_streams].stream_id;
-
- /*find the audio OD stream and attach its descriptor*/
- for (i=0; i<source->nb_streams; i++) {
- if (source->streams[i].stream_id == 103/*TODO: VIDEO_OD_ESID*/) {
- if (source->streams[i].input_udta)
- gf_free(source->streams[i].input_udta);
- source->streams[i].input_udta = (void*)video_desc;
- audio_OD_stream_id = i;
- break;
- }
- }
- if (audio_OD_stream_id == (u32)-1) {
- fprintf(stderr, "Error: could not find an audio OD stream with ESID=100 in '%s'\n", src);
- return 0;
- }
-#endif
- } else {
- assert (source->mpeg4_signaling == GF_M2TS_MPEG4_SIGNALING_SCENE);
- }
-
- source->nb_streams++;
- }
-
- if (!source->pcr_idx) source->pcr_idx=1;
- source->th = gf_th_new("Carousel");
- source->bifs_src_name = update;
- gf_th_run(source->th, seng_output, source);
- return 1;
- } else
-#endif
- {
- FILE *f = gf_fopen(src, "rt");
- if (f) {
- gf_fclose(f);
- fprintf(stderr, "Error opening %s - not a supported input media, skipping.\n", src);
- } else {
- fprintf(stderr, "Error opening %s - no such file.\n", src);
- }
- return 0;
- }
-}
-
-#ifdef GPAC_MEMORY_TRACKING
-GF_MemTrackerType mem_track = GF_MemTrackerNone;
-#endif
-
-/*macro to keep retro compatibility with '=' and spaces in parse_args*/
-#define CHECK_PARAM(param) (!strnicmp(arg, param, strlen(param)) \
- && ( ((arg[strlen(param)] == '=') && (next_arg = arg+strlen(param)+1)) \
- || ((strlen(arg) == strlen(param)) && ++i && (i<argc) && (next_arg = argv[i]))))
-
-/*parse MP42TS arguments*/
-static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *carrousel_rate, s64 *pcr_init_val, u32 *pcr_offset, u32 *psi_refresh_rate, GF_M2TS_PackMode *pes_packing_mode, u32 *bifs_use_pes,
- M2TSSource *sources, u32 *nb_sources, char **bifs_src_name,
- Bool *real_time, u32 *run_time, char **video_buffer, u32 *video_buffer_size,
- u32 *audio_input_type, char **audio_input_ip, u16 *audio_input_port,
- u32 *output_type, char **ts_out, char **udp_out, char **rtp_out, u16 *output_port,
- char** segment_dir, u32 *segment_duration, char **segment_manifest, u32 *segment_number, char **segment_http_prefix, u32 *split_rap, u32 *nb_pck_pack, u32 *pcr_ms, u32 *ttl, const char **ip_ifce, const char **temi_url, u32 *sdt_refresh_rate, Bool *enable_forced_pcr)
-{
- Bool rate_found=0, mpeg4_carousel_found=0, time_found=0, src_found=0, dst_found=0, audio_input_found=0, video_input_found=0,
- seg_dur_found=0, seg_dir_found=0, seg_manifest_found=0, seg_number_found=0, seg_http_found=0, real_time_found=0, insert_ntp=0;
- char *arg = NULL, *next_arg = NULL, *error_msg = "no argument found";
- u32 mpeg4_signaling = GF_M2TS_MPEG4_SIGNALING_NONE;
- Bool force_real_time = 0;
- s32 i;
-
- /*first pass: find audio - NO GPAC INIT MODIFICATION MUST OCCUR IN THIS PASS*/
- for (i=1; i<argc; i++) {
- arg = argv[i];
- if (!stricmp(arg, "-h") || strstr(arg, "-help")) {
- usage();
- return GF_EOS;
- }
- else if (!stricmp(arg, "-hc") ) {
- fprintf(stderr, "libgpac options:\n");
- gf_sys_print_core_help(GF_ARGMODE_ALL, 0);
- return GF_EOS;
- }
- else if (CHECK_PARAM("-pcr-init")) {
- sscanf(next_arg, LLD, pcr_init_val);
- }
- else if (CHECK_PARAM("-pcr-offset")) {
- *pcr_offset = atoi(next_arg);
- }
- else if (CHECK_PARAM("-video")) {
- GF_Err e;
- if (video_input_found) {
- error_msg = "multiple '-video' found";
- arg = NULL;
- goto error;
- }
- video_input_found = 1;
- e = gf_file_load_data(next_arg, (u8 **) video_buffer, video_buffer_size);
- if (e) {
- fprintf(stderr, "Error while reading video file %s\n", next_arg);
- goto error;
- }
- } else if (CHECK_PARAM("-audio")) {
- if (audio_input_found) {
- error_msg = "multiple '-audio' found";
- arg = NULL;
- goto error;
- }
- audio_input_found = 1;
- if (!strnicmp(next_arg, "udp://", 6) || !strnicmp(next_arg, "rtp://", 6) || !strnicmp(next_arg, "http://", 7)) {
- char *sep;
- /*set audio input type*/
- if (!strnicmp(next_arg, "udp://", 6))
- *audio_input_type = GF_MP42TS_UDP;
- else if (!strnicmp(next_arg, "rtp://", 6))
- *audio_input_type = GF_MP42TS_RTP;
-#ifndef GPAC_DISABLE_PLAYER
- else if (!strnicmp(next_arg, "http://", 7))
- *audio_input_type = GF_MP42TS_HTTP;
-#endif
- /*http needs to get the complete URL*/
- switch(*audio_input_type) {
- case GF_MP42TS_UDP:
- case GF_MP42TS_RTP:
- sep = strchr(next_arg+6, ':');
- *real_time=1;
- if (sep) {
- *audio_input_port = atoi(sep+1);
- sep[0]=0;
- *audio_input_ip = gf_strdup(next_arg+6);
- sep[0]=':';
- } else {
- *audio_input_ip = gf_strdup(next_arg+6);
- }
- break;
-#ifndef GPAC_DISABLE_PLAYER
- case GF_MP42TS_HTTP:
- /* No need to dup since it may come from argv */
- *audio_input_ip = next_arg;
- assert(audio_input_port != 0);
- break;
-#endif
- default:
- assert(0);
- }
- }
- } else if (CHECK_PARAM("-psi-rate")) {
- *psi_refresh_rate = atoi(next_arg);
- } else if (!stricmp(arg, "-bifs-pes")) {
- *bifs_use_pes = 1;
- } else if (!stricmp(arg, "-bifs-pes-ex")) {
- *bifs_use_pes = 2;
- } else if (!stricmp(arg, "-mpeg4") || !stricmp(arg, "-4on2")) {
- mpeg4_signaling = GF_M2TS_MPEG4_SIGNALING_FULL;
- } else if (!stricmp(arg, "-4over2")) {
- mpeg4_signaling = GF_M2TS_MPEG4_SIGNALING_SCENE;
- } else if (!strcmp(arg, "-mem-track") || !strcmp(arg, "-mem-track-stack")) {
-#ifdef GPAC_MEMORY_TRACKING
- gf_sys_close();
- mem_track = !strcmp(arg, "-mem-track-stack") ? GF_MemTrackerBackTrace : GF_MemTrackerSimple;
- gf_sys_init(mem_track, NULL);
- gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
-#else
- fprintf(stderr, "WARNING - GPAC not compiled with Memory Tracker - ignoring \"%s\"\n", arg);
-#endif
- } else if (CHECK_PARAM("-rate")) {
- if (rate_found) {
- error_msg = "multiple '-rate' found";
- arg = NULL;
- goto error;
- }
- rate_found = 1;
- *mux_rate = 1000*atoi(next_arg);
- } else if (CHECK_PARAM("-mpeg4-carousel")) {
- if (mpeg4_carousel_found) {
- error_msg = "multiple '-mpeg4-carousel' found";
- arg = NULL;
- goto error;
- }
- mpeg4_carousel_found = 1;
- *carrousel_rate = atoi(next_arg);
- } else if (!strnicmp(arg, "-real-time", 10)) {
- if (real_time_found) {
- goto error;
- }
- real_time_found = 1;
- *real_time = 1;
- } else if (CHECK_PARAM("-time")) {
- if (time_found) {
- error_msg = "multiple '-time' found";
- arg = NULL;
- goto error;
- }
- time_found = 1;
- *run_time = atoi(next_arg);
- } else if (!stricmp(arg, "-single-au")) {
- *pes_packing_mode = GF_M2TS_PACK_NONE;
- } else if (!stricmp(arg, "-multi-au")) {
- *pes_packing_mode = GF_M2TS_PACK_ALL;
- } else if (!stricmp(arg, "-rap")) {
- *split_rap = 1;
- } else if (!stricmp(arg, "-flush-rap")) {
- *split_rap = 2;
- } else if (!stricmp(arg, "-force-pcr-only")) {
- *enable_forced_pcr = GF_TRUE;
- } else if (CHECK_PARAM("-nb-pack")) {
- *nb_pck_pack = atoi(next_arg);
- } else if (CHECK_PARAM("-nb-pck")) {
- *nb_pck_pack = atoi(next_arg);
- } else if (CHECK_PARAM("-pcr-ms")) {
- *pcr_ms = atoi(next_arg);
- } else if (CHECK_PARAM("-ttl")) {
- *ttl = atoi(next_arg);
- } else if (CHECK_PARAM("-ifce")) {
- *ip_ifce = next_arg;
- } else if (CHECK_PARAM("-sdt-rate")) {
- *sdt_refresh_rate = atoi(next_arg);
- } else if (CHECK_PARAM("-segment-dir")) {
- if (seg_dir_found) {
- goto error;
- }
- seg_dir_found = 1;
- *segment_dir = next_arg;
- /* TODO: add the path separation char, if missing */
- } else if (CHECK_PARAM("-segment-duration")) {
- if (seg_dur_found) {
- goto error;
- }
- seg_dur_found = 1;
- *segment_duration = atoi(next_arg);
- } else if (CHECK_PARAM("-segment-manifest")) {
- if (seg_manifest_found) {
- goto error;
- }
- seg_manifest_found = 1;
- *segment_manifest = next_arg;
- } else if (CHECK_PARAM("-segment-http-prefix")) {
- if (seg_http_found) {
- goto error;
- }
- seg_http_found = 1;
- *segment_http_prefix = next_arg;
- } else if (CHECK_PARAM("-segment-number")) {
- if (seg_number_found) {
- goto error;
- }
- seg_number_found = 1;
- *segment_number = atoi(next_arg);
- }
- else if (CHECK_PARAM("-bifs-src")) {
- if (src_found) {
- error_msg = "multiple '-bifs-src' found";
- arg = NULL;
- goto error;
- }
- src_found = 1;
- *bifs_src_name = next_arg;
- } else if (CHECK_PARAM("-dst-file")) {
- dst_found = 1;
- *ts_out = gf_strdup(next_arg);
- } else if (CHECK_PARAM("-temi")) {
- if (next_arg[0]=='-') {
- *temi_url = NULL;
- i--;
- temi_id_1 = 150;
- } else {
- u32 temi_id = 0;
- if (sscanf(next_arg, "%d", &temi_id) == 1) {
- if (temi_id < 0x80 || temi_id>0xFF) {
- fprintf(stderr, "TEMI external timeline IDs shall be in the range [0x80, 0xFF], but %d was specified\n", temi_id);
- return GF_BAD_PARAM;
- }
- }
- if (!temi_id) {
- *temi_url = next_arg;
- if (strlen(next_arg) > 150) {
- fprintf(stderr, "URLs longer than 150 bytes are not currently supported\n");
- return GF_NOT_SUPPORTED;
- }
- temi_id_1 = 0;
- } else {
- temi_id_1 = temi_id;
- *temi_url = NULL;
- }
- }
- } else if (CHECK_PARAM("-temi2")) {
- u32 temi_id = 0;
- if (next_arg[0]=='-') {
- fprintf(stderr, "No ID for secondary external TEMI timeline specified\n");
- return GF_BAD_PARAM;
- }
- if (sscanf(next_arg, "%d", &temi_id) == 1) {
- if (temi_id < 0x80 || temi_id>0xFF) {
- fprintf(stderr, "TEMI external timeline IDs shall be in the range [0x80, 0xFF], but %d was specified\n", temi_id);
- return GF_BAD_PARAM;
- }
- temi_id_2 = temi_id;
- } else {
- fprintf(stderr, "No ID for secondary external TEMI timeline specified\n");
- return GF_BAD_PARAM;
- }
- } else if (CHECK_PARAM("-temi-delay")) {
- temi_url_insertion_delay = atoi(next_arg);
- } else if (CHECK_PARAM("-temi-offset")) {
- temi_offset = atoi(next_arg);
- } else if (!stricmp(arg, "-temi-noloop")) {
- temi_disable_loop = 1;
- } else if (!stricmp(arg, "-temi-off")) {
- temi_on = GF_FALSE;
- } else if (CHECK_PARAM("-temi-period")) {
- temi_period = atof(next_arg);
- if (temi_period<0) {
- temi_period *= -1;
- temi_single_toggle = GF_TRUE;
- }
- } else if (!stricmp(arg, "-insert-ntp")) {
- insert_ntp = GF_TRUE;
- }
- else if (CHECK_PARAM("-dst-udp")) {
- char *sep = strchr(next_arg, ':');
- dst_found = 1;
- *real_time=1;
- if (sep) {
- *output_port = atoi(sep+1);
- sep[0]=0;
- *udp_out = gf_strdup(next_arg);
- sep[0]=':';
- } else {
- *udp_out = gf_strdup(next_arg);
- }
- }
- else if (CHECK_PARAM("-dst-rtp")) {
- char *sep = strchr(next_arg, ':');
- dst_found = 1;
- *real_time=1;
- if (sep) {
- *output_port = atoi(sep+1);
- sep[0]=0;
- *rtp_out = gf_strdup(next_arg);
- sep[0]=':';
- } else {
- *rtp_out = gf_strdup(next_arg);
- }
- } else if (CHECK_PARAM("-src")) { //second pass arguments
- } else if (CHECK_PARAM("-prog")) { //second pass arguments
- } else {
- u32 res = gf_sys_is_gpac_arg(arg);
- if (!res) {
- error_msg = "unknown option";
- goto error;
- } else if (res==2) {
- if (!strchr(arg, '=')) i++;
- }
- }
- }
-
- if (*real_time) force_real_time = 1;
- rate_found = 1;
-
- /*second pass: open sources*/
- for (i=1; i<argc; i++) {
- u32 res;
- char *src_args;
- arg = argv[i];
- if (arg[0] !='-') continue;
-
- if (! CHECK_PARAM("-src") && ! CHECK_PARAM("-prog") ) continue;
-
- src_args = strchr(next_arg, ':');
- if (src_args && (src_args[1]=='\\')) {
- src_args = strchr(src_args+2, ':');
- }
- if (src_args) {
- src_args[0] = 0;
- src_args = src_args + 1;
- }
-
- res = open_source(&sources[*nb_sources], next_arg, *carrousel_rate, mpeg4_signaling, *bifs_src_name, *audio_input_ip, *audio_input_port, *video_buffer, force_real_time, *bifs_use_pes, *temi_url, (*pcr_offset == (u32) -1) ? 1 : 0, insert_ntp);
-
- //we may have arguments
- while (src_args) {
- char *sep = strchr(src_args, ':');
- if (sep) sep[0] = 0;
-
- if (!strnicmp(src_args, "name=", 5)) {
- strncpy(sources[*nb_sources].program_name, src_args+5, 20);
- } else if (!strnicmp(src_args, "provider=", 9)) {
- strncpy(sources[*nb_sources].provider_name, src_args+9, 20);
- } else if (!strnicmp(src_args, "ID=", 3)) {
- u32 k;
- sources[*nb_sources].ID = atoi(src_args+3);
-
- for (k=0; k<*nb_sources; k++) {
- if (sources[k].ID == sources[*nb_sources].ID) {
- sources[*nb_sources].is_not_program_declaration = 1;
- if (sources[k].max_sample_size < sources[*nb_sources].max_sample_size)
- sources[k].max_sample_size = sources[*nb_sources].max_sample_size;
-
- break;
- }
- }
- } else if (!strnicmp(src_args, "disc", 4)) {
- sources[*nb_sources].set_disc = GF_TRUE;
- } else if (!strnicmp(src_args, "PMT=", 4)) {
- sources[*nb_sources].pmt_version = atoi(src_args+4);
- }
-
- if (sep) {
- sep[0] = ':';
- src_args = sep+1;
- } else
- break;
- }
-
- if (res) {
- (*nb_sources)++;
- if (res==2) *real_time=1;
- }
- }
- /*syntax is correct; now testing the presence of mandatory arguments*/
- if (dst_found && *nb_sources && rate_found) {
- return GF_OK;
- } else {
- if (!dst_found)
- fprintf(stderr, "Error: Destination argument not found\n");
- if (! *nb_sources)
- fprintf(stderr, "Error: No Programs are available\n");
- usage();
- return GF_BAD_PARAM;
- }
-
-error:
- if (!arg) {
- fprintf(stderr, "Error: %s\n", error_msg);
- } else {
- fprintf(stderr, "Error: %s \"%s\"\n", error_msg, arg);
- }
- return GF_BAD_PARAM;
-}
-
-static GF_Err write_manifest(char *manifest, char *segment_dir, u32 segment_duration, char *segment_prefix, char *http_prefix, u32 first_segment, u32 last_segment, Bool end)
-{
- FILE *manifest_fp;
- u32 i;
- char manifest_tmp_name[GF_MAX_PATH];
- char manifest_name[GF_MAX_PATH];
- char *tmp_manifest = manifest_tmp_name;
-
- if (segment_dir) {
- sprintf(manifest_tmp_name, "%stmp.m3u8", segment_dir);
- sprintf(manifest_name, "%s%s", segment_dir, manifest);
- } else {
- sprintf(manifest_tmp_name, "tmp.m3u8");
- sprintf(manifest_name, "%s", manifest);
- }
-
- manifest_fp = gf_fopen(tmp_manifest, "wt");
- if (!manifest_fp) {
- fprintf(stderr, "Could not create m3u8 manifest file (%s)\n", tmp_manifest);
- return GF_BAD_PARAM;
- }
-
- fprintf(manifest_fp, "#EXTM3U\n#EXT-X-TARGETDURATION:%u\n#EXT-X-MEDIA-SEQUENCE:%u\n", segment_duration, first_segment);
-
- for (i = first_segment; i <= last_segment; i++) {
- fprintf(manifest_fp, "#EXTINF:%u,\n%s%s_%u.ts\n", segment_duration, http_prefix, segment_prefix, i);
- }
-
- if (end) {
- fprintf(manifest_fp, "#EXT-X-ENDLIST\n");
- }
- gf_fclose(manifest_fp);
-
- if (!rename(tmp_manifest, manifest_name)) {
- return GF_OK;
- } else {
- if (remove(manifest_name)) {
- fprintf(stderr, "Error removing file %s\n", manifest_name);
- return GF_IO_ERR;
- } else if (rename(tmp_manifest, manifest_name)) {
- fprintf(stderr, "Could not rename temporary m3u8 manifest file (%s) into %s\n", tmp_manifest, manifest_name);
- return GF_IO_ERR;
- } else {
- return GF_OK;
- }
- }
-}
-
-int main(int argc, char **argv)
-{
- /********************/
- /* declarations */
- /********************/
- const char *ts_pck;
- char *ts_pack_buffer = NULL;
- GF_Err e;
- u32 run_time;
- Bool real_time, is_stdout;
- s64 pcr_init_val = -1;
- u32 usec_till_next, ttl, split_rap, sdt_refresh_rate;
- GF_M2TS_PackMode pes_packing_mode;
- u32 i, j, mux_rate, nb_sources, cur_pid, carrousel_rate, last_print_time, last_video_time, bifs_use_pes, psi_refresh_rate, nb_pck_pack, nb_pck_in_pack, pcr_ms;
- char *ts_out = NULL, *udp_out = NULL, *rtp_out = NULL, *audio_input_ip = NULL;
- FILE *ts_output_file = NULL;
- GF_Socket *ts_output_udp_sk = NULL, *audio_input_udp_sk = NULL;
-#ifndef GPAC_DISABLE_STREAMING
- GF_RTPChannel *ts_output_rtp = NULL;
- GF_RTSPTransport tr;
- GF_RTPHeader hdr;
-#endif
- char *video_buffer;
- u32 video_buffer_size;
- u16 output_port = 0, audio_input_port = 0;
- u32 output_type, audio_input_type, pcr_offset;
- char *audio_input_buffer = NULL;
- u32 audio_input_buffer_length=65536;
- char *bifs_src_name;
- const char *insert_temi = 0;
- M2TSSource sources[MAX_MUX_SRC_PROG];
- u32 segment_duration, segment_index, segment_number;
- char segment_manifest_default[GF_MAX_PATH];
- char *segment_manifest, *segment_http_prefix, *segment_dir;
- char segment_prefix[GF_MAX_PATH];
- char segment_name[GF_MAX_PATH];
- const char *ip_ifce = NULL;
- GF_M2TS_Time prev_seg_time;
- GF_M2TS_Mux *muxer;
- Bool enable_forced_pcr = GF_FALSE;
- /*****************/
- /* gpac init */
- /*****************/
- gf_sys_init(GF_MemTrackerNone, NULL);
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_WARNING);
-
- /***********************/
- /* initialisations */
- /***********************/
- real_time = 0;
- is_stdout = 0;
- ts_output_file = NULL;
- video_buffer = NULL;
- last_video_time = 0;
- audio_input_type = 0;
- sdt_refresh_rate = 0;
- ts_output_udp_sk = NULL;
- udp_out = NULL;
-#ifndef GPAC_DISABLE_STREAMING
- ts_output_rtp = NULL;
- rtp_out = NULL;
-#endif
- ts_out = NULL;
- bifs_src_name = NULL;
- nb_sources = 0;
- mux_rate = 0;
- run_time = 0;
- carrousel_rate = 500;
- output_port = 1234;
- segment_duration = 0;
- segment_number = 10; /* by default, we keep the 10 previous segments */
- segment_index = 0;
- segment_manifest = NULL;
- segment_http_prefix = NULL;
- segment_dir = NULL;
- prev_seg_time.sec = 0;
- prev_seg_time.nanosec = 0;
- video_buffer_size = 0;
- nb_pck_pack = 1;
- pcr_ms = 100;
-#ifndef GPAC_DISABLE_PLAYER
- aac_reader = AAC_Reader_new();
-#endif
- muxer = NULL;
- pes_packing_mode = GF_M2TS_PACK_AUDIO_ONLY;
- bifs_use_pes = 0;
- split_rap = 0;
- ttl = 1;
- psi_refresh_rate = GF_M2TS_PSI_DEFAULT_REFRESH_RATE;
- pcr_offset = (u32) -1;
-
- /***********************/
- /* parse arguments */
- /***********************/
- if (GF_OK != parse_args(argc, argv, &mux_rate, &carrousel_rate, &pcr_init_val, &pcr_offset, &psi_refresh_rate, &pes_packing_mode, &bifs_use_pes, sources, &nb_sources, &bifs_src_name,
- &real_time, &run_time, &video_buffer, &video_buffer_size,
- &audio_input_type, &audio_input_ip, &audio_input_port,
- &output_type, &ts_out, &udp_out, &rtp_out, &output_port,
- &segment_dir, &segment_duration, &segment_manifest, &segment_number, &segment_http_prefix, &split_rap, &nb_pck_pack, &pcr_ms, &ttl, &ip_ifce, &insert_temi, &sdt_refresh_rate, &enable_forced_pcr)) {
- goto exit;
- }
-
- e = gf_sys_set_args(argc, (const char **) argv);
- if (e) {
- fprintf(stderr, "Error assigning libgpac arguments: %s\n", gf_error_to_string(e) );
- goto exit;
- }
-
- if (run_time && !mux_rate) {
- fprintf(stderr, "Cannot specify TS run time for VBR multiplex - disabling run time\n");
- run_time = 0;
- }
-
- /***************************/
- /* create mp42ts muxer */
- /***************************/
- muxer = gf_m2ts_mux_new(mux_rate, psi_refresh_rate, real_time);
- if (!muxer) {
- fprintf(stderr, "Could not create the muxer. Aborting.\n");
- goto exit;
- }
- gf_m2ts_mux_use_single_au_pes_mode(muxer, pes_packing_mode);
- if (pcr_init_val>=0) gf_m2ts_mux_set_initial_pcr(muxer, (u64) pcr_init_val);
- gf_m2ts_mux_set_pcr_max_interval(muxer, pcr_ms);
- gf_m2ts_mux_enable_pcr_only_packets(muxer, enable_forced_pcr);
-
-
- if (ts_out != NULL) {
- if (segment_duration) {
- strcpy(segment_prefix, ts_out);
- if (segment_dir) {
- if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
- sprintf(segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index);
- } else {
- sprintf(segment_name, "%s/%s_%d.ts", segment_dir, segment_prefix, segment_index);
- }
- } else {
- sprintf(segment_name, "%s_%d.ts", segment_prefix, segment_index);
- }
- ts_out = gf_strdup(segment_name);
- if (!segment_manifest) {
- sprintf(segment_manifest_default, "%s.m3u8", segment_prefix);
- segment_manifest = segment_manifest_default;
- }
- //write_manifest(segment_manifest, segment_dir, segment_duration, segment_prefix, segment_http_prefix, segment_index, 0, 0);
- }
- if (!strcmp(ts_out, "stdout") || !strcmp(ts_out, "-") ) {
- ts_output_file = stdout;
- is_stdout = GF_TRUE;
- } else {
- ts_output_file = gf_fopen(ts_out, "wb");
- is_stdout = GF_FALSE;
- }
- if (!ts_output_file) {
- fprintf(stderr, "Error opening %s\n", ts_out);
- goto exit;
- }
- }
- if (udp_out != NULL) {
- ts_output_udp_sk = gf_sk_new(GF_SOCK_TYPE_UDP);
- if (gf_sk_is_multicast_address((char *)udp_out)) {
- e = gf_sk_setup_multicast(ts_output_udp_sk, (char *)udp_out, output_port, ttl, 0, (char *) ip_ifce);
- } else {
- e = gf_sk_bind(ts_output_udp_sk, ip_ifce, output_port, (char *)udp_out, output_port, GF_SOCK_REUSE_PORT);
- }
- if (e) {
- fprintf(stderr, "Error initializing UDP socket: %s\n", gf_error_to_string(e));
- goto exit;
- }
- }
-#ifndef GPAC_DISABLE_STREAMING
- if (rtp_out != NULL) {
- ts_output_rtp = gf_rtp_new();
- gf_rtp_set_ports(ts_output_rtp, output_port);
- memset(&tr, 0, sizeof(GF_RTSPTransport));
- tr.IsUnicast = gf_sk_is_multicast_address((char *)rtp_out) ? 0 : 1;
- tr.Profile="RTP/AVP";
- tr.destination = (char *)rtp_out;
- tr.source = "0.0.0.0";
- tr.IsRecord = 0;
- tr.Append = 0;
- tr.SSRC = rand();
- tr.port_first = output_port;
- tr.port_last = output_port+1;
- if (tr.IsUnicast) {
- tr.client_port_first = output_port;
- tr.client_port_last = output_port+1;
- } else {
- tr.source = (char *)rtp_out;
- tr.TTL = ttl;
- }
- e = gf_rtp_setup_transport(ts_output_rtp, &tr, (char *)ts_out);
- if (e != GF_OK) {
- fprintf(stderr, "Cannot setup RTP transport info : %s\n", gf_error_to_string(e));
- goto exit;
- }
- e = gf_rtp_initialize(ts_output_rtp, 0, 1, 1500, 0, 0, (char *) ip_ifce);
- if (e != GF_OK) {
- fprintf(stderr, "Cannot initialize RTP sockets : %s\n", gf_error_to_string(e));
- goto exit;
- }
- memset(&hdr, 0, sizeof(GF_RTPHeader));
- hdr.Version = 2;
- hdr.PayloadType = 33; /*MP2T*/
- hdr.SSRC = tr.SSRC;
- hdr.Marker = 0;
- }
-#endif /*GPAC_DISABLE_STREAMING*/
-
- /************************************/
- /* create streaming audio input */
- /************************************/
- if (audio_input_ip)
- switch(audio_input_type) {
- case GF_MP42TS_UDP:
- audio_input_udp_sk = gf_sk_new(GF_SOCK_TYPE_UDP);
- if (gf_sk_is_multicast_address((char *)audio_input_ip)) {
- e = gf_sk_setup_multicast(audio_input_udp_sk, (char *)audio_input_ip, audio_input_port, 32, 0, NULL);
- } else {
- e = gf_sk_bind(audio_input_udp_sk, NULL, audio_input_port, (char *)audio_input_ip, audio_input_port, GF_SOCK_REUSE_PORT);
- }
- if (e) {
- fprintf(stderr, "Error initializing UDP socket for %s:%d : %s\n", audio_input_ip, audio_input_port, gf_error_to_string(e));
- goto exit;
- }
- gf_sk_set_buffer_size(audio_input_udp_sk, 0, GF_M2TS_UDP_BUFFER_SIZE);
- gf_sk_set_block_mode(audio_input_udp_sk, 0);
-
- /*allocate data buffer*/
- audio_input_buffer = (char*)gf_malloc(audio_input_buffer_length);
- assert(audio_input_buffer);
- break;
- case GF_MP42TS_RTP:
- /*TODO: not implemented*/
- assert(0);
- break;
-#ifndef GPAC_DISABLE_PLAYER
- case GF_MP42TS_HTTP:
- audio_prog = (void*)&sources[nb_sources-1];
- aac_download_file(aac_reader, audio_input_ip);
- break;
-#endif
- case GF_MP42TS_FILE:
- assert(0); /*audio live input is restricted to realtime/streaming*/
- break;
- default:
- assert(0);
- }
-
- if (!nb_sources) {
- fprintf(stderr, "No program to mux, quitting.\n");
- }
-
- for (i=0; i<nb_sources; i++) {
- if (!sources[i].ID) {
- for (j=i+1; j<nb_sources; j++) {
- if (sources[i].ID < sources[j].ID) sources[i].ID = sources[i].ID+1;
- }
- if (!sources[i].ID) sources[i].ID = 1;
- }
- }
-
- /****************************************/
- /* declare all streams to the muxer */
- /****************************************/
- cur_pid = 100; /*PIDs start from 100*/
- for (i=0; i<nb_sources; i++) {
- GF_M2TS_Mux_Program *program;
-
- if (! sources[i].is_not_program_declaration) {
- u32 prog_pcr_offset = 0;
- if (pcr_offset==(u32)-1) {
- if (sources[i].max_sample_size && mux_rate) {
- Double r = sources[i].max_sample_size * 8;
- r *= 90000;
- r/= mux_rate;
- //add 10% of safety to cover TS signaling and other potential table update while sending the largest PES
- r *= 1.1;
- prog_pcr_offset = (u32) r;
- }
- } else {
- prog_pcr_offset = pcr_offset;
- }
- fprintf(stderr, "Setting up program ID %d - send rates: PSI %d ms PCR %d ms - PCR offset %d\n", sources[i].ID, psi_refresh_rate, pcr_ms, prog_pcr_offset);
-
- program = gf_m2ts_mux_program_add(muxer, sources[i].ID, cur_pid, psi_refresh_rate, prog_pcr_offset, sources[i].mpeg4_signaling, sources[i].pmt_version, sources[i].set_disc);
- if (sources[i].mpeg4_signaling) program->iod = sources[i].iod;
- if (sources[i].od_updates) {
- program->loop_descriptors = sources[i].od_updates;
- sources[i].od_updates = NULL;
- }
- } else {
- program = gf_m2ts_mux_program_find(muxer, sources[i].ID);
- }
- if (!program) continue;
-
- for (j=0; j<sources[i].nb_streams; j++) {
- GF_M2TS_Mux_Stream *stream;
- Bool force_pes_mode = 0;
- /*likely an OD stream disabled*/
- if (!sources[i].streams[j].stream_type) continue;
-
- if (sources[i].streams[j].stream_type==GF_STREAM_SCENE) force_pes_mode = bifs_use_pes ? 1 : 0;
-
- stream = gf_m2ts_program_stream_add(program, &sources[i].streams[j], cur_pid+j+1, (sources[i].pcr_idx==j) ? 1 : 0, force_pes_mode, GF_TRUE);
- if (split_rap && (sources[i].streams[j].stream_type==GF_STREAM_VISUAL)) stream->start_pes_at_rap = 1;
- }
-
- cur_pid += sources[i].nb_streams;
- while (cur_pid % 10)
- cur_pid ++;
-
- if (sources[i].program_name[0] || sources[i].provider_name[0] ) gf_m2ts_mux_program_set_name(program, sources[i].program_name, sources[i].provider_name);
- }
- muxer->flush_pes_at_rap = (split_rap == 2) ? GF_TRUE : GF_FALSE;
-
- if (sdt_refresh_rate) {
- gf_m2ts_mux_enable_sdt(muxer, sdt_refresh_rate);
- }
- gf_m2ts_mux_update_config(muxer, 1);
-
- if (nb_pck_pack>1) {
- ts_pack_buffer = gf_malloc(sizeof(char) * 188 * nb_pck_pack);
- }
-
- /*****************/
- /* main loop */
- /*****************/
- last_print_time = gf_sys_clock();
- while (run) {
- u32 status;
-
- /*check for some audio input from the network*/
- if (audio_input_ip) {
- u32 read;
- switch (audio_input_type) {
- case GF_MP42TS_UDP:
- case GF_MP42TS_RTP:
- /*e =*/
- gf_sk_receive(audio_input_udp_sk, audio_input_buffer, audio_input_buffer_length, &read);
- if (read) {
- SampleCallBack((void*)&sources[nb_sources-1], AUDIO_DATA_ESID, audio_input_buffer, read, gf_m2ts_get_sys_clock(muxer));
- }
- break;
-#ifndef GPAC_DISABLE_PLAYER
- case GF_MP42TS_HTTP:
- /*nothing to do: AAC_OnLiveData is called automatically*/
- /*check we're still alive*/
- if (gf_dm_is_thread_dead(aac_reader->dnload)) {
- GF_ESD *esd;
- aac_download_file(aac_reader, audio_input_ip);
- esd = AAC_GetESD(aac_reader);
- if (!esd)
- break;
- assert(esd->slConfig->timestampResolution); /*if we don't have this value we won't be able to adjust the timestamps within the MPEG2-TS*/
- if (esd->slConfig->timestampResolution)
- audio_discontinuity_offset = gf_m2ts_get_sys_clock(muxer) * (u64)esd->slConfig->timestampResolution / 1000;
- gf_odf_desc_del((GF_Descriptor *)esd);
- }
- break;
-#endif
- default:
- assert(0);
- }
- }
-
- /*flush all packets*/
- nb_pck_in_pack=0;
- while ((ts_pck = gf_m2ts_mux_process(muxer, &status, &usec_till_next)) != NULL) {
-
- if (ts_pack_buffer) {
- memcpy(ts_pack_buffer + 188 * nb_pck_in_pack, ts_pck, 188);
- nb_pck_in_pack++;
-
- if (nb_pck_in_pack < nb_pck_pack)
- continue;
-
- ts_pck = (const char *) ts_pack_buffer;
- } else {
- nb_pck_in_pack = 1;
- }
-
-call_flush:
- if (ts_output_file != NULL) {
- gf_fwrite(ts_pck, 1, 188 * nb_pck_in_pack, ts_output_file);
- if (segment_duration && (muxer->time.sec > prev_seg_time.sec + segment_duration)) {
- prev_seg_time = muxer->time;
- gf_fclose(ts_output_file);
- segment_index++;
- if (segment_dir) {
- if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
- sprintf(segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index);
- } else {
- sprintf(segment_name, "%s/%s_%d.ts", segment_dir, segment_prefix, segment_index);
- }
- } else {
- sprintf(segment_name, "%s_%d.ts", segment_prefix, segment_index);
- }
- ts_output_file = gf_fopen(segment_name, "wb");
- if (!ts_output_file) {
- fprintf(stderr, "Error opening %s\n", segment_name);
- goto exit;
- }
- /* delete the oldest segment */
- if (segment_number && ((s32) (segment_index - segment_number - 1) >= 0)) {
- char old_segment_name[GF_MAX_PATH];
- if (segment_dir) {
- if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
- sprintf(old_segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index - segment_number - 1);
- } else {
- sprintf(old_segment_name, "%s/%s_%d.ts", segment_dir, segment_prefix, segment_index - segment_number - 1);
- }
- } else {
- sprintf(old_segment_name, "%s_%d.ts", segment_prefix, segment_index - segment_number - 1);
- }
- gf_delete_file(old_segment_name);
- }
- write_manifest(segment_manifest, segment_dir, segment_duration, segment_prefix, segment_http_prefix,
-// (segment_index >= segment_number/2 ? segment_index - segment_number/2 : 0), segment_index >1 ? segment_index-1 : 0, 0);
- ( (segment_index > segment_number ) ? segment_index - segment_number : 0), segment_index >1 ? segment_index-1 : 0, 0);
- }
- }
-
- if (ts_output_udp_sk != NULL) {
- e = gf_sk_send(ts_output_udp_sk, (char*)ts_pck, 188 * nb_pck_in_pack);
- if (e) {
- fprintf(stderr, "Error %s sending UDP packet\n", gf_error_to_string(e));
- }
- }
-#ifndef GPAC_DISABLE_STREAMING
- if (ts_output_rtp != NULL) {
- u32 ts;
- hdr.SequenceNumber++;
- /*muxer clock at 90k*/
- ts = muxer->time.sec*90000 + muxer->time.nanosec*9/100000;
- /*FIXME - better discontinuity check*/
- hdr.Marker = (ts < hdr.TimeStamp) ? 1 : 0;
- hdr.TimeStamp = ts;
- e = gf_rtp_send_packet(ts_output_rtp, &hdr, (char*)ts_pck, 188 * nb_pck_in_pack, 0);
- if (e) {
- fprintf(stderr, "Error %s sending RTP packet\n", gf_error_to_string(e));
- }
- }
-#endif
-
- nb_pck_in_pack = 0;
-
- if (status>=GF_M2TS_STATE_PADDING) {
- break;
- }
- }
- if (nb_pck_in_pack) {
- ts_pck = (const char *) ts_pack_buffer;
- goto call_flush;
- }
-
- /*push video*/
- {
- u32 now=gf_sys_clock();
- if (now/MP42TS_VIDEO_FREQ != last_video_time/MP42TS_VIDEO_FREQ) {
- /*should use carrousel behaviour instead of being pushed manually*/
- if (video_buffer)
- SampleCallBack((void*)&sources[nb_sources-1], VIDEO_DATA_ESID, video_buffer, video_buffer_size, gf_m2ts_get_sys_clock(muxer)+1000/*try buffering due to VLC msg*/);
- last_video_time = now;
- }
- }
-
- if (real_time) {
- /*refresh every MP42TS_PRINT_TIME_MS ms*/
- u32 now=gf_sys_clock();
- if (now > last_print_time + MP42TS_PRINT_TIME_MS) {
- last_print_time = now;
- fprintf(stderr, "M2TS: time % 6d - TS time % 6d - bitrate % 8d\r", gf_m2ts_get_sys_clock(muxer), gf_m2ts_get_ts_clock(muxer), muxer->average_birate_kbps);
-
- if (gf_prompt_has_input()) {
- char c = gf_prompt_get_char();
- if (c=='q') break;
- else if (c=='t') request_temi_toggle = GF_TRUE;
- }
- }
- if (status == GF_M2TS_STATE_IDLE) {
-#if 0
- /*wait till next packet is ready to be sent*/
- if (usec_till_next>1000) {
- //fprintf(stderr, "%d usec till next packet\n", usec_till_next);
- gf_sleep(usec_till_next / 1000);
- }
-#else
- //we don't have enough precision on usec counting and we end up eating one core on most machines, so let's just sleep
- //one second whenever we are idle - it's maybe too much but the muxer will catchup afterwards
- gf_sleep(1);
-#endif
- }
- }
-
-
- if (run_time) {
- if (gf_m2ts_get_ts_clock(muxer) > run_time) {
- fprintf(stderr, "Stopping multiplex at %d ms (requested runtime %d ms)\n", gf_m2ts_get_ts_clock(muxer), run_time);
- break;
- }
- }
- if (status==GF_M2TS_STATE_EOS) {
- break;
- }
- }
-
- {
- u64 bits = muxer->tot_pck_sent*8*188;
- u64 dur_ms = gf_m2ts_get_ts_clock(muxer);
- if (!dur_ms) dur_ms = 1;
- fprintf(stderr, "Done muxing - %.02f sec - %sbitrate %d kbps "LLD" packets written\n", ((Double) dur_ms)/1000.0,mux_rate ? "" : "average ", (u32) (bits/dur_ms), muxer->tot_pck_sent);
- fprintf(stderr, " Padding: "LLD" packets (%g kbps) - "LLD" PES padded bytes (%g kbps)\n", muxer->tot_pad_sent, (Double) (muxer->tot_pad_sent*188*8.0/dur_ms) , muxer->tot_pes_pad_bytes, (Double) (muxer->tot_pes_pad_bytes*8.0/dur_ms) );
- }
-
-exit:
- if (ts_pack_buffer) gf_free(ts_pack_buffer);
- run = 0;
- if (segment_duration) {
- write_manifest(segment_manifest, segment_dir, segment_duration, segment_prefix, segment_http_prefix, segment_index - segment_number, segment_index, 1);
- }
- if (ts_output_file && !is_stdout) gf_fclose(ts_output_file);
- if (ts_output_udp_sk) gf_sk_del(ts_output_udp_sk);
-#ifndef GPAC_DISABLE_STREAMING
- if (ts_output_rtp) gf_rtp_del(ts_output_rtp);
-#endif
- if (ts_out) gf_free(ts_out);
- if (audio_input_udp_sk) gf_sk_del(audio_input_udp_sk);
- if (audio_input_buffer) gf_free (audio_input_buffer);
- if (video_buffer) gf_free(video_buffer);
- if (udp_out) gf_free(udp_out);
-#ifndef GPAC_DISABLE_STREAMING
- if (rtp_out) gf_free(rtp_out);
-#endif
- if (muxer) gf_m2ts_mux_del(muxer);
-
- for (i=0; i<nb_sources; i++) {
- for (j=0; j<sources[i].nb_streams; j++) {
- if (sources[i].streams[j].input_ctrl) sources[i].streams[j].input_ctrl(&sources[i].streams[j], GF_ESI_INPUT_DESTROY, NULL);
- if (sources[i].streams[j].input_udta) {
- gf_free(sources[i].streams[j].input_udta);
- }
- if (sources[i].streams[j].decoder_config) {
- gf_free(sources[i].streams[j].decoder_config);
- }
- if (sources[i].streams[j].sl_config) {
- gf_free(sources[i].streams[j].sl_config);
- }
- }
- if (sources[i].iod) gf_odf_desc_del((GF_Descriptor*)sources[i].iod);
-#ifndef GPAC_DISABLE_ISOM
- if (sources[i].mp4) gf_isom_close(sources[i].mp4);
-#endif
-
-#ifndef GPAC_DISABLE_SENG
- if (sources[i].seng) {
- gf_seng_terminate(sources[i].seng);
- sources[i].seng = NULL;
- }
-#endif
- if (sources[i].th) gf_th_del(sources[i].th);
- }
-
-#ifndef GPAC_DISABLE_PLAYER
- if (aac_reader) AAC_Reader_del(aac_reader);
-#endif
-
- gf_sys_close();
-
-#ifdef GPAC_MEMORY_TRACKING
- if (mem_track && (gf_memory_size() || gf_file_handles_count() )) {
- gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
- gf_memory_print();
- return 2;
- }
-#endif
- return 0;
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{F728CC74-A7D0-43D2-8A28-05CE9F2EF0D0}</ProjectGuid>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Midl>\r
- <TypeLibraryName>.\obj\mp42ts_deb\mp42ts.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>\r
- </PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <Midl>\r
- <TypeLibraryName>.\obj\mp42ts_deb\mp42ts.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>\r
- </PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <MinimalRebuild>false</MinimalRebuild>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Midl>\r
- <TypeLibraryName>.\obj\mp42ts_rel\mp42ts.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>MaxSpeed</Optimization>\r
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>.\obj\mp42ts_rel/$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <Midl>\r
- <TypeLibraryName>.\obj\mp42ts_rel\mp42ts.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Full</Optimization>\r
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>.\obj\mp42ts_rel/$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\applications\mp42ts\main.c">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="libgpac_dll.vcxproj">\r
- <Project>{d3540754-e0cf-4604-ac11-82de9bd4d814}</Project>\r
- <Private>true</Private>\r
- <ReferenceOutputAssembly>true</ReferenceOutputAssembly>\r
- <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>\r
- <LinkLibraryDependencies>true</LinkLibraryDependencies>\r
- <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-// GPAX.cpp : Implementation of DLL Exports.
-
-
-// Note: Proxy/Stub Information
-// To build a separate proxy/stub DLL,
-// run nmake -f GPAXps.mk in the project directory.
-
-#include "stdafx.h"
-#include "resource.h"
-#include <initguid.h>
-#include "GPAX.h"
-
-#include "GPAX_i.c"
-#include "GPAXPlugin.h"
-
-
-CComModule _Module;
-
-BEGIN_OBJECT_MAP(ObjectMap)
-OBJECT_ENTRY(CLSID_GPAX, CGPAXPlugin)
-END_OBJECT_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// DLL Entry Point
-
-extern "C"
-#ifdef _WIN32_WCE
-BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
-#else
-BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
-#endif
-{
- if (dwReason == DLL_PROCESS_ATTACH)
- {
- _Module.Init(ObjectMap, (HINSTANCE) hInstance, &LIBID_GPAXLib);
- DisableThreadLibraryCalls((HINSTANCE) hInstance);
- }
- else if (dwReason == DLL_PROCESS_DETACH)
- _Module.Term();
- return TRUE; // ok
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// Used to determine whether the DLL can be unloaded by OLE
-
-STDAPI DllCanUnloadNow(void)
-{
- return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// Returns a class factory to create an object of the requested type
-
-STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
-{
- return _Module.GetClassObject(rclsid, riid, ppv);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// DllRegisterServer - Adds entries to the system registry
-
-STDAPI DllRegisterServer(void)
-{
- // registers object, typelib and all interfaces in typelib
- return _Module.RegisterServer(TRUE);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// DllUnregisterServer - Removes entries from the system registry
-
-STDAPI DllUnregisterServer(void)
-{
- return _Module.UnregisterServer(TRUE);
-}
-
-
+++ /dev/null
-; GPAX.def : Declares the module parameters.
-
-LIBRARY "GPAX.dll"
-
-EXPORTS
- DllCanUnloadNow PRIVATE
- DllGetClassObject PRIVATE
- DllRegisterServer PRIVATE
- DllUnregisterServer PRIVATE
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="GPAX" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102\r
-\r
-CFG=GPAX - Win32 Release\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "GPAX.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "GPAX.mak" CFG="GPAX - Win32 Release"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "GPAX - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE "GPAX - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-MTL=midl.exe\r
-RSC=rc.exe\r
-\r
-!IF "$(CFG)" == "GPAX - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "Debug"\r
-# PROP BASE Intermediate_Dir "Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "obj/w32_deb"\r
-# PROP Intermediate_Dir "obj/w32_deb"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /Yu"stdafx.h" /FD /GZ /c\r
-# ADD BASE RSC /l 0x804 /d "_DEBUG"\r
-# ADD RSC /l 0x804 /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 js32.lib zlib.lib winmm.lib ws2_32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"../../bin/w32_deb/GPAX.dll" /pdbtype:sept /libpath:"../../extra_lib/lib/w32_deb"\r
-# Begin Custom Build - Performing registration\r
-OutDir=.\obj/w32_deb\r
-TargetPath=\CVS\gpac\bin\w32_deb\GPAX.dll\r
-InputPath=\CVS\gpac\bin\w32_deb\GPAX.dll\r
-SOURCE="$(InputPath)"\r
-\r
-"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
- regsvr32 /s /c "$(TargetPath)" \r
- echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" \r
- \r
-# End Custom Build\r
-\r
-!ELSEIF "$(CFG)" == "GPAX - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "obj/w32_rel"\r
-# PROP BASE Intermediate_Dir "obj/w32_rel"\r
-# PROP BASE Ignore_Export_Lib 0\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "obj/w32_rel"\r
-# PROP Intermediate_Dir "obj/w32_rel"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /Yu"stdafx.h" /FD /GZ /c\r
-# ADD CPP /nologo /MD /W3 /Gm /ZI /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /Yu"stdafx.h" /FD /GZ /c\r
-# SUBTRACT CPP /O<none>\r
-# ADD BASE RSC /l 0x804 /d "_DEBUG"\r
-# ADD RSC /l 0x804 /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 js32.lib zlib.lib winmm.lib ws2_32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept /libpath:"../gpac/extra_lib/lib/w32_deb"\r
-# ADD LINK32 js32.lib zlib.lib winmm.lib ws2_32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"../../bin/w32_rel/GPAX.dll" /pdbtype:sept /libpath:"../../extra_lib/lib/w32_rel"\r
-# Begin Special Build Tool\r
-SOURCE="$(InputPath)"\r
-PostBuild_Cmds=copy ..\..\bin\w32_rel\GPAX.dll "C:\Program Files\GPAC"\r
-# End Special Build Tool\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "GPAX - Win32 Debug"\r
-# Name "GPAX - Win32 Release"\r
-# Begin Group "Source Files"\r
-\r
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
-# Begin Source File\r
-\r
-SOURCE=.\GPAX.cpp\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\GPAX.def\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\GPAX.idl\r
-# ADD MTL /tlb ".\GPAX.tlb" /h "GPAX.h" /iid "GPAX_i.c" /Oicf\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\GPAX.rc\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\GPAXPlugin.cpp\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\StdAfx.cpp\r
-# ADD CPP /Yc"stdafx.h"\r
-# End Source File\r
-# End Group\r
-# Begin Group "Header Files"\r
-\r
-# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
-# Begin Source File\r
-\r
-SOURCE=.\GPAXPlugin.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\Resource.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\StdAfx.h\r
-# End Source File\r
-# End Group\r
-# Begin Group "Resource Files"\r
-\r
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
-# Begin Source File\r
-\r
-SOURCE=.\gpax.bmp\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\GPAX.rgs\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\GPAXProp.rgs\r
-# End Source File\r
-# End Group\r
-# End Target\r
-# End Project\r
-# Section GPAX : {00000000-0000-0000-0000-800000800000}\r
-# 1:21:IDS_DOCSTRINGGPAXProp:105\r
-# 1:12:IDD_GPAXPROP:107\r
-# 1:12:IDR_GPAXPROP:106\r
-# 1:20:IDS_HELPFILEGPAXProp:104\r
-# 1:17:IDS_TITLEGPAXProp:103\r
-# End Section\r
+++ /dev/null
-
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-
-/* this ALWAYS GENERATED file contains the definitions for the interfaces */
-
-
-/* File created by MIDL compiler version 5.03.0286 */
-/* at Thu Jul 20 19:14:15 2006
- */
-/* Compiler settings for \CVS\gpac\applications\GPAX\GPAX.idl:
- Oicf (OptLev=i2), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext
- error checks: allocation ref bounds_check enum stub_data
- VC __declspec() decoration level:
- __declspec(uuid()), __declspec(selectany), __declspec(novtable)
- DECLSPEC_UUID(), MIDL_INTERFACE()
-*/
-//@@MIDL_FILE_HEADING( )
-
-
-/* verify that the <rpcndr.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 440
-#endif
-
-#include "rpc.h"
-#include "rpcndr.h"
-
-#ifndef __GPAX_h__
-#define __GPAX_h__
-
-/* Forward Declarations */
-
-#ifndef __IGPAX_FWD_DEFINED__
-#define __IGPAX_FWD_DEFINED__
-typedef interface IGPAX IGPAX;
-#endif /* __IGPAX_FWD_DEFINED__ */
-
-
-#ifndef __IGPAXEvents_FWD_DEFINED__
-#define __IGPAXEvents_FWD_DEFINED__
-typedef interface IGPAXEvents IGPAXEvents;
-#endif /* __IGPAXEvents_FWD_DEFINED__ */
-
-
-#ifndef __GPAX_FWD_DEFINED__
-#define __GPAX_FWD_DEFINED__
-
-#ifdef __cplusplus
-typedef class GPAX GPAX;
-#else
-typedef struct GPAX GPAX;
-#endif /* __cplusplus */
-
-#endif /* __GPAX_FWD_DEFINED__ */
-
-
-/* header files for imported files */
-#include "oaidl.h"
-#include "ocidl.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
-void __RPC_USER MIDL_user_free( void __RPC_FAR * );
-
-
-#ifndef __GPAXLib_LIBRARY_DEFINED__
-#define __GPAXLib_LIBRARY_DEFINED__
-
-/* library GPAXLib */
-/* [helpstring][version][uuid] */
-
-
-
-#define DISPID_SRC ( 100 )
-
-#define DISPID_AutoStart ( 101 )
-
-#define DISPID_DownloadProgress ( 102 )
-
-#define DISPID_PlayEvent ( 100 )
-
-#define DISPID_PauseEvent ( 101 )
-
-#define DISPID_StopEvent ( 102 )
-
-
-EXTERN_C const IID LIBID_GPAXLib;
-
-#ifndef __IGPAX_INTERFACE_DEFINED__
-#define __IGPAX_INTERFACE_DEFINED__
-
-/* interface IGPAX */
-/* [object][oleautomation][hidden][dual][helpstring][uuid] */
-
-
-EXTERN_C const IID IID_IGPAX;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
-MIDL_INTERFACE("E2A9A937-BB35-47E0-8942-964806299AB4")
-IGPAX :
-public IDispatch
-{
-public:
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Play( void) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Pause( void) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Stop( void) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Update(
- /* [in] */ BSTR mtype,
- /* [in] */ BSTR updates) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QualitySwitch(
- /* [in] */ INT switchUp) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetURL(
- /* [in] */ BSTR url) = 0;
-
- virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_src(
- /* [retval][out] */ BSTR __RPC_FAR *url) = 0;
-
- virtual /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE put_src(
- /* [in] */ BSTR url) = 0;
-
- virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_AutoStart(
- /* [retval][out] */ VARIANT_BOOL __RPC_FAR *autoplay) = 0;
-
- virtual /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE put_AutoStart(
- /* [in] */ VARIANT_BOOL autoplay) = 0;
-
- virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_DownloadProgress(
- /* [retval][out] */ INT __RPC_FAR *downloadProgress) = 0;
-
- virtual /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE put_DownloadProgress(
- /* [in] */ INT downloadProgress) = 0;
-
-};
-
-#else /* C style interface */
-
-typedef struct IGPAXVtbl
-{
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
- IGPAX __RPC_FAR * This,
- /* [in] */ REFIID riid,
- /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
-
- ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
- IGPAX __RPC_FAR * This);
-
- ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
- IGPAX __RPC_FAR * This);
-
- HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
- IGPAX __RPC_FAR * This,
- /* [out] */ UINT __RPC_FAR *pctinfo);
-
- HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
- IGPAX __RPC_FAR * This,
- /* [in] */ UINT iTInfo,
- /* [in] */ LCID lcid,
- /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
-
- HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
- IGPAX __RPC_FAR * This,
- /* [in] */ REFIID riid,
- /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
- /* [in] */ UINT cNames,
- /* [in] */ LCID lcid,
- /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
-
- /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
- IGPAX __RPC_FAR * This,
- /* [in] */ DISPID dispIdMember,
- /* [in] */ REFIID riid,
- /* [in] */ LCID lcid,
- /* [in] */ WORD wFlags,
- /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
- /* [out] */ VARIANT __RPC_FAR *pVarResult,
- /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
- /* [out] */ UINT __RPC_FAR *puArgErr);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Play )(
- IGPAX __RPC_FAR * This);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Pause )(
- IGPAX __RPC_FAR * This);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Stop )(
- IGPAX __RPC_FAR * This);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Update )(
- IGPAX __RPC_FAR * This,
- /* [in] */ BSTR mtype,
- /* [in] */ BSTR updates);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QualitySwitch )(
- IGPAX __RPC_FAR * This,
- /* [in] */ INT switchUp);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetURL )(
- IGPAX __RPC_FAR * This,
- /* [in] */ BSTR url);
-
- /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_src )(
- IGPAX __RPC_FAR * This,
- /* [retval][out] */ BSTR __RPC_FAR *url);
-
- /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_src )(
- IGPAX __RPC_FAR * This,
- /* [in] */ BSTR url);
-
- /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_AutoStart )(
- IGPAX __RPC_FAR * This,
- /* [retval][out] */ VARIANT_BOOL __RPC_FAR *autoplay);
-
- /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_AutoStart )(
- IGPAX __RPC_FAR * This,
- /* [in] */ VARIANT_BOOL autoplay);
-
- END_INTERFACE
-} IGPAXVtbl;
-
-interface IGPAX
-{
- CONST_VTBL struct IGPAXVtbl __RPC_FAR *lpVtbl;
-};
-
-
-
-#ifdef COBJMACROS
-
-
-#define IGPAX_QueryInterface(This,riid,ppvObject) \
- (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
-
-#define IGPAX_AddRef(This) \
- (This)->lpVtbl -> AddRef(This)
-
-#define IGPAX_Release(This) \
- (This)->lpVtbl -> Release(This)
-
-
-#define IGPAX_GetTypeInfoCount(This,pctinfo) \
- (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
-
-#define IGPAX_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
- (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-
-#define IGPAX_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
- (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-
-#define IGPAX_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
- (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-
-
-#define IGPAX_Play(This) \
- (This)->lpVtbl -> Play(This)
-
-#define IGPAX_Pause(This) \
- (This)->lpVtbl -> Pause(This)
-
-#define IGPAX_Stop(This) \
- (This)->lpVtbl -> Stop(This)
-
-#define IGPAX_Update(This,mtype,updates) \
- (This)->lpVtbl -> Update(This,mtype,updates)
-
-#define IGPAX_QualitySwitch(This,switchUp) \
- (This)->lpVtbl -> QualitySwitch(This,switchUp)
-
-#define IGPAX_SetURL(This,url) \
- (This)->lpVtbl -> SetURL(This,url)
-
-#define IGPAX_get_src(This,url) \
- (This)->lpVtbl -> get_src(This,url)
-
-#define IGPAX_put_src(This,url) \
- (This)->lpVtbl -> put_src(This,url)
-
-#define IGPAX_get_AutoStart(This,autoplay) \
- (This)->lpVtbl -> get_AutoStart(This,autoplay)
-
-#define IGPAX_put_AutoStart(This,autoplay) \
- (This)->lpVtbl -> put_AutoStart(This,autoplay)
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IGPAX_Play_Proxy(
- IGPAX __RPC_FAR * This);
-
-
-void __RPC_STUB IGPAX_Play_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IGPAX_Pause_Proxy(
- IGPAX __RPC_FAR * This);
-
-
-void __RPC_STUB IGPAX_Pause_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IGPAX_Stop_Proxy(
- IGPAX __RPC_FAR * This);
-
-
-void __RPC_STUB IGPAX_Stop_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IGPAX_Update_Proxy(
- IGPAX __RPC_FAR * This,
- /* [in] */ BSTR mtype,
- /* [in] */ BSTR updates);
-
-
-void __RPC_STUB IGPAX_Update_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IGPAX_QualitySwitch_Proxy(
- IGPAX __RPC_FAR * This,
- /* [in] */ INT switchUp);
-
-
-void __RPC_STUB IGPAX_QualitySwitch_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IGPAX_SetURL_Proxy(
- IGPAX __RPC_FAR * This,
- /* [in] */ BSTR url);
-
-
-void __RPC_STUB IGPAX_SetURL_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-
-/* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE IGPAX_get_src_Proxy(
- IGPAX __RPC_FAR * This,
- /* [retval][out] */ BSTR __RPC_FAR *url);
-
-
-void __RPC_STUB IGPAX_get_src_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-
-/* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE IGPAX_put_src_Proxy(
- IGPAX __RPC_FAR * This,
- /* [in] */ BSTR url);
-
-
-void __RPC_STUB IGPAX_put_src_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-
-/* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE IGPAX_get_AutoStart_Proxy(
- IGPAX __RPC_FAR * This,
- /* [retval][out] */ VARIANT_BOOL __RPC_FAR *autoplay);
-
-
-void __RPC_STUB IGPAX_get_AutoStart_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-
-/* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE IGPAX_put_AutoStart_Proxy(
- IGPAX __RPC_FAR * This,
- /* [in] */ VARIANT_BOOL autoplay);
-
-
-void __RPC_STUB IGPAX_put_AutoStart_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-/* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE IGPAX_get_DownloadProgress_Proxy(
- IGPAX __RPC_FAR * This,
- /* [retval][out] */ INT __RPC_FAR *autoplay);
-
-
-void __RPC_STUB IGPAX_get_DownloadProgress_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-
-/* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE IGPAX_put_DownloadProgress_Proxy(
- IGPAX __RPC_FAR * This,
- /* [in] */ INT autoplay);
-
-
-void __RPC_STUB IGPAX_put_DownloadProgress_Stub(
- IRpcStubBuffer *This,
- IRpcChannelBuffer *_pRpcChannelBuffer,
- PRPC_MESSAGE _pRpcMessage,
- DWORD *_pdwStubPhase);
-
-
-
-#endif /* __IGPAX_INTERFACE_DEFINED__ */
-
-
-#ifndef __IGPAXEvents_DISPINTERFACE_DEFINED__
-#define __IGPAXEvents_DISPINTERFACE_DEFINED__
-
-/* dispinterface IGPAXEvents */
-/* [helpstring][uuid] */
-
-
-EXTERN_C const IID DIID_IGPAXEvents;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
-MIDL_INTERFACE("1FDA32FC-4C9A-461F-B33B-0715B0343006")
-IGPAXEvents :
-public IDispatch
-{
-};
-
-#else /* C style interface */
-
-typedef struct IGPAXEventsVtbl
-{
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
- IGPAXEvents __RPC_FAR * This,
- /* [in] */ REFIID riid,
- /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
-
- ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
- IGPAXEvents __RPC_FAR * This);
-
- ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
- IGPAXEvents __RPC_FAR * This);
-
- HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
- IGPAXEvents __RPC_FAR * This,
- /* [out] */ UINT __RPC_FAR *pctinfo);
-
- HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
- IGPAXEvents __RPC_FAR * This,
- /* [in] */ UINT iTInfo,
- /* [in] */ LCID lcid,
- /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
-
- HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
- IGPAXEvents __RPC_FAR * This,
- /* [in] */ REFIID riid,
- /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
- /* [in] */ UINT cNames,
- /* [in] */ LCID lcid,
- /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
-
- /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
- IGPAXEvents __RPC_FAR * This,
- /* [in] */ DISPID dispIdMember,
- /* [in] */ REFIID riid,
- /* [in] */ LCID lcid,
- /* [in] */ WORD wFlags,
- /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
- /* [out] */ VARIANT __RPC_FAR *pVarResult,
- /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
- /* [out] */ UINT __RPC_FAR *puArgErr);
-
- END_INTERFACE
-} IGPAXEventsVtbl;
-
-interface IGPAXEvents
-{
- CONST_VTBL struct IGPAXEventsVtbl __RPC_FAR *lpVtbl;
-};
-
-
-
-#ifdef COBJMACROS
-
-
-#define IGPAXEvents_QueryInterface(This,riid,ppvObject) \
- (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
-
-#define IGPAXEvents_AddRef(This) \
- (This)->lpVtbl -> AddRef(This)
-
-#define IGPAXEvents_Release(This) \
- (This)->lpVtbl -> Release(This)
-
-
-#define IGPAXEvents_GetTypeInfoCount(This,pctinfo) \
- (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
-
-#define IGPAXEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
- (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-
-#define IGPAXEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
- (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-
-#define IGPAXEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
- (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-#endif /* __IGPAXEvents_DISPINTERFACE_DEFINED__ */
-
-
-EXTERN_C const CLSID CLSID_GPAX;
-
-#ifdef __cplusplus
-
-class DECLSPEC_UUID("181D18E6-4DC1-4B55-B72E-BE2A10064995")
- GPAX;
-#endif
-#endif /* __GPAXLib_LIBRARY_DEFINED__ */
-
-/* Additional Prototypes for ALL interfaces */
-
-/* end of Additional Prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
+++ /dev/null
-// GPAX.idl : IDL source for GPAX.dll
-//
-
-// This file will be processed by the MIDL tool to
-// produce the type library (GPAX.tlb) and marshalling code.
-
-import "oaidl.idl";
-import "ocidl.idl";
-#include "olectl.h"
-
-
-[
- uuid(E64FAC7F-0134-4A75-A7DA-80D53EBC56A6),
- version(1.0),
- helpstring("GPAX ActiveX Control")
-]
-
-library GPAXLib
-{
- importlib("stdole2.tlb");
-
- // Forward declare all types defined in this typelib
- interface IGPAX;
- dispinterface IGPAXEvents;
-
- const int DISPID_SRC = 100;
- const int DISPID_AutoStart = 101;
- const int DISPID_DownloadProgress = 102;
-
-
- //IDispatch interface
- [
- odl,
- uuid(E2A9A937-BB35-47E0-8942-964806299AB4),
- helpstring("GPAC ActiveX Control"),
- dual,
- hidden,
- oleautomation
- ]
- interface IGPAX : IDispatch
- {
- /*functions*/
- [helpstring("Play Movie")] HRESULT Play();
- [helpstring("Pause/Resume Movie")] HRESULT Pause();
- [helpstring("Stop Movie")] HRESULT Stop();
- [helpstring("Update Scene")] HRESULT Update([in] BSTR mtype, [in] BSTR updates);
- [helpstring("Switch Quality")] HRESULT QualitySwitch ([in] int switch_up);
- [helpstring("Change URL")] HRESULT SetURL ([in] BSTR url);
-
-
- /*properties*/
- [id(DISPID_SRC), propget, helpstring("Get/Set the media source")]
- HRESULT src([out, retval] BSTR* url);
- [id(DISPID_SRC), propput, helpstring("Get/Set the media source")]
- HRESULT src([in] BSTR url);
-
- [id(DISPID_AutoStart), propget, helpstring("Get/Set automatic playback upon load")]
- HRESULT AutoStart([out, retval] VARIANT_BOOL* autoplay);
- [id(DISPID_AutoStart), propput, helpstring("Get/Set automatic playback upon load")]
- HRESULT AutoStart([in] VARIANT_BOOL autoplay);
-
- [id(DISPID_DownloadProgress), propget, helpstring("Get/Set download progress")]
- HRESULT DownloadProgress([out, retval] INT* downloadProgress);
- [id(DISPID_DownloadProgress), propput, helpstring("Get/Set download progress")]
- HRESULT DownloadProgress([in] INT downloadProgress);
- };
-
-
- //event interface
- [
- uuid(1FDA32FC-4C9A-461F-B33B-0715B0343006),
- helpstring("GPAX Control Events")
- ]
- dispinterface IGPAXEvents
- {
- properties:
- methods:
- };
-
-
- //AX control
- [
- uuid(181D18E6-4DC1-4B55-B72E-BE2A10064995),
- helpstring("GPAC Control"),
- control
- ]
- coclass GPAX
- {
- [default] interface IGPAX;
- [default, source] dispinterface IGPAXEvents;
- };
-};
+++ /dev/null
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "winres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-#include <gpac/version.h>
-
-/////////////////////////////////////////////////////////////////////////////
-// Chinese (P.R.C.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
-#ifdef _WIN32
-LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
-#pragma code_page(936)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""winres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "1 TYPELIB ""GPAX.tlb""\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // Chinese (P.R.C.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "Comments", "\0"
- VALUE "CompanyName", "ENST\0"
- VALUE "FileDescription", "GPAX\0"
- VALUE "FileVersion", GPAC_VERSION"\0"
- VALUE "InternalName", "GPAX\0"
- VALUE "LegalCopyright", "Copyright © 2012-\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "GPAX.dll\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Telecom ParisTech GPAX\0"
- VALUE "ProductVersion", GPAC_VERSION"\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-#endif // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDB_GPAXPLUGIN BITMAP DISCARDABLE "gpax.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// REGISTRY
-//
-
-IDR_GPAXPLUGIN REGISTRY DISCARDABLE "GPAX.rgs"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_PROJNAME "GPAX"
- IDS_TITLEGPAXProp "&GPAX"
- IDS_HELPFILEGPAXProp "Help File Name"
- IDS_DOCSTRINGGPAXProp "URLs setting"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-1 TYPELIB "GPAX.tlb"
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+++ /dev/null
-HKCR
-{
- ForceRemove '.aac'
- {
- val 'Content Type' = s 'audio/aac'
- }
- ForceRemove '.amr'
- {
- val 'Content Type' = s 'audio/amr'
- }
- ForceRemove '.mp4'
- {
- val 'Content Type' = s 'application/mp4'
- }
- ForceRemove '.3gp'
- {
- val 'Content Type' = s 'video/3gpp'
- }
- ForceRemove '.3g2'
- {
- val 'Content Type' = s 'video/3gpp2'
- }
- ForceRemove '.wrl'
- {
- val 'Content Type' = s 'model/vrml'
- }
- ForceRemove '.x3dv'
- {
- val 'Content Type' = s 'model/x3d+vrml'
- }
- ForceRemove '.x3d'
- {
- val 'Content Type' = s 'model/x3d+xml'
- }
- ForceRemove '.svg'
- {
- val 'Content Type' = s 'image/svg+xml'
- }
- ForceRemove '.sdp'
- {
- val 'Content Type' = s 'application/sdp'
- }
-
- GPAX.GPAXPlugin.1 = s 'GPAC ActiveX'
- {
- CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- }
- GPAX.GPAXPlugin = s 'GPAC ActiveX'
- {
- CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- CurVer = s 'GPAX.GPAXPlugin.1'
- }
- NoRemove CLSID
- {
- ForceRemove {181D18E6-4DC1-4B55-B72E-BE2A10064995} = s 'GPAC ActiveX'
- {
- ProgID = s 'GPAX.GPAXPlugin.1'
- VersionIndependentProgID = s 'GPAX.GPAXPlugin'
- ForceRemove 'Programmable'
- InprocServer32 = s '%MODULE%'
- {
- val ThreadingModel = s 'Both'
- }
- ForceRemove 'Control'
- ForceRemove 'Insertable'
- ForceRemove 'ToolboxBitmap32' = s '%MODULE%, 101'
- 'MiscStatus' = s '0'
- {
- '1' = s '131473'
- }
- 'TypeLib' = s '{E64FAC7F-0134-4A75-A7DA-80D53EBC56A6}'
- 'Version' = s '1.0'
- ForceRemove 'EnableFullPage'
- {
- ForceRemove .mp4
- ForceRemove .3gp
- ForceRemove .3g2
- ForceRemove .wrl
- ForceRemove .x3d
- ForceRemove .x3dv
- ForceRemove .svg
- }
- }
- }
-
- NoRemove MIME
- {
- NoRemove Database
- {
- NoRemove 'Content Type'
- {
- 'application/x-gpac'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.gpac'
- }
- 'application/mp4'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.mp4'
- }
- 'application/sdp'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.sdp'
- }
- 'audio/aac'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.aac'
- }
- 'audio/amr'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.amr'
- }
- 'audio/mp4'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.mp4'
- }
- 'audio/mpeg'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.mp3'
- }
- 'image/svg+xml'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.svg'
- }
- 'model/vrml'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.wrl'
- }
- 'model/x3d+vrml'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.x3dv'
- }
- 'model/x3d+xml'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.x3d'
- }
- 'video/mp4'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.mp4'
- }
- 'video/3gpp'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.3gp'
- }
- 'video/3gpp2'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.3g2'
- }
- 'video/avi'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.avi'
- }
- 'video/mpeg'
- {
- val CLSID = s '{181D18E6-4DC1-4B55-B72E-BE2A10064995}'
- val Extension = s '.mpg'
- }
- }
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{72486240-A124-496E-A67A-E76FEC7E99BE}</ProjectGuid>\r
- <RootNamespace>GPAX</RootNamespace>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <UseOfAtl>Dynamic</UseOfAtl>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <UseOfAtl>Dynamic</UseOfAtl>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <UseOfAtl>Dynamic</UseOfAtl>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <UseOfAtl>Dynamic</UseOfAtl>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>\r
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>\r
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</EmbedManifest>\r
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</EmbedManifest>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkIncremental>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <CustomBuildStep>\r
- <Message>\r
- </Message>\r
- <Command>\r
- </Command>\r
- <Outputs>\r
- </Outputs>\r
- </CustomBuildStep>\r
- <Midl>\r
- <TypeLibraryName>.\obj/w32_deb/GPAX.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>false</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ModuleDefinitionFile>..\..\applications\GPAX\GPAX.def</ModuleDefinitionFile>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <CustomBuildStep>\r
- <Message>\r
- </Message>\r
- <Command>\r
- </Command>\r
- <Outputs>\r
- </Outputs>\r
- </CustomBuildStep>\r
- <Midl>\r
- <TypeLibraryName>.\obj/w32_deb/GPAX.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>false</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ModuleDefinitionFile>..\..\applications\GPAX\GPAX.def</ModuleDefinitionFile>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <CustomBuildStep>\r
- <Message>\r
- </Message>\r
- <Command>\r
- </Command>\r
- <Outputs>\r
- </Outputs>\r
- </CustomBuildStep>\r
- <Midl>\r
- <TypeLibraryName>.\obj/w32_rel/GPAX.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>zlib.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ModuleDefinitionFile>..\..\applications\GPAX\GPAX.def</ModuleDefinitionFile>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <SupportUnloadOfDelayLoadedDLL>false</SupportUnloadOfDelayLoadedDLL>\r
- <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- <PostBuildEvent>\r
- <Command>\r
- </Command>\r
- </PostBuildEvent>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <CustomBuildStep>\r
- <Message>\r
- </Message>\r
- <Command>\r
- </Command>\r
- <Outputs>\r
- </Outputs>\r
- </CustomBuildStep>\r
- <Midl>\r
- <TypeLibraryName>.\obj/w32_rel/GPAX.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <BasicRuntimeChecks>Default</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <InlineFunctionExpansion>Default</InlineFunctionExpansion>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ModuleDefinitionFile>..\..\applications\GPAX\GPAX.def</ModuleDefinitionFile>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <SupportUnloadOfDelayLoadedDLL>false</SupportUnloadOfDelayLoadedDLL>\r
- <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- <PostBuildEvent>\r
- <Command>\r
- </Command>\r
- </PostBuildEvent>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <None Include="..\..\applications\GPAX\gpax.bmp" />\r
- <None Include="..\..\applications\GPAX\GPAX.def" />\r
- <None Include="..\..\applications\GPAX\GPAX.rgs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\applications\GPAX\GPAX.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\GPAX\GPAXPlugin.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\GPAX\StdAfx.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\applications\GPAX\GPAX.h" />\r
- <ClInclude Include="..\..\applications\GPAX\GPAXPlugin.h" />\r
- <ClInclude Include="..\..\applications\GPAX\resource.h" />\r
- <ClInclude Include="..\..\applications\GPAX\StdAfx.h" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Midl Include="..\..\applications\GPAX\GPAX.idl">\r
- <TypeLibraryName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GPAX.tlb</TypeLibraryName>\r
- <TypeLibraryName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GPAX.tlb</TypeLibraryName>\r
- <TypeLibraryName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GPAX.tlb</TypeLibraryName>\r
- <TypeLibraryName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GPAX.tlb</TypeLibraryName>\r
- </Midl>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ResourceCompile Include="..\..\applications\GPAX\GPAX.rc">\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\gpac\applications\GPAX;$(OUTDIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\gpac\applications\GPAX;$(OUTDIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\gpac\applications\GPAX;$(OUTDIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\gpac\applications\GPAX;$(OUTDIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="libgpac_dll.vcxproj">\r
- <Project>{d3540754-e0cf-4604-ac11-82de9bd4d814}</Project>\r
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / ActiveX control
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "stdafx.h"
-#include "GPAX.h"
-#include "GPAXPlugin.h"
-#include <gpac/network.h>
-#include <gpac/utf.h>
-#include <shlobj.h>
-#include <math.h>
-
-#ifndef _WIN32_WCE
-#include <direct.h>
-#include <mshtml.h>
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CGPAXPlugin
-
-#if 0
-static print_err(char *msg, char *title)
-{
- u16 w_msg[1024], w_title[1024];
- CE_CharToWide(msg, w_msg);
- CE_CharToWide(title, w_title);
- ::MessageBox(NULL, w_msg, w_title, MB_OK);
-}
-#endif
-
-
-void CGPAXPlugin::SetStatusText(char *msg)
-{
-#ifndef _WIN32_WCE
- if (m_pBrowser) {
- if (msg) {
- u16 w_msg[1024];
- gf_utf8_mbstowcs(w_msg, 1024, (const char **)&msg);
- m_pBrowser->put_StatusText((BSTR) w_msg);
- } else {
- m_pBrowser->put_StatusText(L"");
- }
- }
-#endif
-}
-//GPAC player Event Handler. not yet implemented, just dummies here
-Bool CGPAXPlugin::EventProc(GF_Event *evt)
-{
- char msg[1024];
- if (!m_term) return GF_FALSE;
-
- switch (evt->type) {
- case GF_EVENT_MESSAGE:
- if (evt->message.error) {
- sprintf(msg, "(GPAC) %s (%s)", evt->message.message, gf_error_to_string(evt->message.error));
- } else {
- sprintf(msg, "(GPAC) %s", evt->message.message);
- }
- SetStatusText(msg);
- break;
- case GF_EVENT_PROGRESS:
- if (evt->progress.done == evt->progress.total) {
- SetStatusText(NULL);
- m_iDownload_progress = 100;
- } else {
- char *szTitle = "";
- if (evt->progress.progress_type==0) szTitle = "Buffer ";
- else if (evt->progress.progress_type==1)
- {
- szTitle = "Download ";
- m_iDownload_progress = (int)floor((100.0*evt->progress.done) / evt->progress.total);
- }
- else if (evt->progress.progress_type==2) szTitle = "Import ";
- sprintf(msg, "(GPAC) %s: %02.2f", szTitle, (100.0*evt->progress.done) / evt->progress.total);
- SetStatusText(msg);
- }
- break;
- case GF_EVENT_CONNECT:
- m_bIsConnected = evt->connect.is_connected;
- break;
- /*IGNORE any scene size, just work with the size allocated in the parent doc*/
- case GF_EVENT_SCENE_SIZE:
- gf_term_set_size(m_term, m_width, m_height);
- break;
- /*window has been resized (full-screen plugin), resize*/
- case GF_EVENT_SIZE:
- m_width = evt->size.width;
- m_height = evt->size.height;
- gf_term_set_size(m_term, m_width, m_height);
- break;
- case GF_EVENT_DBLCLICK:
- gf_term_set_option(m_term, GF_OPT_FULLSCREEN, !gf_term_get_option(m_term, GF_OPT_FULLSCREEN));
- break;
- case GF_EVENT_KEYDOWN:
- if ((evt->key.flags & GF_KEY_MOD_ALT)) {
- } else {
- switch (evt->key.key_code) {
- case GF_KEY_HOME:
- gf_term_set_option(m_term, GF_OPT_NAVIGATION_TYPE, 1);
- break;
- case GF_KEY_ESCAPE:
- gf_term_set_option(m_term, GF_OPT_FULLSCREEN, !gf_term_get_option(m_term, GF_OPT_FULLSCREEN));
- break;
- }
- }
- break;
- case GF_EVENT_NAVIGATE_INFO:
- strcpy(msg, evt->navigate.to_url);
- SetStatusText(msg);
- break;
- case GF_EVENT_NAVIGATE:
- if (gf_term_is_supported_url(m_term, evt->navigate.to_url, GF_TRUE, GF_TRUE)) {
- gf_term_navigate_to(m_term, evt->navigate.to_url);
- return GF_TRUE;
- }
-#ifndef _WIN32_WCE
- else if (m_pBrowser) {
- u32 i;
- const char **sz_ptr;
- u16 w_szTar[1024], w_szURL[1024];
- VARIANT target, flags;
- flags.intVal = 0;
- target.bstrVal = L"_SELF";
-
- for (i=0; i<evt->navigate.param_count; i++) {
- if (!strcmp(evt->navigate.parameters[i], "_parent")) target.bstrVal = L"_PARENT";
- else if (!strcmp(evt->navigate.parameters[i], "_blank")) target.bstrVal = L"_BLANK";
- else if (!strcmp(evt->navigate.parameters[i], "_top")) target.bstrVal = L"_TOP";
- else if (!strcmp(evt->navigate.parameters[i], "_new")) flags.intVal |= navOpenInNewWindow;
- else if (!strnicmp(evt->navigate.parameters[i], "_target=", 8)) {
- sz_ptr = & evt->navigate.parameters[i]+8;
- gf_utf8_mbstowcs(w_szTar, 1024, (const char **)sz_ptr);
- target.bstrVal = (BSTR) w_szTar;
- }
- }
- sz_ptr = & evt->navigate.to_url;
- gf_utf8_mbstowcs(w_szURL, 1024, (const char **)sz_ptr);
- m_pBrowser->Navigate((BSTR) w_szURL, &flags, &target, NULL, NULL);;
- return GF_TRUE;
- }
-#endif
- break;
- }
- return GF_FALSE;
-}
-
-Bool GPAX_EventProc(void *ptr, GF_Event *evt)
-{
- CGPAXPlugin *_this = (CGPAXPlugin *)ptr;
- return _this->EventProc(evt);
-}
-
-//Read Parameters from pPropBag given by MSIE
-Bool CGPAXPlugin::ReadParamString(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog,
- WCHAR *name, char *buf, int bufsize)
-{
- VARIANT v;
- HRESULT hr;
- Bool retval = GF_FALSE;
-
- v.vt = VT_EMPTY;
- v.bstrVal = NULL;
- hr = pPropBag->Read(name, &v, pErrorLog);
- if(SUCCEEDED(hr))
- {
- if(v.vt==VT_BSTR && v.bstrVal)
- {
-// USES_CONVERSION;
-// lstrcpyn(buf,OLE2T(v.bstrVal),bufsize);
- const u16 *srcp = (const u16 *) v.bstrVal;
- size_t len = gf_utf8_wcstombs(buf, bufsize, &srcp);
- if (len>=0) {
- buf[(u32) len] = 0;
- retval = GF_TRUE;
- }
- }
- VariantClear(&v);
- }
- return retval;
-}
-
-void CGPAXPlugin::LoadDATAUrl()
-{
-#ifndef _WIN32_WCE
- HRESULT hr;
-
- if (m_url[0]) return;
- /*get parent doc*/
- CComPtr<IOleContainer> spContainer;
- if (m_spClientSite->GetContainer(&spContainer) != S_OK)
- return;
- CComPtr<IHTMLDocument2> spDoc = CComQIPtr<IHTMLDocument2>(spContainer);
- CComPtr<IHTMLElementCollection> spColl;
- if (spDoc->get_all(&spColl) != S_OK)
- return;
- /*get HTML <object> in the doc*/
- CComPtr<IDispatch> spDisp;
- CComPtr<IHTMLElementCollection> sphtmlObjects;
-
- CComPtr<IDispatch> spDispObjects;
- if (spColl->tags(CComVariant("OBJECT"), &spDispObjects) != S_OK)
- return;
- CComPtr<IHTMLElementCollection> spObjs = CComQIPtr<IHTMLElementCollection>(spDispObjects);
-
- /*browse all objects and find us*/
- long lCount = 0;
- spObjs->get_length(&lCount);
- for (long lCnt = 0; lCnt < lCount; lCnt++) {
- IDispatch *an_obj= NULL;
- CComVariant varEmpty;
- CComVariant varName;
- varName.vt = VT_I4;
- varName.lVal = lCnt;
- hr = spObjs->item(varName, varEmpty, &an_obj);
- varName.Clear();
- varEmpty.Clear();
- if (hr != S_OK) continue;
-
- /*get the IHTMLObject*/
- IHTMLObjectElement* pObjectElem=NULL;
- an_obj->QueryInterface(IID_IHTMLObjectElement, (void**)&pObjectElem);
- if (!pObjectElem) continue;
-
- /*get its parent owner - it MUST be us*/
- IDispatch *disp= NULL;
- pObjectElem->get_object(&disp);
- if (disp != this) continue;
-
- BSTR data = NULL;
- if ((pObjectElem->get_data(&data) == S_OK) && data) {
- const u16 *srcp = (const u16 *) data;
- size_t len = gf_utf8_wcstombs(m_url, MAXLEN_URL, &srcp);
- if (len>=0) m_url[(u32) len] = 0;
- }
- SysFreeString(data);
- break;
- }
-
- if (m_url) {
- UpdateURL();
- }
-#endif
-
-}
-
-// trap keys and forward on to the control
-BOOL CGPAXPlugin::PreTranslateMessage(MSG* pMsg)
-{
- switch (pMsg->message)
- {
- case WM_KEYDOWN:
- case WM_KEYUP:
- switch (pMsg->wParam)
- {
- case VK_UP:
- case VK_DOWN:
- case VK_LEFT:
- case VK_RIGHT:
- case VK_HOME:
- case VK_END:
- SendMessage (pMsg->message, pMsg->wParam, pMsg->lParam);
- // Windowless controls won't be able to call SendMessage.
- // Instead, just respond to the message here.
- return TRUE;
- }
- break;
- }
- return FALSE;
-// return COleControl::PreTranslateMessage(pMsg);
-}
-
-
-
-
-#define GPAC_REG_KEY HKEY_CURRENT_USER
-
-static void gpax_do_log(void *cbk, GF_LOG_Level level, GF_LOG_Tool tool, const char *fmt, va_list list)
-{
- FILE *logs = (FILE *) cbk;
- vfprintf(logs, fmt, list);
- fflush(logs);
-}
-
-//Create window message fuction. when the window is created, also initialize a instance of
-//GPAC player instance.
-LRESULT CGPAXPlugin::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
- if (m_term) return 0;
- const char *str;
-
- if (m_hWnd==NULL) return 0;
-
- gf_sys_init(GF_MemTrackerNone);
-
- //Create a structure m_user for initialize the terminal. the parameters to set:
- //1)config file path
- //2)Modules file path
- //3)window handler
- //4)EventProc
- memset(&m_user, 0, sizeof(m_user));
-
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_ERROR);
-
- m_user.config = gf_cfg_init(NULL, NULL);
- if(!m_user.config) {
-#ifdef _WIN32_WCE
- ::MessageBox(NULL, _T("GPAC Configuration file not found"), _T("Fatal Error"), MB_OK);
-#else
- ::MessageBox(NULL, "GPAC Configuration file not found", "Fatal Error", MB_OK);
-#endif
- goto err_exit;
- }
-
- /*check log file*/
- str = gf_opts_get_key("General", "log-file");
- if (str) {
- m_pLogs = gf_fopen(str, "wt");
- if (m_pLogs) gf_log_set_callback(m_pLogs, gpax_do_log);
- }
-
- /*if logs are specified, use them*/
- gf_log_set_tools_levels( gf_cfg_get_key(m_user.config, "General", "Logs") );
-
-
- str = gf_cfg_get_key(m_user.config, "Core", "ModulesDirectory");
- m_user.modules = gf_modules_new(NULL, m_user.config);
- if(!gf_modules_get_count(m_user.modules)) goto err_exit;
-
- m_user.os_window_handler = m_hWnd;
- m_user.opaque = this;
- m_user.EventProc = GPAX_EventProc;
-
- //create a terminal
- m_term = gf_term_new(&m_user);
-
- if (!m_term) goto err_exit;
-
- gf_term_set_option(m_term, GF_OPT_AUDIO_VOLUME, 100);
-
- LoadDATAUrl();
-
- RECT rc;
- ::GetWindowRect(m_hWnd, &rc);
- m_width = rc.right-rc.left;
- m_height = rc.bottom-rc.top;
- if (m_bAutoStart && strlen(m_url)) Play();
- return 0;
-
- //Error Processing
-err_exit:
- if(m_user.modules)
- gf_modules_del(m_user.modules);
- m_user.modules = NULL;
- if(m_user.config)
- gf_cfg_del(m_user.config);
- m_user.config = NULL;
- gf_sys_close();
- return 1;
-}
-
-void CGPAXPlugin::UnloadTerm()
-{
- if (m_term) {
- GF_Terminal *a_term = m_term;
- m_term = NULL;
- gf_term_del(a_term);
- }
- if (m_user.modules) gf_modules_del(m_user.modules);
- if (m_user.config) gf_cfg_del(m_user.config);
- if (m_pLogs)
- gf_fclose(m_pLogs);
- m_pLogs = NULL;
- gf_log_set_callback(NULL, NULL);
- memset(&m_user, 0, sizeof(m_user));
- gf_sys_close();
-}
-CGPAXPlugin::~CGPAXPlugin()
-{
- UnloadTerm();
-#ifndef _WIN32_WCE
- if (m_pBrowser) m_pBrowser->Release();
- m_pBrowser = NULL;
-#endif
-}
-LRESULT CGPAXPlugin::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
- UnloadTerm();
- return 0;
-}
-
-
-HRESULT CGPAXPlugin::OnDraw(ATL_DRAWINFO& di)
-{
- if (m_term && m_bInitialDraw) {
- m_bInitialDraw = GF_FALSE;
- if (m_bAutoStart) Play();
- }
- return S_OK;
-}
-
-// Load is called before OnCreate, but it may not be called at
-// all if there are no parameters.
-STDMETHODIMP CGPAXPlugin::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog)
-{
- char szOpt[1024];
- // examine the <embed>/<param> tag arguments
-
- m_url[0] = 0;
- ReadParamString(pPropBag,pErrorLog,L"src", m_url, MAXLEN_URL);
- if (!m_url[0])
- ReadParamString(pPropBag,pErrorLog,L"data", m_url, MAXLEN_URL);
-
- if (ReadParamString(pPropBag,pErrorLog,L"autostart", szOpt, 1024))
- m_bAutoStart = (!stricmp(szOpt, "false") || !stricmp(szOpt, "no")) ? GF_FALSE : GF_TRUE;
-
- if (ReadParamString(pPropBag,pErrorLog,L"use3d", szOpt, 1024))
- m_bUse3D = (!stricmp(szOpt, "true") || !stricmp(szOpt, "yes")) ? GF_TRUE : GF_FALSE;
-
- if (ReadParamString(pPropBag,pErrorLog,L"aspectratio", szOpt, 1024)) {
- if (!stricmp(szOpt, "keep")) m_AR = GF_ASPECT_RATIO_KEEP;
- else if (!stricmp(szOpt, "16:9")) m_AR = GF_ASPECT_RATIO_16_9;
- else if (!stricmp(szOpt, "4:3")) m_AR = GF_ASPECT_RATIO_4_3;
- else if (!stricmp(szOpt, "fill")) m_AR = GF_ASPECT_RATIO_FILL_SCREEN;
- }
-
- if (ReadParamString(pPropBag,pErrorLog,L"loop", szOpt, 1024))
- m_bLoop = !stricmp(szOpt, "true") ? GF_FALSE : GF_TRUE;
-
- if (ReadParamString(pPropBag,pErrorLog,L"gui", szOpt, 1024))
- m_bUseGUI = (!stricmp(szOpt, "true") || !stricmp(szOpt, "yes")) ? GF_TRUE : GF_FALSE;
-
- UpdateURL();
-
-#ifndef _WIN32_WCE
- /*get the top-level container*/
- if (!m_pBrowser) {
- IServiceProvider *isp, *isp2 = NULL;
- if ( SUCCEEDED(m_spClientSite->QueryInterface(IID_IServiceProvider, reinterpret_cast<void **>(&isp)) ) ) {
-
- if (SUCCEEDED(isp->QueryService(SID_STopLevelBrowser, IID_IServiceProvider, reinterpret_cast<void **>(&isp2)) ) ) {
- isp2->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, reinterpret_cast<void **>(&m_pBrowser));
- isp2->Release();
- }
- isp->Release();
- }
- }
- if (m_pBrowser) m_pBrowser->put_StatusText(L"GPAC Ready");
-#endif
-
- return IPersistPropertyBagImpl<CGPAXPlugin>::Load(pPropBag, pErrorLog);
-}
-
-void CGPAXPlugin::UpdateURL()
-{
- /*get absolute URL*/
- if (!strlen(m_url)) return;
- IMoniker* pMoniker = NULL;
- LPOLESTR sDisplayName;
-
- if (SUCCEEDED(m_spClientSite->GetMoniker(OLEGETMONIKER_TEMPFORUSER,
- OLEWHICHMK_CONTAINER,
- &pMoniker) ) ) {
- char parent_url[1024];
- pMoniker->GetDisplayName(NULL, NULL, &sDisplayName);
- wcstombs(parent_url, sDisplayName, 300);
- pMoniker->Release();
-
- char *abs_url = gf_url_concatenate(parent_url, m_url);
- if (abs_url) {
- strcpy(m_url, abs_url);
- gf_free(abs_url);
- }
- }
-}
-
-STDMETHODIMP CGPAXPlugin::Save(LPPROPERTYBAG pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
-{
- u16 wurl[MAXLEN_URL];
- const char *sptr;
- u16 len;
-
- VARIANT value;
- if( pPropBag == NULL) return E_INVALIDARG;
-
- VariantInit(&value);
-
- V_VT(&value) = VT_BOOL;
- V_BOOL(&value) = m_bAutoStart ? VARIANT_TRUE : VARIANT_FALSE;
- pPropBag->Write(OLESTR("AutoStart"), &value);
- VariantClear(&value);
-
- V_VT(&value) = VT_BSTR;
-
- sptr = (const char *)m_url;
- len = (u16) gf_utf8_mbstowcs(wurl, MAXLEN_URL, &sptr);
- V_BSTR(&value) = SysAllocStringLen(NULL, len+1);
- memcpy(V_BSTR(&value) , wurl, len*sizeof(u16));
- V_BSTR(&value) [len] = 0;
-
- pPropBag->Write(OLESTR("src"), &value);
- VariantClear(&value);
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::Play()
-{
- if (m_term) {
- if (!m_bIsConnected) {
- if (strlen(m_url)) {
- /*connect from 0 and pause if not autoplay*/
- const char *gui = gf_cfg_get_key(m_user.config, "General", "StartupFile");
- if (gui && m_bUseGUI) {
- gf_cfg_set_key(m_user.config, "Temp", "BrowserMode", "yes");
- gf_cfg_set_key(m_user.config, "Temp", "GUIStartupFile", m_url);
- gf_term_connect(m_term, gui);
- } else {
- gf_term_connect(m_term, m_url);
- }
- gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, m_AR);
- }
- } else
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING); //if target is connected, set it playing
- }
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::Pause()
-{
- if(m_term) {
- if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE) == GF_STATE_PAUSED) {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
- } else {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
- }
- }
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::Stop()
-{
- if(m_term) gf_term_disconnect(m_term); //set it stop
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::QualitySwitch(int switch_up)
-{
- if (m_term) gf_term_switch_quality(m_term, switch_up ? GF_TRUE : GF_FALSE);
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::SetURL(BSTR _url)
-{
- if (m_term) {
- u16 *srcp;
- u32 len;
- char *url;
-
- srcp = (u16 *)_url;
- len = (u32) gf_utf8_wcstombs(NULL, 0, (const u16 **)&srcp);
- if (len) {
- url = (char *) gf_malloc(sizeof(char) * (len+1));
- srcp = (u16 *)_url;
- len = (u32) gf_utf8_wcstombs(url, len, (const u16 **)&srcp);
- url[len] = 0;
- strcpy(m_url, url);
- gf_term_connect(m_term, url);
- gf_free(url);
- }
- }
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::Update(BSTR _mtype, BSTR _updates)
-{
- if (m_term) {
- u16 *srcp;
- u32 len;
- char mtype[1024], *updates;
-
- srcp = (u16 *) _mtype;
- len = (u32) gf_utf8_wcstombs(mtype, 1024, (const u16 **)&srcp);
- mtype[len] = 0;
-
- srcp = (u16 *)_updates;
- len = (u32) gf_utf8_wcstombs(NULL, 0, (const u16 **)&srcp);
- if (len) {
- updates = (char *) gf_malloc(sizeof(char) * (len+1));
- srcp = (u16 *)_updates;
- len = (u32) gf_utf8_wcstombs(updates, len, (const u16 **)&srcp);
- updates[len] = 0;
- gf_term_scene_update(m_term, mtype, updates);
- gf_free(updates);
- }
- }
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::get_src(BSTR *url)
-{
- u16 wurl[MAXLEN_URL];
- const char *sptr;
- u16 len;
- if (url==NULL) return E_POINTER;
-
- sptr = (const char *)m_url;
- len = (u32) gf_utf8_mbstowcs(wurl, MAXLEN_URL, &sptr);
- *url = SysAllocStringLen(NULL, len+1);
- memcpy(*url, wurl, len*sizeof(u16));
- *url[len] = 0;
- return S_OK;
-}
-STDMETHODIMP CGPAXPlugin::put_src(BSTR url)
-{
- const u16 *srcp = (const u16 *)url;
- u32 len = (u32) gf_utf8_wcstombs(m_url, MAXLEN_URL, &srcp);
- m_url[len] = 0;
- UpdateURL();
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::get_AutoStart(VARIANT_BOOL *as)
-{
- if (as==NULL) return E_POINTER;
- *as = m_bAutoStart ? VARIANT_TRUE: VARIANT_FALSE;
- return S_OK;
-}
-STDMETHODIMP CGPAXPlugin::put_AutoStart(VARIANT_BOOL as)
-{
- m_bAutoStart = (as !=VARIANT_FALSE) ? GF_TRUE : GF_FALSE;
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::get_DownloadProgress(INT *dp)
-{
- if (dp==NULL) return E_POINTER;
- *dp = m_iDownload_progress;
- return S_OK;
-}
-STDMETHODIMP CGPAXPlugin::put_DownloadProgress(INT dp)
-{
- return S_OK;
-}
-
-STDMETHODIMP CGPAXPlugin::GetInterfaceSafetyOptions(
- REFIID riid,
- DWORD *pdwSupportedOptions,
- DWORD *pdwEnabledOptions
-)
-{
- if( (NULL == pdwSupportedOptions) || (NULL == pdwEnabledOptions) )
- return E_POINTER;
-
- *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACESAFE_FOR_UNTRUSTED_CALLER;
-
- if ((IID_IDispatch == riid) || (IID_IGPAX == riid)) {
- *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
- return NOERROR;
- }
- else if (IID_IPersistPropertyBag == riid) {
- *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA;
- return NOERROR;
- }
- *pdwEnabledOptions = 0;
- return E_NOINTERFACE;
-};
-
-STDMETHODIMP CGPAXPlugin::SetInterfaceSafetyOptions(
- REFIID riid,
- DWORD dwOptionSetMask,
- DWORD dwEnabledOptions
-)
-{
- if ((IID_IDispatch == riid) || (IID_IGPAX == riid) ) {
- if( (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwOptionSetMask)
- && (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwEnabledOptions) ) {
- return NOERROR;
- }
- return E_FAIL;
- }
- else if (IID_IPersistPropertyBag == riid) {
- if( (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwOptionSetMask)
- && (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwEnabledOptions) ) {
- return NOERROR;
- }
- return E_FAIL;
- }
- return E_FAIL;
-};
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / ActiveX control
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef __GPAXPLUGIN_H_
-#define __GPAXPLUGIN_H_
-
-#define MAXLEN_URL 300
-
-#include "resource.h" // main symbols
-#include <atlctl.h>
-#include <SHLGUID.h>
-
-
-
-#include <gpac/terminal.h>
-#include <gpac/user.h>
-#include <gpac/config_file.h>
-#include <gpac/module.h>
-#include <gpac/options.h>
-
-#if (_MSC_VER >= 1300)
-using namespace ATL;
-#endif
-
-
-Bool GPAX_EventProc(void *ptr, GF_Event *evt);
-
-/////////////////////////////////////////////////////////////////////////////
-// CGPAXPlugin
-class ATL_NO_VTABLE CGPAXPlugin :
- public CComObjectRootEx<CComSingleThreadModel>,
- public IDispatchImpl<IGPAX, &IID_IGPAX, &LIBID_GPAXLib>,
- public CComControl<CGPAXPlugin>,
- public CComCoClass<CGPAXPlugin, &CLSID_GPAX>,
- public IOleControlImpl<CGPAXPlugin>,
- public IOleObjectImpl<CGPAXPlugin>,
- public IOleInPlaceActiveObjectImpl<CGPAXPlugin>,
- public IViewObjectExImpl<CGPAXPlugin>,
- public IOleInPlaceObjectWindowlessImpl<CGPAXPlugin>,
- public IProvideClassInfo2Impl<&CLSID_GPAX, &DIID_IGPAXEvents, &LIBID_GPAXLib>,
-
- public IPersistStreamInitImpl<CGPAXPlugin>,
- public ISupportErrorInfo,
- public IConnectionPointContainerImpl<CGPAXPlugin>,
- public IPersistStorageImpl<CGPAXPlugin>,
- public ISpecifyPropertyPagesImpl<CGPAXPlugin>,
- public IQuickActivateImpl<CGPAXPlugin>,
- public IDataObjectImpl<CGPAXPlugin>,
- public IPropertyNotifySinkCP<CGPAXPlugin>,
-
- public IPersistPropertyBagImpl<CGPAXPlugin>,
- public IObjectSafetyImpl<CGPAXPlugin, INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA>
-
-{
-public:
- CGPAXPlugin() {
- m_term = NULL;
- m_bAutoStart = GF_TRUE;
- m_bInitialDraw = GF_TRUE;
- m_bWindowOnly = GF_TRUE; //to declare that the control is a window control in order
- //to inherit the member variable m_hWnd which contains the window handler
- m_bIsConnected = GF_FALSE;
- m_bUse3D = GF_FALSE;
- m_bUseGUI = GF_FALSE;
- m_iDownload_progress = 0;
- m_AR = GF_ASPECT_RATIO_KEEP;
- m_url[0] = 0;
- m_pLogs = NULL;
-#ifndef _WIN32_WCE
- m_pBrowser = NULL;
-#endif
- memset(&m_user, 0, sizeof(m_user));
-
- m_dwCurrentSafety = INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA;
- }
-
- ~CGPAXPlugin();
-
- Bool EventProc(GF_Event *evt);
-
- BOOL PreTranslateMessage(MSG* pMsg);
-
- DECLARE_REGISTRY_RESOURCEID(IDR_GPAXPLUGIN)
- DECLARE_PROTECT_FINAL_CONSTRUCT()
-#if (_MSC_VER >= 1300)
- DECLARE_OLEMISC_STATUS(OLEMISC_ACTSLIKEBUTTON | OLEMISC_ACTIVATEWHENVISIBLE)
-#endif
-
- static LPCTSTR GetWindowClassName() {
- return TEXT("GPAC ActiveX");
- }
-
- BEGIN_COM_MAP(CGPAXPlugin)
- COM_INTERFACE_ENTRY(IGPAX)
- COM_INTERFACE_ENTRY(IDispatch)
- COM_INTERFACE_ENTRY(IViewObjectEx)
- COM_INTERFACE_ENTRY(IProvideClassInfo)
- COM_INTERFACE_ENTRY(IOleControl)
- COM_INTERFACE_ENTRY(IOleObject)
-
- COM_INTERFACE_ENTRY_IMPL(IViewObjectEx)
- COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject2, IViewObjectEx)
- COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject, IViewObjectEx)
- COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleWindow, IOleInPlaceObjectWindowless)
- COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless)
- COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleWindow, IOleInPlaceActiveObject)
-
- COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject)
- COM_INTERFACE_ENTRY_IMPL(IOleInPlaceObjectWindowless)
-
-// COM_INTERFACE_ENTRY(IObjectSafety)
- COM_INTERFACE_ENTRY_IID(IID_IObjectSafety, IObjectSafety)
- COM_INTERFACE_ENTRY(IPersistPropertyBag)
- COM_INTERFACE_ENTRY_IMPL_IID(IID_IPersist, IPersistPropertyBag)
-
- /* COM_INTERFACE_ENTRY(IViewObject)
- COM_INTERFACE_ENTRY(IViewObject2)
- COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
- COM_INTERFACE_ENTRY(IOleInPlaceObject)
- */
-
- COM_INTERFACE_ENTRY(IProvideClassInfo2)
- COM_INTERFACE_ENTRY(IPersistStreamInit)
- COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
- COM_INTERFACE_ENTRY(ISupportErrorInfo)
- COM_INTERFACE_ENTRY(IConnectionPointContainer)
- COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
- COM_INTERFACE_ENTRY(IQuickActivate)
- COM_INTERFACE_ENTRY(IPersistStorage)
- COM_INTERFACE_ENTRY(IDataObject)
-
- END_COM_MAP()
-
- BEGIN_PROP_MAP(CGPAXPlugin)
- END_PROP_MAP()
-
- BEGIN_CONNECTION_POINT_MAP(CGPAXPlugin)
- CONNECTION_POINT_ENTRY(IID_IPropertyNotifySink)
- END_CONNECTION_POINT_MAP()
-
- BEGIN_MSG_MAP(CGPAXPlugin)
- CHAIN_MSG_MAP(CComControl<CGPAXPlugin>)
- DEFAULT_REFLECTION_HANDLER()
- MESSAGE_HANDLER(WM_CREATE, OnCreate)
- MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
-
- END_MSG_MAP()
- // Handler prototypes:
- // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
- // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
-
-
-
- // ISupportsErrorInfo
- STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid)
- {
- static const IID* arr[] =
- {
- &IID_IGPAX,
- };
- for (int i=0; i<sizeof(arr)/sizeof(arr[0]); i++)
- {
-#if (_MSC_VER < 1300)
- if (::ATL::InlineIsEqualGUID(*arr[i], riid))
-#else
- if (::InlineIsEqualGUID(*arr[i], riid))
-#endif
- return S_OK;
- }
- return S_FALSE;
- }
- STDMETHODIMP GetInterfaceSafetyOptions(
- REFIID riid,
- DWORD *pdwSupportedOptions,
- DWORD *pdwEnabledOptions
- );
-
- STDMETHODIMP SetInterfaceSafetyOptions(
- REFIID riid,
- DWORD dwOptionSetMask,
- DWORD dwEnabledOptions
- );
-
- // IViewObjectEx
- DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE)
-
- // IGPAX
-public:
- //Interface methods
- STDMETHOD(Stop)();
- STDMETHOD(Pause)();
- STDMETHOD(Play)();
- STDMETHOD(Update)(BSTR mtype,BSTR updates);
- STDMETHOD(QualitySwitch)(int switch_up);
- STDMETHOD(SetURL)(BSTR url);
-
- //Interface properties
- STDMETHODIMP get_src(BSTR *url);
- STDMETHODIMP put_src(BSTR url);
- STDMETHODIMP get_AutoStart(VARIANT_BOOL *as);
- STDMETHODIMP put_AutoStart(VARIANT_BOOL as);
- STDMETHODIMP get_DownloadProgress(INT *dp);
- STDMETHODIMP put_DownloadProgress(INT dp);
-
- //Customed Window Message functions: OnCreate and OnDestroy are called when a window
- //is created or destroyed. OnDraw is to establish inital connection.
- HRESULT OnDraw(ATL_DRAWINFO& di);
- LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
-
- //IPersistPropertyBag method: to handle persist property packed and transfered by MSIE
- //in html doc, the ActiveX control is added by tags
- // <object CLSID=...>
- // <PARAM name="..." value="...">
- // </object>
- //the interface IPersistPropertyBag enable MSIE and ActiveX Control to communicate these
- //properties included in tags <PARAM>
- STDMETHODIMP Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog);
- STDMETHODIMP Save(LPPROPERTYBAG, BOOL, BOOL);
-
-
-private:
- Bool ReadParamString(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog, WCHAR *name, char *buf, int bufsize);
- void SetStatusText(char *msg);
- void UpdateURL();
- void UnloadTerm();
- void LoadDATAUrl();
-
- GF_Terminal *m_term;
- GF_User m_user;
- char m_url[MAXLEN_URL];
-#ifndef _WIN32_WCE
- /*pointer to the parent browser if any*/
- IWebBrowser2 *m_pBrowser;
-#endif
-
- u32 m_width, m_height, m_AR;
- Bool m_bIsConnected, m_bInitialDraw, m_bAutoStart, m_bUse3D, m_bLoop, m_bUseGUI;
- int m_iDownload_progress;
- FILE *m_pLogs;
-
-};
-
-
-
-#endif //__GPAXPLUGIN_H_
+++ /dev/null
-
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-
-/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
-
-/* link this file in with the server and any clients */
-
-
-/* File created by MIDL compiler version 5.03.0286 */
-/* at Thu Jul 20 19:14:15 2006
- */
-/* Compiler settings for \CVS\gpac\applications\GPAX\GPAX.idl:
- Oicf (OptLev=i2), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext
- error checks: allocation ref bounds_check enum stub_data
- VC __declspec() decoration level:
- __declspec(uuid()), __declspec(selectany), __declspec(novtable)
- DECLSPEC_UUID(), MIDL_INTERFACE()
-*/
-//@@MIDL_FILE_HEADING( )
-
-#if !defined(_M_IA64) && !defined(_M_AXP64)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#include <rpc.h>
-#include <rpcndr.h>
-
-#ifdef _MIDL_USE_GUIDDEF_
-
-#ifndef INITGUID
-#define INITGUID
-#include <guiddef.h>
-#undef INITGUID
-#else
-#include <guiddef.h>
-#endif
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
-
-#else // !_MIDL_USE_GUIDDEF_
-
-#ifndef __IID_DEFINED__
-#define __IID_DEFINED__
-
-typedef struct _IID
-{
- unsigned long x;
- unsigned short s1;
- unsigned short s2;
- unsigned char c[8];
-} IID;
-
-#endif // __IID_DEFINED__
-
-#ifndef CLSID_DEFINED
-#define CLSID_DEFINED
-typedef IID CLSID;
-#endif // CLSID_DEFINED
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-
-#endif !_MIDL_USE_GUIDDEF_
-
-MIDL_DEFINE_GUID(IID, LIBID_GPAXLib,0xE64FAC7F,0x0134,0x4A75,0xA7,0xDA,0x80,0xD5,0x3E,0xBC,0x56,0xA6);
-
-
-MIDL_DEFINE_GUID(IID, IID_IGPAX,0xE2A9A937,0xBB35,0x47E0,0x89,0x42,0x96,0x48,0x06,0x29,0x9A,0xB4);
-
-
-MIDL_DEFINE_GUID(IID, DIID_IGPAXEvents,0x1FDA32FC,0x4C9A,0x461F,0xB3,0x3B,0x07,0x15,0xB0,0x34,0x30,0x06);
-
-
-MIDL_DEFINE_GUID(CLSID, CLSID_GPAX,0x181D18E6,0x4DC1,0x4B55,0xB7,0x2E,0xBE,0x2A,0x10,0x06,0x49,0x95);
-
-#undef MIDL_DEFINE_GUID
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-#endif /* !defined(_M_IA64) && !defined(_M_AXP64)*/
-
-
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-
-/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
-
-/* link this file in with the server and any clients */
-
-
-/* File created by MIDL compiler version 5.03.0286 */
-/* at Thu Jul 20 19:14:15 2006
- */
-/* Compiler settings for \CVS\gpac\applications\GPAX\GPAX.idl:
- Oicf (OptLev=i2), W1, Zp8, env=Win64 (32b run,appending), ms_ext, c_ext, robust
- error checks: allocation ref bounds_check enum stub_data
- VC __declspec() decoration level:
- __declspec(uuid()), __declspec(selectany), __declspec(novtable)
- DECLSPEC_UUID(), MIDL_INTERFACE()
-*/
-//@@MIDL_FILE_HEADING( )
-
-#if defined(_M_IA64) || defined(_M_AXP64)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#include <rpc.h>
-#include <rpcndr.h>
-
-#ifdef _MIDL_USE_GUIDDEF_
-
-#ifndef INITGUID
-#define INITGUID
-#include <guiddef.h>
-#undef INITGUID
-#else
-#include <guiddef.h>
-#endif
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
-
-#else // !_MIDL_USE_GUIDDEF_
-
-#ifndef __IID_DEFINED__
-#define __IID_DEFINED__
-
-typedef struct _IID
-{
- unsigned long x;
- unsigned short s1;
- unsigned short s2;
- unsigned char c[8];
-} IID;
-
-#endif // __IID_DEFINED__
-
-#ifndef CLSID_DEFINED
-#define CLSID_DEFINED
-typedef IID CLSID;
-#endif // CLSID_DEFINED
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-
-#endif !_MIDL_USE_GUIDDEF_
-
-MIDL_DEFINE_GUID(IID, LIBID_GPAXLib,0xE64FAC7F,0x0134,0x4A75,0xA7,0xDA,0x80,0xD5,0x3E,0xBC,0x56,0xA6);
-
-
-MIDL_DEFINE_GUID(IID, IID_IGPAX,0xE2A9A937,0xBB35,0x47E0,0x89,0x42,0x96,0x48,0x06,0x29,0x9A,0xB4);
-
-
-MIDL_DEFINE_GUID(IID, DIID_IGPAXEvents,0x1FDA32FC,0x4C9A,0x461F,0xB3,0x3B,0x07,0x15,0xB0,0x34,0x30,0x06);
-
-
-MIDL_DEFINE_GUID(CLSID, CLSID_GPAX,0x181D18E6,0x4DC1,0x4B55,0xB7,0x2E,0xBE,0x2A,0x10,0x06,0x49,0x95);
-
-#undef MIDL_DEFINE_GUID
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-#endif /* defined(_M_IA64) || defined(_M_AXP64)*/
-
+++ /dev/null
-/* this ALWAYS GENERATED file contains the proxy stub code */
-
-
-/* File created by MIDL compiler version 5.01.0164 */
-/* at Mon Jul 17 15:58:48 2006
- */
-/* Compiler settings for D:\CVS\gpac\applications\GPAX\GPAX.idl:
- Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
- error checks: allocation ref bounds_check enum stub_data
-*/
-//@@MIDL_FILE_HEADING( )
-
-#define USE_STUBLESS_PROXY
-
-
-/* verify that the <rpcproxy.h> version is high enough to compile this file*/
-#ifndef __REDQ_RPCPROXY_H_VERSION__
-#define __REQUIRED_RPCPROXY_H_VERSION__ 440
-#endif
-
-
-#include "rpcproxy.h"
-#ifndef __RPCPROXY_H_VERSION__
-#error this stub requires an updated version of <rpcproxy.h>
-#endif // __RPCPROXY_H_VERSION__
-
-
-#include "GPAX.h"
-
-#define TYPE_FORMAT_STRING_SIZE 59
-#define PROC_FORMAT_STRING_SIZE 213
-
-typedef struct _MIDL_TYPE_FORMAT_STRING
-{
- short Pad;
- unsigned char Format[ TYPE_FORMAT_STRING_SIZE ];
-} MIDL_TYPE_FORMAT_STRING;
-
-typedef struct _MIDL_PROC_FORMAT_STRING
-{
- short Pad;
- unsigned char Format[ PROC_FORMAT_STRING_SIZE ];
-} MIDL_PROC_FORMAT_STRING;
-
-
-extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
-extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
-
-
-/* Standard interface: __MIDL_itf_GPAX_0000, ver. 0.0,
- GUID={0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} */
-
-
-/* Object interface: IUnknown, ver. 0.0,
- GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
-
-
-/* Object interface: IDispatch, ver. 0.0,
- GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
-
-
-/* Object interface: IGPAX, ver. 0.0,
- GUID={0xE2A9A937,0xBB35,0x47E0,{0x89,0x42,0x96,0x48,0x06,0x29,0x9A,0xB4}} */
-
-
-extern const MIDL_STUB_DESC Object_StubDesc;
-
-
-extern const MIDL_SERVER_INFO IGPAX_ServerInfo;
-
-#pragma code_seg(".orpc")
-extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1];
-
-static const MIDL_STUB_DESC Object_StubDesc =
-{
- 0,
- NdrOleAllocate,
- NdrOleFree,
- 0,
- 0,
- 0,
- 0,
- 0,
- __MIDL_TypeFormatString.Format,
- 1, /* -error bounds_check flag */
- 0x20000, /* Ndr library version */
- 0,
- 0x50100a4, /* MIDL Version 5.1.164 */
- 0,
- UserMarshalRoutines,
- 0, /* notify & notify_flag routine table */
- 1, /* Flags */
- 0, /* Reserved3 */
- 0, /* Reserved4 */
- 0 /* Reserved5 */
-};
-
-static const unsigned short IGPAX_FormatStringOffsetTable[] =
-{
- (unsigned short) -1,
- (unsigned short) -1,
- (unsigned short) -1,
- (unsigned short) -1,
- 0,
- 22,
- 44,
- 66,
- 100,
- 128,
- 156,
- 184
-};
-
-static const MIDL_SERVER_INFO IGPAX_ServerInfo =
-{
- &Object_StubDesc,
- 0,
- __MIDL_ProcFormatString.Format,
- &IGPAX_FormatStringOffsetTable[-3],
- 0,
- 0,
- 0,
- 0
-};
-
-static const MIDL_STUBLESS_PROXY_INFO IGPAX_ProxyInfo =
-{
- &Object_StubDesc,
- __MIDL_ProcFormatString.Format,
- &IGPAX_FormatStringOffsetTable[-3],
- 0,
- 0,
- 0
-};
-
-CINTERFACE_PROXY_VTABLE(15) _IGPAXProxyVtbl =
-{
- &IGPAX_ProxyInfo,
- &IID_IGPAX,
- IUnknown_QueryInterface_Proxy,
- IUnknown_AddRef_Proxy,
- IUnknown_Release_Proxy ,
- 0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
- 0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
- 0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
- 0 /* IDispatch_Invoke_Proxy */ ,
- (void *)-1 /* IGPAX::Play */ ,
- (void *)-1 /* IGPAX::Pause */ ,
- (void *)-1 /* IGPAX::Stop */ ,
- (void *)-1 /* IGPAX::Update */ ,
- (void *)-1 /* IGPAX::QualitySwitch */ ,
- (void *)-1 /* IGPAX::get_URL */ ,
- (void *)-1 /* IGPAX::put_URL */ ,
- (void *)-1 /* IGPAX::get_AutoStart */ ,
- (void *)-1 /* IGPAX::put_AutoStart */
-};
-
-
-static const PRPC_STUB_FUNCTION IGPAX_table[] =
-{
- STUB_FORWARDING_FUNCTION,
- STUB_FORWARDING_FUNCTION,
- STUB_FORWARDING_FUNCTION,
- STUB_FORWARDING_FUNCTION,
- NdrStubCall2,
- NdrStubCall2,
- NdrStubCall2,
- NdrStubCall2,
- NdrStubCall2,
- NdrStubCall2,
- NdrStubCall2,
- NdrStubCall2
-};
-
-CInterfaceStubVtbl _IGPAXStubVtbl =
-{
- &IID_IGPAX,
- &IGPAX_ServerInfo,
- 15,
- &IGPAX_table[-3],
- CStdStubBuffer_DELEGATING_METHODS
-};
-
-#pragma data_seg(".rdata")
-
-static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1] =
-{
-
- {
- BSTR_UserSize
- ,BSTR_UserMarshal
- ,BSTR_UserUnmarshal
- ,BSTR_UserFree
- }
-
-};
-
-
-#if !defined(__RPC_WIN32__)
-#error Invalid build platform for this stub.
-#endif
-
-#if !(TARGET_IS_NT40_OR_LATER)
-#error You need a Windows NT 4.0 or later to run this stub because it uses these features:
-#error -Oif or -Oicf, [wire_marshal] or [user_marshal] attribute, more than 32 methods in the interface.
-#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
-#error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
-#endif
-
-
-static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
-{
- 0,
- {
-
- /* Procedure Play */
-
- 0x33, /* FC_AUTO_HANDLE */
- 0x6c, /* Old Flags: object, Oi2 */
- /* 2 */ NdrFcLong( 0x0 ), /* 0 */
- /* 6 */ NdrFcShort( 0x7 ), /* 7 */
-#ifndef _ALPHA_
- /* 8 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
-#else
- NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
-#endif
- /* 10 */ NdrFcShort( 0x0 ), /* 0 */
- /* 12 */ NdrFcShort( 0x8 ), /* 8 */
- /* 14 */ 0x4, /* Oi2 Flags: has return, */
- 0x1, /* 1 */
-
- /* Return value */
-
- /* 16 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
-#ifndef _ALPHA_
- /* 18 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
-#else
- NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
-#endif
- /* 20 */ 0x8, /* FC_LONG */
- 0x0, /* 0 */
-
- /* Procedure Pause */
-
- /* 22 */ 0x33, /* FC_AUTO_HANDLE */
- 0x6c, /* Old Flags: object, Oi2 */
- /* 24 */ NdrFcLong( 0x0 ), /* 0 */
- /* 28 */ NdrFcShort( 0x8 ), /* 8 */
-#ifndef _ALPHA_
- /* 30 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
-#else
- NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
-#endif
- /* 32 */ NdrFcShort( 0x0 ), /* 0 */
- /* 34 */ NdrFcShort( 0x8 ), /* 8 */
- /* 36 */ 0x4, /* Oi2 Flags: has return, */
- 0x1, /* 1 */
-
- /* Return value */
-
- /* 38 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
-#ifndef _ALPHA_
- /* 40 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
-#else
- NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
-#endif
- /* 42 */ 0x8, /* FC_LONG */
- 0x0, /* 0 */
-
- /* Procedure Stop */
-
- /* 44 */ 0x33, /* FC_AUTO_HANDLE */
- 0x6c, /* Old Flags: object, Oi2 */
- /* 46 */ NdrFcLong( 0x0 ), /* 0 */
- /* 50 */ NdrFcShort( 0x9 ), /* 9 */
-#ifndef _ALPHA_
- /* 52 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
-#else
- NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
-#endif
- /* 54 */ NdrFcShort( 0x0 ), /* 0 */
- /* 56 */ NdrFcShort( 0x8 ), /* 8 */
- /* 58 */ 0x4, /* Oi2 Flags: has return, */
- 0x1, /* 1 */
-
- /* Return value */
-
- /* 60 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
-#ifndef _ALPHA_
- /* 62 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
-#else
- NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
-#endif
- /* 64 */ 0x8, /* FC_LONG */
- 0x0, /* 0 */
-
- /* Procedure Update */
-
- /* 66 */ 0x33, /* FC_AUTO_HANDLE */
- 0x6c, /* Old Flags: object, Oi2 */
- /* 68 */ NdrFcLong( 0x0 ), /* 0 */
- /* 72 */ NdrFcShort( 0xa ), /* 10 */
-#ifndef _ALPHA_
- /* 74 */ NdrFcShort( 0x10 ), /* x86, MIPS, PPC Stack size/offset = 16 */
-#else
- NdrFcShort( 0x20 ), /* Alpha Stack size/offset = 32 */
-#endif
- /* 76 */ NdrFcShort( 0x0 ), /* 0 */
- /* 78 */ NdrFcShort( 0x8 ), /* 8 */
- /* 80 */ 0x6, /* Oi2 Flags: clt must size, has return, */
- 0x3, /* 3 */
-
- /* Parameter mtype */
-
- /* 82 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */
-#ifndef _ALPHA_
- /* 84 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
-#else
- NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
-#endif
- /* 86 */ NdrFcShort( 0x1a ), /* Type Offset=26 */
-
- /* Parameter updates */
-
- /* 88 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */
-#ifndef _ALPHA_
- /* 90 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
-#else
- NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
-#endif
- /* 92 */ NdrFcShort( 0x1a ), /* Type Offset=26 */
-
- /* Return value */
-
- /* 94 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
-#ifndef _ALPHA_
- /* 96 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */
-#else
- NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
-#endif
- /* 98 */ 0x8, /* FC_LONG */
- 0x0, /* 0 */
-
- /* Procedure get_URL */
-
- /* 100 */ 0x33, /* FC_AUTO_HANDLE */
- 0x6c, /* Old Flags: object, Oi2 */
- /* 102 */ NdrFcLong( 0x0 ), /* 0 */
- /* 106 */ NdrFcShort( 0xb ), /* 11 */
-#ifndef _ALPHA_
- /* 108 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */
-#else
- NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
-#endif
- /* 110 */ NdrFcShort( 0x0 ), /* 0 */
- /* 112 */ NdrFcShort( 0x8 ), /* 8 */
- /* 114 */ 0x5, /* Oi2 Flags: srv must size, has return, */
- 0x2, /* 2 */
-
- /* Parameter mrl */
-
- /* 116 */ NdrFcShort( 0x2113 ), /* Flags: must size, must free, out, simple ref, srv alloc size=8 */
-#ifndef _ALPHA_
- /* 118 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
-#else
- NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
-#endif
- /* 120 */ NdrFcShort( 0x2c ), /* Type Offset=44 */
-
- /* Return value */
-
- /* 122 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
-#ifndef _ALPHA_
- /* 124 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
-#else
- NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
-#endif
- /* 126 */ 0x8, /* FC_LONG */
- 0x0, /* 0 */
-
- /* Procedure put_URL */
-
- /* 128 */ 0x33, /* FC_AUTO_HANDLE */
- 0x6c, /* Old Flags: object, Oi2 */
- /* 130 */ NdrFcLong( 0x0 ), /* 0 */
- /* 134 */ NdrFcShort( 0xc ), /* 12 */
-#ifndef _ALPHA_
- /* 136 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */
-#else
- NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
-#endif
- /* 138 */ NdrFcShort( 0x0 ), /* 0 */
- /* 140 */ NdrFcShort( 0x8 ), /* 8 */
- /* 142 */ 0x6, /* Oi2 Flags: clt must size, has return, */
- 0x2, /* 2 */
-
- /* Parameter mrl */
-
- /* 144 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */
-#ifndef _ALPHA_
- /* 146 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
-#else
- NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
-#endif
- /* 148 */ NdrFcShort( 0x1a ), /* Type Offset=26 */
-
- /* Return value */
-
- /* 150 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
-#ifndef _ALPHA_
- /* 152 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
-#else
- NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
-#endif
- /* 154 */ 0x8, /* FC_LONG */
- 0x0, /* 0 */
-
- /* Procedure get_AutoStart */
-
- /* 156 */ 0x33, /* FC_AUTO_HANDLE */
- 0x6c, /* Old Flags: object, Oi2 */
- /* 158 */ NdrFcLong( 0x0 ), /* 0 */
- /* 162 */ NdrFcShort( 0xd ), /* 13 */
-#ifndef _ALPHA_
- /* 164 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */
-#else
- NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
-#endif
- /* 166 */ NdrFcShort( 0x0 ), /* 0 */
- /* 168 */ NdrFcShort( 0xe ), /* 14 */
- /* 170 */ 0x4, /* Oi2 Flags: has return, */
- 0x2, /* 2 */
-
- /* Parameter autoplay */
-
- /* 172 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */
-#ifndef _ALPHA_
- /* 174 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
-#else
- NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
-#endif
- /* 176 */ 0x6, /* FC_SHORT */
- 0x0, /* 0 */
-
- /* Return value */
-
- /* 178 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
-#ifndef _ALPHA_
- /* 180 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
-#else
- NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
-#endif
- /* 182 */ 0x8, /* FC_LONG */
- 0x0, /* 0 */
-
- /* Procedure put_AutoStart */
-
- /* 184 */ 0x33, /* FC_AUTO_HANDLE */
- 0x6c, /* Old Flags: object, Oi2 */
- /* 186 */ NdrFcLong( 0x0 ), /* 0 */
- /* 190 */ NdrFcShort( 0xe ), /* 14 */
-#ifndef _ALPHA_
- /* 192 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */
-#else
- NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
-#endif
- /* 194 */ NdrFcShort( 0x6 ), /* 6 */
- /* 196 */ NdrFcShort( 0x8 ), /* 8 */
- /* 198 */ 0x4, /* Oi2 Flags: has return, */
- 0x2, /* 2 */
-
- /* Parameter autoplay */
-
- /* 200 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */
-#ifndef _ALPHA_
- /* 202 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
-#else
- NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
-#endif
- /* 204 */ 0x6, /* FC_SHORT */
- 0x0, /* 0 */
-
- /* Return value */
-
- /* 206 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
-#ifndef _ALPHA_
- /* 208 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
-#else
- NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
-#endif
- /* 210 */ 0x8, /* FC_LONG */
- 0x0, /* 0 */
-
- 0x0
- }
-};
-
-static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
-{
- 0,
- {
- NdrFcShort( 0x0 ), /* 0 */
- /* 2 */
- 0x12, 0x0, /* FC_UP */
- /* 4 */ NdrFcShort( 0xc ), /* Offset= 12 (16) */
- /* 6 */
- 0x1b, /* FC_CARRAY */
- 0x1, /* 1 */
- /* 8 */ NdrFcShort( 0x2 ), /* 2 */
- /* 10 */ 0x9, /* Corr desc: FC_ULONG */
- 0x0, /* */
- /* 12 */ NdrFcShort( 0xfffc ), /* -4 */
- /* 14 */ 0x6, /* FC_SHORT */
- 0x5b, /* FC_END */
- /* 16 */
- 0x17, /* FC_CSTRUCT */
- 0x3, /* 3 */
- /* 18 */ NdrFcShort( 0x8 ), /* 8 */
- /* 20 */ NdrFcShort( 0xfffffff2 ), /* Offset= -14 (6) */
- /* 22 */ 0x8, /* FC_LONG */
- 0x8, /* FC_LONG */
- /* 24 */ 0x5c, /* FC_PAD */
- 0x5b, /* FC_END */
- /* 26 */ 0xb4, /* FC_USER_MARSHAL */
- 0x83, /* 131 */
- /* 28 */ NdrFcShort( 0x0 ), /* 0 */
- /* 30 */ NdrFcShort( 0x4 ), /* 4 */
- /* 32 */ NdrFcShort( 0x0 ), /* 0 */
- /* 34 */ NdrFcShort( 0xffffffe0 ), /* Offset= -32 (2) */
- /* 36 */
- 0x11, 0x4, /* FC_RP [alloced_on_stack] */
- /* 38 */ NdrFcShort( 0x6 ), /* Offset= 6 (44) */
- /* 40 */
- 0x13, 0x0, /* FC_OP */
- /* 42 */ NdrFcShort( 0xffffffe6 ), /* Offset= -26 (16) */
- /* 44 */ 0xb4, /* FC_USER_MARSHAL */
- 0x83, /* 131 */
- /* 46 */ NdrFcShort( 0x0 ), /* 0 */
- /* 48 */ NdrFcShort( 0x4 ), /* 4 */
- /* 50 */ NdrFcShort( 0x0 ), /* 0 */
- /* 52 */ NdrFcShort( 0xfffffff4 ), /* Offset= -12 (40) */
- /* 54 */
- 0x11, 0xc, /* FC_RP [alloced_on_stack] [simple_pointer] */
- /* 56 */ 0x6, /* FC_SHORT */
- 0x5c, /* FC_PAD */
-
- 0x0
- }
-};
-
-const CInterfaceProxyVtbl * _GPAX_ProxyVtblList[] =
-{
- ( CInterfaceProxyVtbl *) &_IGPAXProxyVtbl,
- 0
-};
-
-const CInterfaceStubVtbl * _GPAX_StubVtblList[] =
-{
- ( CInterfaceStubVtbl *) &_IGPAXStubVtbl,
- 0
-};
-
-PCInterfaceName const _GPAX_InterfaceNamesList[] =
-{
- "IGPAX",
- 0
-};
-
-const IID * _GPAX_BaseIIDList[] =
-{
- &IID_IDispatch,
- 0
-};
-
-
-#define _GPAX_CHECK_IID(n) IID_GENERIC_CHECK_IID( _GPAX, pIID, n)
-
-int __stdcall _GPAX_IID_Lookup( const IID * pIID, int * pIndex )
-{
-
- if(!_GPAX_CHECK_IID(0))
- {
- *pIndex = 0;
- return 1;
- }
-
- return 0;
-}
-
-const ExtendedProxyFileInfo GPAX_ProxyFileInfo =
-{
- (PCInterfaceProxyVtblList *) & _GPAX_ProxyVtblList,
- (PCInterfaceStubVtblList *) & _GPAX_StubVtblList,
- (const PCInterfaceName * ) & _GPAX_InterfaceNamesList,
- (const IID ** ) & _GPAX_BaseIIDList,
- & _GPAX_IID_Lookup,
- 1,
- 2,
- 0, /* table of [async_uuid] interfaces */
- 0, /* Filler1 */
- 0, /* Filler2 */
- 0 /* Filler3 */
-};
+++ /dev/null
-
-LIBRARY "GPAXPS"
-
-DESCRIPTION 'Proxy/Stub DLL'
-
-EXPORTS
- DllGetClassObject @1 PRIVATE
- DllCanUnloadNow @2 PRIVATE
- GetProxyDllInfo @3 PRIVATE
- DllRegisterServer @4 PRIVATE
- DllUnregisterServer @5 PRIVATE
+++ /dev/null
-
-GPAXps.dll: dlldata.obj GPAX_p.obj GPAX_i.obj
- link /dll /out:GPAXps.dll /def:GPAXps.def /entry:DllMain dlldata.obj GPAX_p.obj GPAX_i.obj \
- kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \
-
-.c.obj:
- cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \
- $<
-
-clean:
- @del GPAXps.dll
- @del GPAXps.lib
- @del GPAXps.exp
- @del dlldata.obj
- @del GPAX_p.obj
- @del GPAX_i.obj
+++ /dev/null
-// stdafx.cpp : source file that includes just the standard includes
-// stdafx.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-#ifdef _ATL_STATIC_REGISTRY
-#include <statreg.h>
-#include <statreg.cpp>
-#endif
-
-#include <atlimpl.cpp>
+++ /dev/null
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
-#if !defined(AFX_STDAFX_H__2CD656F1_059C_4EC4_9EAA_8FECF66BB748__INCLUDED_)
-#define AFX_STDAFX_H__2CD656F1_059C_4EC4_9EAA_8FECF66BB748__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#define STRICT
-
-#ifndef _WIN32_WCE
-
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#define _ATL_APARTMENT_THREADED
-
-#endif //_WIN32_WCE
-
-
-#include <atlbase.h>
-//You may derive a class from CComModule and use it if you want to override
-//something, but do not change the name of _Module
-extern CComModule _Module;
-#include <atlcom.h>
-#include <atlctl.h>
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__2CD656F1_059C_4EC4_9EAA_8FECF66BB748__INCLUDED)
+++ /dev/null
-/*********************************************************
- DllData file -- generated by MIDL compiler
-
- DO NOT ALTER THIS FILE
-
- This file is regenerated by MIDL on every IDL file compile.
-
- To completely reconstruct this file, delete it and rerun MIDL
- on all the IDL files in this DLL, specifying this file for the
- /dlldata command line option
-
-*********************************************************/
-
-#define PROXY_DELEGATION
-
-#include <rpcproxy.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EXTERN_PROXY_FILE( GPAX )
-
-
-PROXYFILE_LIST_START
-/* Start of list */
-REFERENCE_PROXY_FILE( GPAX ),
- /* End of list */
- PROXYFILE_LIST_END
-
-
- DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
-
-#ifdef __cplusplus
-} /*extern "C" */
-#endif
-
-/* end of generated dlldata file */
+++ /dev/null
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by GPAX.rc
-//
-#define IDS_PROJNAME 100
-#define IDB_GPAXPLUGIN 101
-#define IDR_GPAXPLUGIN 102
-#define IDS_TITLEGPAXProp 103
-#define IDS_HELPFILEGPAXProp 104
-#define IDS_DOCSTRINGGPAXProp 105
-#define IDR_GPAXPROP 106
-#define IDD_GPAXPROP 107
-#define IDC_EDIT_URLs 201
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 202
-#define _APS_NEXT_COMMAND_VALUE 32768
-#define _APS_NEXT_CONTROL_VALUE 202
-#define _APS_NEXT_SYMED_VALUE 108
-#endif
-#endif
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/dashcast
-
-CFLAGS= $(OPTFLAGS) -D_GNU_SOURCE -Wno-deprecated-declarations -I"$(SRC_PATH)/include" -I../../ $(ffmpeg_cflags)
-
-LINKFLAGS=$(GPAC_SH_FLAGS)
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-ifeq ($(GPACREADONLY),yes)
-CFLAGS+=-DGPAC_READ_ONLY
-endif
-
-ifneq ($(CONFIG_LIBAV),no)
-CFLAGS+=-DGPAC_USE_LIBAV
-endif
-
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=DashCast$(EXE)
-else
-EXT=
-PROG=DashCast
-endif
-
-
-ifeq ($(STATICBUILD),yes)
-##include static modules and other deps for libgpac
-include ../../static.mak
-LINKFLAGS+=-lgpac_static
-LINKFLAGS+= $(GPAC_SH_FLAGS)
-LINKFLAGS+=$(EXTRALIBS)
-else
-LINKFLAGS+=-lgpac
-endif
-
-#common obj
-OBJS= dashcast.o audio_data.o audio_decoder.o audio_encoder.o audio_muxer.o circular_buffer.o cmd_data.o controler.o message_queue.o register.o video_data.o video_decoder.o video_encoder.o video_muxer.o video_scaler.o task.o
-
-LINKFLAGS+= $(ffmpeg_lflags_dashcast)
-
-ifneq ($(CONFIG_LIBSWRESAMPLE),no)
-CFLAGS+=-DDC_AUDIO_RESAMPLER
-LINKFLAGS+=-lswresample
-endif
-
-ifeq ($(CONFIG_DARWIN),yes)
-#fixme - use proper detection of libavdevice dependencies
-#LINKFLAGS+=-lavfilter -lswresample -lbz2
-endif
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-DashCast$(EXE): $(OBJS)
- $(CC) -o ../../bin/gcc/$@ $(OBJS) -L../../bin/gcc $(LDFLAGS) $(LINKFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(PROG)
-
-install: clean
- install -m 755 $(INSTFLAGS) ../../bin/gcc/DashCast "$(DESTDIR)$(prefix)/bin"
-
-uninstall:
- rm -rf $(DESTDIR)$(prefix)/bin/DashCast
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "audio_data.h"
-
-
-void dc_audio_data_set_default(AudioDataConf *audio_data_conf)
-{
- strcpy(audio_data_conf->filename, "");
- strcpy(audio_data_conf->format, "");
- strcpy(audio_data_conf->codec, "");
- audio_data_conf->bitrate = -1;
- audio_data_conf->channels= -1;
- audio_data_conf->samplerate = -1;
-}
-
-void dc_audio_data_init(AudioDataConf *audio_data_conf, char *filename, char *format)
-{
- if (filename != NULL && strlen(filename) > 0)
- strcpy(audio_data_conf->filename, filename);
- else
- strcpy(audio_data_conf->filename, "");
-
- if (format != NULL && strlen(format) > 0)
- strcpy(audio_data_conf->format, format);
- else
- strcpy(audio_data_conf->format, "");
-}
-
-int dc_audio_input_data_init(AudioInputData *audio_input_data, int channels, int samplerate, int num_consumers, int mode)
-{
- int i;
-
- dc_producer_init(&audio_input_data->producer, AUDIO_CB_SIZE, "audio decoder");
- dc_circular_buffer_create(&audio_input_data->circular_buf, AUDIO_CB_SIZE, mode, num_consumers);
-
- for (i = 0; i < AUDIO_CB_SIZE; i++) {
- AudioDataNode *audio_data_node = (AudioDataNode*)gf_malloc(sizeof(AudioDataNode));
- audio_input_data->circular_buf.list[i].data = (void *) audio_data_node;
-
- audio_data_node->abuf_size = MAX_AUDIO_PACKET_SIZE;
- audio_data_node->abuf = (uint8_t*)gf_malloc(audio_data_node->abuf_size * sizeof(uint8_t));
- }
-
- audio_input_data->aframe = FF_ALLOC_FRAME();
- if (audio_input_data->aframe == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot initialize AudioInputData"));
- return -1;
- }
-
- audio_input_data->channels = channels;
- audio_input_data->samplerate = samplerate;
-
- return 0;
-}
-
-void dc_audio_input_data_destroy(AudioInputData *audio_input_data)
-{
- int i;
- if (audio_input_data->circular_buf.list) {
- for (i = 0; i < AUDIO_CB_SIZE; i++) {
- AudioDataNode *audio_data_node = (AudioDataNode*)audio_input_data->circular_buf.list[i].data;
- gf_free(audio_data_node->abuf);
- gf_free(audio_data_node);
- }
- }
-
- dc_circular_buffer_destroy(&audio_input_data->circular_buf);
-}
-
-void dc_audio_inout_data_end_signal(AudioInputData *audio_input_data)
-{
- dc_producer_end_signal(&audio_input_data->producer, &audio_input_data->circular_buf);
- dc_producer_end_signal_previous(&audio_input_data->producer, &audio_input_data->circular_buf);
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef AUDIO_DATA_H_
-#define AUDIO_DATA_H_
-
-#define AUDIO_CB_SIZE 3
-
-#define LIVE_FRAME_SIZE 1024
-#define MAX_AUDIO_PACKET_SIZE (128 * 1024)
-
-
-#include "../../modules/ffmpeg_in/ffmpeg_in.h"
-#include "libavcodec/avcodec.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/mem.h"
-#include "libav_compat.h"
-#include "circular_buffer.h"
-
-#include <time.h>
-
-//we force the number of channels between the decoder and the encoder: interleaved 16 bits stereo 44100Hz
-#define DC_AUDIO_SAMPLE_RATE 44100
-#define DC_AUDIO_NUM_CHANNELS 2
-#define DC_AUDIO_CHANNEL_LAYOUT AV_CH_LAYOUT_STEREO
-#define DC_AUDIO_SAMPLE_FORMAT AV_SAMPLE_FMT_S16
-
-#define DC_AUDIO_MAX_CHUNCK_SIZE 192000
-
-
-/*
- * AudioInputData is designed to keep the data of input audio in a circular buffer.
- * The circular buffer has its own mechanism for synchronization.
- */
-typedef struct {
- /* The circular buffer of input audio. Input audio is the audio frames after decoding. */
- CircularBuffer circular_buf;
-
- /* The user of circular buffer has an index to it, which is in this variable. */
- Producer producer;
-
- AVFrame *aframe;
-
- int64_t next_pts;
-
- int channels;
- int samplerate;
-} AudioInputData;
-
-/*
- * This structure corresponds to an entry of audio configuration in the configuration file
- */
-typedef struct {
- /* audio file name */
- char filename[GF_MAX_PATH];
- /* audio format */
- char format[GF_MAX_PATH];
- /* audio bitrate */
- int bitrate;
- /* audio samplerate */
- int samplerate;
- /* audio channel number */
- int channels;
- /* audio codec */
- char codec[GF_MAX_PATH];
- /* custom parameter to be passed directly to the encoder - free it once you're done */
- char custom[GF_MAX_PATH];
-
- /* used for source switching */
- char source_id[GF_MAX_PATH];
- time_t start_time;
- time_t end_time;
-
- /* RFC6381 codec name, only valid when VIDEO_MUXER == GPAC_INIT_VIDEO_MUXER_AVC1 */
- char codec6381[RFC6381_CODEC_NAME_SIZE_MAX];
-} AudioDataConf;
-
-/*
- * Each node in a circular buffer is a pointer.
- * To use the circular buffer for audio frame we must
- * define the node. AudioDataNode simply contains
- * an AVFrame.
- */
-typedef struct {
- uint8_t *abuf;
- int abuf_size;
- uint64_t channel_layout;
- int sample_rate;
- int format;
- int channels;
-} AudioDataNode;
-
-void dc_audio_data_set_default(AudioDataConf *audio_data_conf);
-
-/*
- * Initialize an AudioInputData.
- *
- * @param audio_input_data [out] is the structure to be initialize.
- * @param num_consumers [in] contains information on the number of users of circular buffer;
- * which means the number of audio encoders.
- * @param live [in] indicates the system is live
- *
- * @return 0 on success, -1 on failure.
- *
- * @note Must use dc_audio_data_destroy to free memory.
- */
-int dc_audio_input_data_init(AudioInputData *audio_input_data, int channels, int samplerate, int num_consumers, int mode);
-
-/*
- * Destroy an AudioInputData
- *
- * @param audio_input_data [in] the structure to be destroyed.
- */
-void dc_audio_input_data_destroy(AudioInputData *audio_input_data);
-
-/*
- * Signal to all the users of the circular buffer in the AudioInputData
- * which the current node is the last node to consume.
- *
- * @param audio_input_data [in] the structure to be signaled on.
- */
-void dc_audio_inout_data_end_signal(AudioInputData *audio_input_data);
-
-#endif /* AUDIO_DATA_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "audio_decoder.h"
-
-int dc_audio_decoder_open(AudioInputFile *audio_input_file, AudioDataConf *audio_data_conf, int mode, int no_loop, int video_framerate)
-{
- u32 i;
- AVCodecContext *codec_ctx;
- AVCodec *codec;
- AVInputFormat *in_fmt = NULL;
-
- if (!audio_data_conf) return -1;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Audio Decoder enter setup at UTC "LLU"\n", gf_net_get_utc() ));
-
- if (strcmp(audio_data_conf->format,"") != 0) {
- in_fmt = av_find_input_format(audio_data_conf->format);
- if (in_fmt == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot find the format %s.\n", audio_data_conf->format));
- return -1;
- }
- }
-
- /*
- * Open audio (may already be opened when shared with the video input).
- */
- if (!audio_input_file->av_fmt_ctx) {
- s32 ret;
- AVDictionary *options = NULL;
- //we may need to set the framerate when the default one used by ffmpeg is not supported
- if (video_framerate > 0) {
- char vfr[16];
- snprintf(vfr, sizeof(vfr), "%d", video_framerate);
- ret = av_dict_set(&options, "framerate", vfr, 0);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not set video framerate %s.\n", vfr));
- return -1;
- }
- }
-
- ret = avformat_open_input(&audio_input_file->av_fmt_ctx, audio_data_conf->filename, in_fmt, options ? &options : NULL);
-
- if (ret != 0) {
- if (options) {
- av_dict_free(&options);
- options = NULL;
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error %d opening input - retrying without options\n", ret));
- ret = avformat_open_input(&audio_input_file->av_fmt_ctx, audio_data_conf->filename, in_fmt, NULL);
- }
-
- if (ret != 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open file: %s\n", audio_data_conf->filename));
- return -1;
- }
- }
-
- if (options) av_dict_free(&options);
-
- /*
- * Retrieve stream information
- */
- if (avformat_find_stream_info(audio_input_file->av_fmt_ctx, NULL) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot find stream information\n"));
- return -1;
- }
-
- av_dump_format(audio_input_file->av_fmt_ctx, 0, audio_data_conf->filename, 0);
- }
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Audio capture open at UTC "LLU"\n", gf_net_get_utc() ));
-
- /*
- * Find the first audio stream
- */
- audio_input_file->astream_idx = -1;
- for (i=0; i<audio_input_file->av_fmt_ctx->nb_streams; i++) {
- if (audio_input_file->av_fmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
- audio_input_file->astream_idx = i;
- break;
- }
- }
- if (audio_input_file->astream_idx == -1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot find a audio stream\n"));
- return -1;
- }
-
- /*
- * Get a pointer to the codec context for the audio stream
- */
- codec_ctx = audio_input_file->av_fmt_ctx->streams[audio_input_file->astream_idx]->codec;
-
- /*
- * Find the decoder for the audio stream
- */
- codec = avcodec_find_decoder(codec_ctx->codec_id);
- if (codec == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Input audio codec is not supported.\n"));
- avformat_close_input(&audio_input_file->av_fmt_ctx);
- return -1;
- }
-
- /*
- * Open codec
- */
- if (avcodec_open2(codec_ctx, codec, NULL) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open input audio codec.\n"));
- avformat_close_input(&audio_input_file->av_fmt_ctx);
- return -1;
- }
-
-#ifdef DC_AUDIO_RESAMPLER
- audio_input_file->aresampler = NULL;
-#endif
- audio_input_file->fifo = av_fifo_alloc(2 * MAX_AUDIO_PACKET_SIZE);
-
- audio_data_conf->channels = codec_ctx->channels;
- audio_data_conf->samplerate = codec_ctx->sample_rate;
-
- audio_input_file->mode = mode;
- audio_input_file->no_loop = no_loop;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Audio Decoder open at UTC "LLU"\n", gf_net_get_utc() ));
-
- return 0;
-}
-
-#ifdef DC_AUDIO_RESAMPLER
-static int ensure_resampler(AudioInputFile *audio_input_file, int sample_rate, int num_channels, u64 channel_layout, enum AVSampleFormat sample_format)
-{
- if (!audio_input_file->aresampler) {
- audio_input_file->aresampler = swr_alloc();
- if (!audio_input_file->aresampler) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot allocate the audio resampler. Aborting.\n"));
- return -1;
- }
- av_opt_set_channel_layout(audio_input_file->aresampler, "in_channel_layout", channel_layout, 0);
- av_opt_set_channel_layout(audio_input_file->aresampler, "out_channel_layout", DC_AUDIO_CHANNEL_LAYOUT, 0);
- av_opt_set_sample_fmt(audio_input_file->aresampler, "in_sample_fmt", sample_format, 0);
- av_opt_set_sample_fmt(audio_input_file->aresampler, "out_sample_fmt", DC_AUDIO_SAMPLE_FORMAT, 0);
- av_opt_set_int(audio_input_file->aresampler, "in_sample_rate", sample_rate, 0);
- av_opt_set_int(audio_input_file->aresampler, "out_sample_rate", DC_AUDIO_SAMPLE_RATE, 0);
- av_opt_set_int(audio_input_file->aresampler, "in_channels", num_channels, 0);
- av_opt_set_int(audio_input_file->aresampler, "out_channels", DC_AUDIO_NUM_CHANNELS, 0);
-
- if (swr_init(audio_input_file->aresampler)) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not open the audio resampler. Aborting.\n"));
- return -1;
- }
- }
-
- return 0;
-}
-
-//resample - see http://ffmpeg.org/pipermail/libav-user/2012-June/002164.html
-static int resample_audio(AudioInputFile *audio_input_file, AudioInputData *audio_input_data, AVCodecContext *audio_codec_ctx, uint8_t ***output, int *num_planes_out, int num_channels, enum AVSampleFormat sample_format)
-{
- int i;
- *num_planes_out = av_sample_fmt_is_planar(DC_AUDIO_SAMPLE_FORMAT) ? DC_AUDIO_NUM_CHANNELS : 1;
- *output = (uint8_t**)av_malloc(*num_planes_out*sizeof(uint8_t*));
- for (i=0; i<*num_planes_out; i++) {
- (*output) [i] = (uint8_t*)av_malloc(DC_AUDIO_MAX_CHUNCK_SIZE); //FIXME: fix using size below av_samples_get_buffer_size()
- }
-
- i = swr_convert(audio_input_file->aresampler, *output, audio_input_data->aframe->nb_samples, (const uint8_t **)audio_input_data->aframe->extended_data, audio_input_data->aframe->nb_samples);
- if (i < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not resample audio frame. Aborting.\n"));
- return -1;
- }
-
- return i;
-}
-#endif
-
-int dc_audio_decoder_read(AudioInputFile *audio_input_file, AudioInputData *audio_input_data)
-{
- int ret;
- AVPacket packet;
- int got_frame = 0;
- AVCodecContext *codec_ctx;
- AudioDataNode *audio_data_node;
-
- /* Get a pointer to the codec context for the audio stream */
- codec_ctx = audio_input_file->av_fmt_ctx->streams[audio_input_file->astream_idx]->codec;
-
- /* Read frames */
- while (1) {
- if (audio_input_file->av_pkt_list) {
- if (gf_list_count(audio_input_file->av_pkt_list)) {
- AVPacket *packet_copy;
- assert(audio_input_file->av_pkt_list);
- gf_mx_p(audio_input_file->av_pkt_list_mutex);
- packet_copy = (AVPacket*)gf_list_pop_front(audio_input_file->av_pkt_list);
- gf_mx_v(audio_input_file->av_pkt_list_mutex);
-
- if (packet_copy == NULL) {
- ret = AVERROR_EOF;
- } else {
- memcpy(&packet, packet_copy, sizeof(AVPacket));
- gf_free(packet_copy);
- ret = 0;
- }
- } else {
- gf_sleep(1);
- continue;
- }
- } else {
- ret = av_read_frame(audio_input_file->av_fmt_ctx, &packet);
- }
- if (ret == AVERROR_EOF) {
- if (audio_input_file->mode == LIVE_MEDIA && audio_input_file->no_loop == 0) {
- av_seek_frame(audio_input_file->av_fmt_ctx, audio_input_file->astream_idx, 0, 0);
- continue;
- }
-
- /* Flush decoder */
- packet.data = NULL;
- packet.size = 0;
-
-#ifndef FF_API_AVFRAME_LAVC
- avcodec_get_frame_defaults(audio_input_data->aframe);
-#else
- av_frame_unref(audio_input_data->aframe);
-#endif
-
- avcodec_decode_audio4(codec_ctx, audio_input_data->aframe, &got_frame, &packet);
-
- if (got_frame) {
- dc_producer_lock(&audio_input_data->producer, &audio_input_data->circular_buf);
- dc_producer_unlock_previous(&audio_input_data->producer, &audio_input_data->circular_buf);
- audio_data_node = (AudioDataNode*)dc_producer_produce(&audio_input_data->producer, &audio_input_data->circular_buf);
-
- audio_data_node->abuf_size = audio_input_data->aframe->linesize[0];
- memcpy(audio_data_node->abuf, audio_input_data->aframe->data[0], audio_data_node->abuf_size);
-
- dc_producer_advance(&audio_input_data->producer, &audio_input_data->circular_buf);
- return 0;
- }
-
- dc_producer_end_signal(&audio_input_data->producer, &audio_input_data->circular_buf);
- dc_producer_unlock_previous(&audio_input_data->producer, &audio_input_data->circular_buf);
-
- return -2;
- }
- else if (ret < 0)
- {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot read audio frame.\n"));
- continue;
- }
-
- /* Is this a packet from the audio stream? */
- if (packet.stream_index == audio_input_file->astream_idx) {
- /* Set audio frame to default */
-
-#ifndef FF_API_AVFRAME_LAVC
- avcodec_get_frame_defaults(audio_input_data->aframe);
-#else
- av_frame_unref(audio_input_data->aframe);
-#endif
-
- /* Decode audio frame */
- if (avcodec_decode_audio4(codec_ctx, audio_input_data->aframe, &got_frame, &packet) < 0) {
- av_free_packet(&packet);
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while decoding audio.\n"));
- dc_producer_end_signal(&audio_input_data->producer, &audio_input_data->circular_buf);
- dc_producer_unlock_previous(&audio_input_data->producer, &audio_input_data->circular_buf);
- return -1;
- }
-
- if (audio_input_data->aframe->pts != AV_NOPTS_VALUE)
- audio_input_data->next_pts = audio_input_data->aframe->pts;
-
- audio_input_data->next_pts += ((int64_t)AV_TIME_BASE * audio_input_data->aframe->nb_samples) / codec_ctx->sample_rate;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Decode audio frame pts %d at UTC "LLU"\n", audio_input_data->next_pts, gf_net_get_utc() ));
-
- /* Did we get an audio frame? */
- if (got_frame) {
- uint8_t **data;
- int data_size;
- enum AVSampleFormat sample_format;
- Bool resample;
-#ifdef DC_AUDIO_RESAMPLER
- int num_planes_out=0;
-#endif
-#ifdef GPAC_USE_LIBAV
- int sample_rate = codec_ctx->sample_rate;
- int num_channels = codec_ctx->channels;
- u64 channel_layout = codec_ctx->channel_layout;
-#else
- int sample_rate = audio_input_data->aframe->sample_rate;
- int num_channels = audio_input_data->aframe->channels;
- u64 channel_layout;
- if (!audio_input_data->aframe->channel_layout) {
- if (audio_input_data->aframe->channels == 2) {
- audio_input_data->aframe->channel_layout = AV_CH_LAYOUT_STEREO;
- } else if (audio_input_data->aframe->channels == 1) {
- audio_input_data->aframe->channel_layout = AV_CH_LAYOUT_MONO;
- } else {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Unknown input channel layout for %d channels. Aborting.\n", audio_input_data->aframe->channels));
- exit(1);
- }
- }
- channel_layout = audio_input_data->aframe->channel_layout;
-#endif
- sample_format = (enum AVSampleFormat)audio_input_data->aframe->format;
- resample = (sample_rate != DC_AUDIO_SAMPLE_RATE
- || num_channels != DC_AUDIO_NUM_CHANNELS
- || channel_layout != DC_AUDIO_CHANNEL_LAYOUT
- || sample_format != DC_AUDIO_SAMPLE_FORMAT);
-
- /* Resample if needed */
- if (resample) {
-#ifndef DC_AUDIO_RESAMPLER
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Audio resampling is needed at the decoding stage, but not supported by your version of DashCast. Aborting.\n"));
- exit(1);
-#else
- uint8_t **output;
- int nb_samp;
- if (ensure_resampler(audio_input_file, sample_rate, num_channels, channel_layout, sample_format)) {
- return -1;
- }
-
- nb_samp = resample_audio(audio_input_file, audio_input_data, codec_ctx, &output, &num_planes_out, num_channels, sample_format);
- if (nb_samp<0) {
- return -1;
- }
-
- av_samples_get_buffer_size(&data_size, DC_AUDIO_NUM_CHANNELS, nb_samp, DC_AUDIO_SAMPLE_FORMAT, 0);
- data = output;
-#endif
- } else {
- /*no resampling needed: read data from the AVFrame*/
- data = audio_input_data->aframe->extended_data;
- data_size = audio_input_data->aframe->linesize[0];
- }
-
- assert(!av_sample_fmt_is_planar(DC_AUDIO_SAMPLE_FORMAT));
- av_fifo_generic_write(audio_input_file->fifo, data[0], data_size, NULL);
-
- if (/*audio_input_file->circular_buf.mode == OFFLINE*/audio_input_file->mode == ON_DEMAND || audio_input_file->mode == LIVE_MEDIA) {
- dc_producer_lock(&audio_input_data->producer, &audio_input_data->circular_buf);
-
- /* Unlock the previous node in the circular buffer. */
- dc_producer_unlock_previous(&audio_input_data->producer, &audio_input_data->circular_buf);
-
- /* Get the pointer of the current node in circular buffer. */
- audio_data_node = (AudioDataNode *) dc_producer_produce(&audio_input_data->producer, &audio_input_data->circular_buf);
- audio_data_node->channels = DC_AUDIO_NUM_CHANNELS;
- audio_data_node->channel_layout = DC_AUDIO_CHANNEL_LAYOUT;
- audio_data_node->sample_rate = DC_AUDIO_SAMPLE_RATE;
- audio_data_node->format = DC_AUDIO_SAMPLE_FORMAT;
- audio_data_node->abuf_size = data_size;
- av_fifo_generic_read(audio_input_file->fifo, audio_data_node->abuf, audio_data_node->abuf_size, NULL);
-
- dc_producer_advance(&audio_input_data->producer, &audio_input_data->circular_buf);
- } else {
- while (av_fifo_size(audio_input_file->fifo) >= LIVE_FRAME_SIZE) {
- /* Lock the current node in the circular buffer. */
- if (dc_producer_lock(&audio_input_data->producer, &audio_input_data->circular_buf) < 0) {
- continue;
- }
-
- /* Unlock the previous node in the circular buffer. */
- dc_producer_unlock_previous(&audio_input_data->producer, &audio_input_data->circular_buf);
-
- /* Get the pointer of the current node in circular buffer. */
- audio_data_node = (AudioDataNode *) dc_producer_produce(&audio_input_data->producer, &audio_input_data->circular_buf);
-
- audio_data_node->abuf_size = LIVE_FRAME_SIZE;
- av_fifo_generic_read(audio_input_file->fifo, audio_data_node->abuf, audio_data_node->abuf_size, NULL);
-
- dc_producer_advance(&audio_input_data->producer, &audio_input_data->circular_buf);
- }
- }
-
-#ifdef DC_AUDIO_RESAMPLER
- if (resample) {
- int i;
- for (i=0; i<num_planes_out; ++i) {
- av_free(data[i]);
- }
- av_free(data);
- }
-#endif
-
- return 0;
- }
- }
-
- /*
- * Free the packet that was allocated by av_read_frame
- */
- av_free_packet(&packet);
- }
-
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Unknown error while reading audio frame.\n"));
- return -1;
-}
-
-void dc_audio_decoder_close(AudioInputFile *audio_input_file)
-{
- /*
- * Close the audio format context
- */
- avformat_close_input(&audio_input_file->av_fmt_ctx);
-
- if (audio_input_file->av_pkt_list_mutex) {
- gf_mx_p(audio_input_file->av_pkt_list_mutex);
- while (gf_list_count(audio_input_file->av_pkt_list)) {
- AVPacket *pkt = (AVPacket*)gf_list_last(audio_input_file->av_pkt_list);
- av_free_packet(pkt);
- gf_list_rem_last(audio_input_file->av_pkt_list);
- }
- gf_list_del(audio_input_file->av_pkt_list);
- gf_mx_v(audio_input_file->av_pkt_list_mutex);
- gf_mx_del(audio_input_file->av_pkt_list_mutex);
- }
-
- av_fifo_free(audio_input_file->fifo);
-
-#ifdef DC_AUDIO_RESAMPLER
- swr_free(&audio_input_file->aresampler);
-#endif
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef AUDIO_DECODER_H_
-#define AUDIO_DECODER_H_
-
-#include "audio_data.h"
-
-#include "libavformat/avformat.h"
-#include "libavutil/fifo.h"
-#ifdef DC_AUDIO_RESAMPLER
-#include "libavutil/opt.h"
-#include "libswresample/swresample.h"
-#endif
-
-
-/*
- * The structure which keeps the data of
- * input audio file.
- */
-typedef struct {
- /* Format context structure provided by avlib to open and read from a media file. */
- AVFormatContext *av_fmt_ctx;
-
- /* A list of AVPackets and return value to be processed: when this parameter is non-null,
- * the video thread makes the demux and pushes the packets. */
- GF_List *av_pkt_list;
- GF_Mutex *av_pkt_list_mutex;
-
- /* The index of the audio stream in the file. */
- int astream_idx;
-
- /* This is the output FIFO linking the decoder to the other encoder: only conveys
- * stereo 44100 (and resample if needed) */
- AVFifoBuffer *fifo;
-#ifdef DC_AUDIO_RESAMPLER
- /* Optional audio resampling between the decoder and the encoder */
- SwrContext *aresampler;
-#endif
-
- LockMode mode;
- int no_loop;
-} AudioInputFile;
-
-/*
- * Open the input audio
- *
- * @param cmd_data [in] contains information about the file name
- * and the audio format.
- *
- * @param audio_input_file [out] pointer to the structure which we want to
- * open the file
- *
- * @return 0 on success -1 on failure.
- */
-int dc_audio_decoder_open(AudioInputFile *audio_input_file, AudioDataConf *audio_data_conf, int mode, int no_loop, int video_framerate);
-
-/*
- * Read and decode audio and put samples on circular buffer
- *
- * @param audio_input_file [in] contains info on input audio. This parameter
- * must have been opened with open_audio_input
- *
- * @param audio_input_data [out] the samples will be saved on the circular buffer
- * of this parameter.
- *
- * @return 0 on success, -1 on failure, -2 on EOF (end of the file)
- */
-int dc_audio_decoder_read(AudioInputFile *audio_input_file, AudioInputData *audio_input_data);
-
-/*
- * Close the input audio
- *
- * @param audio_input_file [in] the audio file to be closed
- */
-void dc_audio_decoder_close(AudioInputFile *audio_input_file);
-
-#endif /* AUDIO_DECODER_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "audio_encoder.h"
-
-
-extern void build_dict(void *priv_data, const char *options);
-
-
-int dc_audio_encoder_open(AudioOutputFile *audio_output_file, AudioDataConf *audio_data_conf)
-{
- AVDictionary *opts = NULL;
-
- audio_output_file->audio_data_conf = audio_data_conf;
- audio_output_file->fifo = av_fifo_alloc(2 * MAX_AUDIO_PACKET_SIZE);
- audio_output_file->aframe = FF_ALLOC_FRAME();
- audio_output_file->adata_buf = (uint8_t*) av_malloc(2 * MAX_AUDIO_PACKET_SIZE);
-#ifndef GPAC_USE_LIBAV
- audio_output_file->aframe->channels = -1;
-#endif
-#ifndef LIBAV_FRAME_OLD
- audio_output_file->aframe->channel_layout = 0;
- audio_output_file->aframe->sample_rate = -1;
-#endif
- audio_output_file->aframe->format = -1;
- audio_output_file->codec = avcodec_find_encoder_by_name(audio_data_conf->codec);
- if (audio_output_file->codec == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Output audio codec %s not found\n", audio_data_conf->codec));
- return -1;
- }
-
- audio_output_file->codec_ctx = avcodec_alloc_context3(audio_output_file->codec);
- audio_output_file->codec_ctx->codec_id = audio_output_file->codec->id;
- audio_output_file->codec_ctx->codec_type = AVMEDIA_TYPE_AUDIO;
- audio_output_file->codec_ctx->bit_rate = audio_data_conf->bitrate;
- audio_output_file->codec_ctx->sample_rate = DC_AUDIO_SAMPLE_RATE /*audio_data_conf->samplerate*/;
-
- {
- AVRational time_base;
- time_base.num = 1;
- time_base.den = audio_output_file->codec_ctx->sample_rate;
- audio_output_file->codec_ctx->time_base = time_base;
- }
- audio_output_file->codec_ctx->channels = audio_data_conf->channels;
-
- /*FIXME: depends on channels -> http://ffmpeg.org/doxygen/trunk/channel__layout_8c_source.html#l00074*/
- if (audio_data_conf->channels == 1) {
- audio_output_file->codec_ctx->channel_layout = AV_CH_LAYOUT_MONO;
- } else {
- audio_output_file->codec_ctx->channel_layout = AV_CH_LAYOUT_STEREO;
- }
-
- audio_output_file->codec_ctx->sample_fmt = audio_output_file->codec->sample_fmts[0];
-#ifdef DC_AUDIO_RESAMPLER
- audio_output_file->aresampler = NULL;
-#endif
- if (strcmp(audio_data_conf->custom, "")) {
- build_dict(audio_output_file->codec_ctx->priv_data, audio_data_conf->custom);
- }
- audio_output_file->astream_idx = 0;
-
- /* open the audio codec */
- av_dict_set(&opts, "strict", "experimental", 0);
- if (avcodec_open2(audio_output_file->codec_ctx, audio_output_file->codec, &opts) < 0) {
- /*FIXME: if we enter here (set "mp2" as a codec and "200000" as a bitrate -> deadlock*/
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output audio codec\n"));
- av_dict_free(&opts);
- return -1;
- }
- av_dict_free(&opts);
-
- audio_output_file->frame_bytes = audio_output_file->codec_ctx->frame_size * av_get_bytes_per_sample(DC_AUDIO_SAMPLE_FORMAT) * DC_AUDIO_NUM_CHANNELS;
-
-#ifndef FF_API_AVFRAME_LAVC
- avcodec_get_frame_defaults(audio_output_file->aframe);
-#else
- av_frame_unref(audio_output_file->aframe);
-#endif
-
-
- audio_output_file->aframe->nb_samples = audio_output_file->codec_ctx->frame_size;
-
- if (avcodec_fill_audio_frame(audio_output_file->aframe, audio_output_file->codec_ctx->channels, audio_output_file->codec_ctx->sample_fmt,
- audio_output_file->adata_buf, audio_output_file->codec_ctx->frame_size * av_get_bytes_per_sample(audio_output_file->codec_ctx->sample_fmt) * audio_output_file->codec_ctx->channels, 1) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Fill audio frame failed\n"));
- return -1;
- }
-
- //audio_output_file->acc_samples = 0;
-
- return 0;
-}
-
-int dc_audio_encoder_read(AudioOutputFile *audio_output_file, AudioInputData *audio_input_data)
-{
- int ret;
- AudioDataNode *audio_data_node;
-
- ret = dc_consumer_lock(&audio_output_file->consumer, &audio_input_data->circular_buf);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Audio encoder got an end of buffer!\n"));
- return -2;
- }
-
- dc_consumer_unlock_previous(&audio_output_file->consumer, &audio_input_data->circular_buf);
-
- audio_data_node = (AudioDataNode *) dc_consumer_consume(&audio_output_file->consumer, &audio_input_data->circular_buf);
-#ifndef GPAC_USE_LIBAV
- audio_output_file->aframe->channels = audio_output_file->codec_ctx->channels;
-#endif
-#ifndef LIBAV_FRAME_OLD
- audio_output_file->aframe->channel_layout = audio_output_file->codec_ctx->channel_layout;
- audio_output_file->aframe->sample_rate = audio_output_file->codec_ctx->sample_rate;
-#endif
- audio_output_file->aframe->format = audio_output_file->codec_ctx->sample_fmt;
-
- /* Write audio sample on fifo */
- av_fifo_generic_write(audio_output_file->fifo, audio_data_node->abuf, audio_data_node->abuf_size, NULL);
-
- dc_consumer_advance(&audio_output_file->consumer);
-
- return 0;
-}
-
-#if 0
-int dc_audio_encoder_flush(AudioOutputFile *audio_output_file, AudioInputData *audio_input_data)
-{
- int got_pkt;
- //AVStream *audio_stream = audio_output_file->av_fmt_ctx->streams[audio_output_file->astream_idx];
- //AVCodecContext *audio_codec_ctx = audio_stream->codec;
- AVCodecContext *audio_codec_ctx = audio_output_file->codec_ctx;
-
- av_init_packet(&audio_output_file->packet);
- audio_output_file->packet.data = NULL;
- audio_output_file->packet.size = 0;
-
- /* Set PTS (method 1) */
- audio_output_file->aframe->pts = audio_input_data->next_pts;
- /* Encode audio */
-#ifdef DC_AUDIO_RESAMPLER
-#error resampling is not done here
-#endif
- if (avcodec_encode_audio2(audio_codec_ctx, &audio_output_file->packet, NULL, &got_pkt) != 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while encoding audio.\n"));
- return -1;
- }
- if (got_pkt) {
- //audio_output_file->acc_samples += audio_output_file->aframe->nb_samples;
- return 0;
- }
- av_free_packet(&audio_output_file->packet);
- return 1;
-}
-#endif
-
-#ifdef DC_AUDIO_RESAMPLER
-static int ensure_resampler(AudioOutputFile *audio_output_file, AVCodecContext *audio_codec_ctx)
-{
- if (!audio_output_file->aresampler) {
- audio_output_file->aresampler = swr_alloc();
- if (!audio_output_file->aresampler) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot allocate the audio resampler. Aborting.\n"));
- return -1;
- }
- av_opt_set_channel_layout(audio_output_file->aresampler, "in_channel_layout", DC_AUDIO_CHANNEL_LAYOUT, 0);
- av_opt_set_channel_layout(audio_output_file->aresampler, "out_channel_layout", audio_codec_ctx->channel_layout, 0);
- av_opt_set_sample_fmt(audio_output_file->aresampler, "in_sample_fmt", DC_AUDIO_SAMPLE_FORMAT, 0);
- av_opt_set_sample_fmt(audio_output_file->aresampler, "out_sample_fmt", audio_codec_ctx->sample_fmt, 0);
- av_opt_set_int(audio_output_file->aresampler, "in_sample_rate", DC_AUDIO_SAMPLE_RATE, 0);
- av_opt_set_int(audio_output_file->aresampler, "out_sample_rate", audio_codec_ctx->sample_rate, 0);
- av_opt_set_int(audio_output_file->aresampler, "in_channels", DC_AUDIO_NUM_CHANNELS, 0);
- av_opt_set_int(audio_output_file->aresampler, "out_channels", audio_codec_ctx->channels, 0);
-
- if (swr_init(audio_output_file->aresampler)) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not open the audio resampler. Aborting.\n"));
- return -1;
- }
- }
-
- return 0;
-}
-
-//resample - see http://ffmpeg.org/pipermail/libav-user/2012-June/002164.html
-static int resample_audio(AudioOutputFile *audio_output_file, AVCodecContext *audio_codec_ctx, int *num_planes_out)
-{
- int i, linesize;
- uint8_t **output;
- *num_planes_out = av_sample_fmt_is_planar(audio_output_file->codec->sample_fmts[0]) ? audio_output_file->codec_ctx->channels : 1;
- linesize = audio_output_file->codec_ctx->frame_size * av_get_bytes_per_sample(audio_output_file->codec->sample_fmts[0]) * audio_output_file->codec_ctx->channels / *num_planes_out;
- output = (uint8_t**)av_malloc(*num_planes_out*sizeof(uint8_t*));
- for (i=0; i<*num_planes_out; i++) {
- output[i] = (uint8_t*)av_malloc(linesize);
- }
-
- if (swr_convert(audio_output_file->aresampler, output, audio_output_file->aframe->nb_samples, (const uint8_t **)audio_output_file->aframe->extended_data, audio_output_file->aframe->nb_samples) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not resample audio frame. Aborting.\n"));
- return -1;
- }
-
- audio_output_file->aframe->extended_data = output;
- for (i=0; i<*num_planes_out; i++) {
- audio_output_file->aframe->linesize[i] = linesize;
- }
- audio_codec_ctx->channel_layout = audio_output_file->aframe->channel_layout;
- audio_codec_ctx->sample_fmt = audio_output_file->aframe->format;
- audio_codec_ctx->sample_rate = audio_output_file->aframe->sample_rate;
-#ifndef GPAC_USE_LIBAV
- audio_codec_ctx->channels = audio_output_file->aframe->channels;
-#endif
-
- return 0;
-}
-#endif
-
-int dc_audio_encoder_encode(AudioOutputFile *audio_output_file, AudioInputData *audio_input_data)
-{
- int got_pkt;
- AVCodecContext *audio_codec_ctx = audio_output_file->codec_ctx;
-
- while (av_fifo_size(audio_output_file->fifo) >= audio_output_file->frame_bytes) {
-#ifdef DC_AUDIO_RESAMPLER
- uint8_t **data = NULL; //mirror AVFrame::data
- int num_planes_out = 0;
-#endif
- Bool resample;
-
- av_fifo_generic_read(audio_output_file->fifo, audio_output_file->adata_buf, audio_output_file->frame_bytes, NULL);
-
- audio_output_file->aframe->data[0] = audio_output_file->adata_buf;
- audio_output_file->aframe->linesize[0] = audio_output_file->frame_bytes;
- audio_output_file->aframe->linesize[1] = 0;
-
- av_init_packet(&audio_output_file->packet);
- audio_output_file->packet.data = NULL;
- audio_output_file->packet.size = 0;
-
- /*
- * Set PTS (method 1)
- */
- //audio_output_file->aframe->pts = audio_input_data->next_pts;
-
- /*
- * Set PTS (method 2)
- */
- //{
- // int64_t now = av_gettime();
- // AVRational avr;
- // avr.num = 1;
- // avr.den = AV_TIME_BASE;
- // audio_output_file->aframe->pts = av_rescale_q(now, avr, audio_codec_ctx->time_base);
- //}
-
- resample = (DC_AUDIO_SAMPLE_FORMAT != audio_codec_ctx->sample_fmt
- || DC_AUDIO_SAMPLE_RATE != audio_codec_ctx->sample_rate
- || DC_AUDIO_NUM_CHANNELS != audio_codec_ctx->channels
- || DC_AUDIO_CHANNEL_LAYOUT != audio_codec_ctx->channel_layout);
- /* Resample if needed */
- if (resample) {
-#ifndef DC_AUDIO_RESAMPLER
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Audio resampling is needed at the encoding stage, but not supported by your version of DashCast. Aborting.\n"));
- exit(1);
-#else
- if (ensure_resampler(audio_output_file, audio_codec_ctx)) {
- return -1;
- }
-
- data = audio_output_file->aframe->extended_data;
- if (resample_audio(audio_output_file, audio_codec_ctx, &num_planes_out)) {
- return -1;
- }
-#endif
- }
-
- /* Encode audio */
- if (avcodec_encode_audio2(audio_codec_ctx, &audio_output_file->packet, audio_output_file->aframe, &got_pkt) != 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while encoding audio.\n"));
-#ifdef DC_AUDIO_RESAMPLER
- if (resample) {
- int i;
- for (i=0; i<num_planes_out; ++i) {
- av_free(audio_output_file->aframe->extended_data[i]);
- }
- av_free(audio_output_file->aframe->extended_data);
- audio_output_file->aframe->extended_data = data;
- }
-#endif
- return -1;
- }
-
-#ifdef DC_AUDIO_RESAMPLER
- if (resample) {
- int i;
- for (i=0; i<num_planes_out; ++i) {
- av_free(audio_output_file->aframe->extended_data[i]);
- }
- av_free(audio_output_file->aframe->extended_data);
- audio_output_file->aframe->extended_data = data;
- }
-#endif
-
- if (got_pkt) {
- //audio_output_file->acc_samples += audio_output_file->aframe->nb_samples;
- return 0;
- }
-
- av_free_packet(&audio_output_file->packet);
- }
-
- return 1;
-}
-
-void dc_audio_encoder_close(AudioOutputFile *audio_output_file)
-{
-// int i;
-//
-// /* free the streams */
-// for (i = 0; i < audio_output_file->av_fmt_ctx->nb_streams; i++) {
-// avcodec_close(audio_output_file->av_fmt_ctx->streams[i]->codec);
-// av_freep(&audio_output_file->av_fmt_ctx->streams[i]->info);
-// }
-
- av_fifo_free(audio_output_file->fifo);
-
- av_free(audio_output_file->adata_buf);
- av_free(audio_output_file->aframe);
-
- avcodec_close(audio_output_file->codec_ctx);
- av_free(audio_output_file->codec_ctx);
-
-#ifdef DC_AUDIO_RESAMPLER
- swr_free(&audio_output_file->aresampler);
-#endif
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef AUDIO_ENCODER_H_
-#define AUDIO_ENCODER_H_
-
-#include "audio_muxer.h"
-
-/*
- * Open an audio stream
- *
- * @param audio_output_file [in] add an audio stream to the file
- * with the parameters already passed to open_audio_output
- *
- * @return 0 on success, -1 on failure
- */
-int dc_audio_encoder_open(AudioOutputFile *audio_output_file, AudioDataConf *audio_data_conf);
-
-int dc_audio_encoder_read(AudioOutputFile *audio_output_file, AudioInputData *audio_input_data);
-
-//int dc_audio_encoder_flush(AudioOutputFile *audio_output_file, AudioInputData *audio_input_data);
-
-/*
- * Read the decoded audio sample from circular buffer (which is in audio_input_data)
- * and encode and write them on the output file
- *
- * @param audio_output_file [in] audio output file
- * @param audio_input_data [in] audio input data structure which contains a circular buffer with audio samples
- *
- * @return 0 on success, -1 on failure, -2 on finishing;
- * when there is no more data on circular buffer to encode
- */
-int dc_audio_encoder_encode(AudioOutputFile *audio_output_file, AudioInputData *audio_input_data);
-
-/*
- * Close the output audio file
- *
- * @param audio_output_file [in] audio output file
- */
-void dc_audio_encoder_close(AudioOutputFile *audio_output_file);
-
-#endif /* AUDIO_ENCODER_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "audio_muxer.h"
-#include "libavformat/avio.h"
-
-#ifndef GPAC_DISABLE_ISOM
-
-int dc_gpac_audio_moov_create(AudioOutputFile *audio_output_file, char *filename)
-{
- GF_Err ret;
- u32 di, track;
- u8 bpsample;
- GF_ESD *esd;
-#ifndef GPAC_DISABLE_AV_PARSERS
- GF_M4ADecSpecInfo acfg;
-#endif
- AVCodecContext *audio_codec_ctx = audio_output_file->codec_ctx;
-
- audio_output_file->isof = gf_isom_open(filename, GF_ISOM_OPEN_WRITE, NULL);
- if (!audio_output_file->isof) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open iso file %s\n", filename));
- return -1;
- }
-
- esd = gf_odf_desc_esd_new(2);
- if (!esd) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot create GF_ESD\n"));
- return -1;
- }
-
- esd->decoderConfig = (GF_DecoderConfig *) gf_odf_desc_new(GF_ODF_DCD_TAG);
- esd->slConfig = (GF_SLConfig *) gf_odf_desc_new(GF_ODF_SLC_TAG);
- esd->decoderConfig->streamType = GF_STREAM_AUDIO;
- if (!strcmp(audio_output_file->codec_ctx->codec->name, "aac")) { //TODO: find an automatic table
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_AUDIO_AAC_MPEG4;
- esd->decoderConfig->bufferSizeDB = 20;
- esd->slConfig->timestampResolution = audio_codec_ctx->sample_rate;
- esd->decoderConfig->decoderSpecificInfo = (GF_DefaultDescriptor *) gf_odf_desc_new(GF_ODF_DSI_TAG);
- esd->ESID = 1;
-
-#ifndef GPAC_DISABLE_AV_PARSERS
- memset(&acfg, 0, sizeof(GF_M4ADecSpecInfo));
- acfg.base_object_type = GF_M4A_AAC_LC;
- acfg.base_sr = audio_codec_ctx->sample_rate;
- acfg.nb_chan = audio_codec_ctx->channels;
- acfg.sbr_object_type = 0;
- acfg.audioPL = gf_m4a_get_profile(&acfg);
-
- ret = gf_m4a_write_config(&acfg, &esd->decoderConfig->decoderSpecificInfo->data, &esd->decoderConfig->decoderSpecificInfo->dataLength);
- assert(ret == GF_OK);
-#endif
- } else {
- if (strcmp(audio_output_file->codec_ctx->codec->name, "mp2")) {
- GF_LOG(GF_LOG_WARNING, GF_LOG_DASH, ("Unlisted codec, setting GPAC_OTI_AUDIO_MPEG1 descriptor.\n"));
- }
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_AUDIO_MPEG1;
- esd->decoderConfig->bufferSizeDB = 20;
- esd->slConfig->timestampResolution = audio_codec_ctx->sample_rate;
- esd->decoderConfig->decoderSpecificInfo = (GF_DefaultDescriptor *) gf_odf_desc_new(GF_ODF_DSI_TAG);
- esd->ESID = 1;
-
-#ifndef GPAC_DISABLE_AV_PARSERS
- memset(&acfg, 0, sizeof(GF_M4ADecSpecInfo));
- acfg.base_object_type = GF_M4A_LAYER2;
- acfg.base_sr = audio_codec_ctx->sample_rate;
- acfg.nb_chan = audio_codec_ctx->channels;
- acfg.sbr_object_type = 0;
- acfg.audioPL = gf_m4a_get_profile(&acfg);
-
- ret = gf_m4a_write_config(&acfg, &esd->decoderConfig->decoderSpecificInfo->data, &esd->decoderConfig->decoderSpecificInfo->dataLength);
- assert(ret == GF_OK);
-#endif
- }
-
- //gf_isom_store_movie_config(video_output_file->isof, 0);
- track = gf_isom_new_track(audio_output_file->isof, esd->ESID, GF_ISOM_MEDIA_AUDIO, audio_codec_ctx->sample_rate);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("TimeScale: %d \n", audio_codec_ctx->time_base.den));
- if (!track) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot create new track\n"));
- return -1;
- }
-
- ret = gf_isom_set_track_enabled(audio_output_file->isof, track, 1);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_set_track_enabled\n", gf_error_to_string(ret)));
- return -1;
- }
-
-// if (!esd->ESID) esd->ESID = gf_isom_get_track_id(audio_output_file->isof, track);
-
- ret = gf_isom_new_mpeg4_description(audio_output_file->isof, track, esd, NULL, NULL, &di);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_new_mpeg4_description\n", gf_error_to_string(ret)));
- return -1;
- }
-
- gf_odf_desc_del((GF_Descriptor *) esd);
- esd = NULL;
-
- bpsample = av_get_bytes_per_sample(audio_output_file->codec_ctx->sample_fmt) * 8;
-
- ret = gf_isom_set_audio_info(audio_output_file->isof, track, di, audio_codec_ctx->sample_rate, audio_output_file->codec_ctx->channels, bpsample, GF_IMPORT_AUDIO_SAMPLE_ENTRY_v0_BS);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_set_audio_info\n", gf_error_to_string(ret)));
- return -1;
- }
-
-#ifndef GPAC_DISABLE_AV_PARSERS
- ret = gf_isom_set_pl_indication(audio_output_file->isof, GF_ISOM_PL_AUDIO, acfg.audioPL);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_set_pl_indication\n", gf_error_to_string(ret)));
- return -1;
- }
-#endif
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("time scale: %d sample dur: %d \n", audio_codec_ctx->time_base.den, audio_output_file->codec_ctx->frame_size));
-
- ret = gf_isom_setup_track_fragment(audio_output_file->isof, track, 1, audio_output_file->codec_ctx->frame_size, 0, 0, 0, 0, 0);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_setup_track_fragment\n", gf_error_to_string(ret)));
- return -1;
- }
-
- //gf_isom_add_track_to_root_od(video_output_file->isof,1);
-
- ret = gf_isom_finalize_for_fragment(audio_output_file->isof, 1);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_finalize_for_fragment\n", gf_error_to_string(ret)));
- return -1;
- }
-
- ret = gf_media_get_rfc_6381_codec_name(audio_output_file->isof, track, audio_output_file->audio_data_conf->codec6381, GF_FALSE, GF_FALSE);
- if (ret != GF_OK) return -1;
- return 0;
-}
-
-int dc_gpac_audio_isom_open_seg(AudioOutputFile *audio_output_file, char *filename)
-{
- GF_Err ret;
- ret = gf_isom_start_segment(audio_output_file->isof, filename, GF_TRUE);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_start_segment\n", gf_error_to_string(ret)));
- return -1;
- }
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Audio segment %s started at "LLU"\n", filename, gf_net_get_utc() ));
-
- audio_output_file->dts = 0;
-
- return 0;
-}
-
-int dc_gpac_audio_isom_write(AudioOutputFile *audio_output_file)
-{
- GF_Err ret;
- audio_output_file->sample->data = (char *) audio_output_file->packet.data;
- audio_output_file->sample->dataLength = audio_output_file->packet.size;
-
- audio_output_file->sample->DTS = audio_output_file->dts; //audio_output_file->aframe->pts;
- audio_output_file->sample->IsRAP = RAP; //audio_output_file->aframe->key_frame;//audio_codec_ctx->coded_frame->key_frame;
-
- ret = gf_isom_fragment_add_sample(audio_output_file->isof, 1, audio_output_file->sample, 1, audio_output_file->codec_ctx->frame_size, 0, 0, 0);
- audio_output_file->dts += audio_output_file->codec_ctx->frame_size;
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_fragment_add_sample\n", gf_error_to_string(ret)));
- return -1;
- }
- return 0;
-}
-
-int dc_gpac_audio_isom_close_seg(AudioOutputFile *audio_output_file)
-{
- u64 seg_size;
- GF_Err ret;
- ret = gf_isom_close_segment(audio_output_file->isof, 0, 0, 0, 0, 0, 0, 0, GF_TRUE, GF_FALSE, audio_output_file->seg_marker, NULL, NULL, &seg_size);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_close_segment\n", gf_error_to_string(ret)));
- return -1;
- }
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Audio segment %s closed at "LLU" - size "LLU" bytes\n", gf_isom_get_segment_name(audio_output_file->isof), gf_net_get_utc(), seg_size ));
-
- //audio_output_file->acc_samples = 0;
-
- return 0;
-}
-
-int dc_gpac_audio_isom_close(AudioOutputFile *audio_output_file)
-{
- GF_Err ret;
- ret = gf_isom_close(audio_output_file->isof);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_close\n", gf_error_to_string(ret)));
- return -1;
- }
-
- //audio_output_file->acc_samples = 0;
-
- return 0;
-}
-
-#endif
-
-
-
-int dc_ffmpeg_audio_muxer_open(AudioOutputFile *audio_output_file, char *filename)
-{
- AVStream *audio_stream;
- AVOutputFormat *output_fmt;
- AVDictionary *opts = NULL;
-
- AVCodecContext *audio_codec_ctx = audio_output_file->codec_ctx;
- audio_output_file->av_fmt_ctx = NULL;
-
-// strcpy(audio_output_file->filename, audio_data_conf->filename);
-// audio_output_file->abr = audio_data_conf->bitrate;
-// audio_output_file->asr = audio_data_conf->samplerate;
-// audio_output_file->ach = audio_data_conf->channels;
-// strcpy(audio_output_file->codec, audio_data_conf->codec);
-
- /* Find output format */
- output_fmt = av_guess_format(NULL, filename, NULL);
- if (!output_fmt) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot find suitable output format\n"));
- return -1;
- }
-
- audio_output_file->av_fmt_ctx = avformat_alloc_context();
- if (!audio_output_file->av_fmt_ctx) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot allocate memory for pOutVideoFormatCtx\n"));
- return -1;
- }
-
- audio_output_file->av_fmt_ctx->oformat = output_fmt;
- strcpy(audio_output_file->av_fmt_ctx->filename, filename);
-
- /* Open the output file */
- if (!(output_fmt->flags & AVFMT_NOFILE)) {
- if (avio_open(&audio_output_file->av_fmt_ctx->pb, filename, URL_WRONLY) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot not open '%s'\n", filename));
- return -1;
- }
- }
-
- audio_stream = avformat_new_stream(audio_output_file->av_fmt_ctx, audio_output_file->codec);
- if (!audio_stream) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot create output video stream\n"));
- return -1;
- }
-
- audio_stream->codec->codec_id = audio_output_file->codec->id;
- audio_stream->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- audio_stream->codec->bit_rate = audio_codec_ctx->bit_rate;//audio_output_file->audio_data_conf->bitrate;
- audio_stream->codec->sample_rate = audio_codec_ctx->sample_rate;//audio_output_file->audio_data_conf->samplerate;
- audio_stream->codec->channels = audio_codec_ctx->channels;//audio_output_file->audio_data_conf->channels;
- assert(audio_codec_ctx->codec->sample_fmts);
- audio_stream->codec->sample_fmt = audio_codec_ctx->codec->sample_fmts[0];
-
-// if (audio_output_file->av_fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
-// audio_output_file->codec_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
-
- //video_stream->codec = video_output_file->codec_ctx;
-
- /* open the video codec */
- av_dict_set(&opts, "strict", "experimental", 0);
- if (avcodec_open2(audio_stream->codec, audio_output_file->codec, &opts) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output video codec\n"));
- av_dict_free(&opts);
- return -1;
- }
- av_dict_free(&opts);
-
- return avformat_write_header(audio_output_file->av_fmt_ctx, NULL);
-
-}
-
-int dc_ffmpeg_audio_muxer_write(AudioOutputFile *audio_output_file)
-{
- AVStream *audio_stream = audio_output_file->av_fmt_ctx->streams[audio_output_file->astream_idx];
- AVCodecContext *audio_codec_ctx = audio_stream->codec;
-
- audio_output_file->packet.stream_index = audio_stream->index;
-
- if (audio_output_file->packet.pts != AV_NOPTS_VALUE)
- audio_output_file->packet.pts = av_rescale_q(audio_output_file->packet.pts, audio_codec_ctx->time_base, audio_stream->time_base);
-
- if (audio_output_file->packet.duration > 0)
- audio_output_file->packet.duration = (int)av_rescale_q(audio_output_file->packet.duration, audio_codec_ctx->time_base, audio_stream->time_base);
- /*
- * if (pkt.pts != AV_NOPTS_VALUE)
- * pkt.pts = av_rescale_q(pkt.pts, audioEncCtx->time_base, audioStream->time_base);
- */
-
- audio_output_file->packet.flags |= AV_PKT_FLAG_KEY;
-
- if (av_interleaved_write_frame(audio_output_file->av_fmt_ctx, &audio_output_file->packet) != 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Writing frame is not successful\n"));
- av_free_packet(&audio_output_file->packet);
- return -1;
- }
-
- av_free_packet(&audio_output_file->packet);
-
- return 0;
-}
-
-int dc_ffmpeg_audio_muxer_close(AudioOutputFile *audio_output_file)
-{
- u32 i;
-
- av_write_trailer(audio_output_file->av_fmt_ctx);
- avio_close(audio_output_file->av_fmt_ctx->pb);
-
- // free the streams
- for (i = 0; i < audio_output_file->av_fmt_ctx->nb_streams; i++) {
- avcodec_close(audio_output_file->av_fmt_ctx->streams[i]->codec);
- av_freep(&audio_output_file->av_fmt_ctx->streams[i]->info);
- }
-
- //video_output_file->av_fmt_ctx->streams[video_output_file->vstream_idx]->codec = NULL;
- avformat_free_context(audio_output_file->av_fmt_ctx);
-
- //audio_output_file->acc_samples = 0;
-
- return 0;
-
-}
-
-int dc_audio_muxer_init(AudioOutputFile *audio_output_file, AudioDataConf *audio_data_conf, AudioMuxerType muxer_type, int frame_per_seg, int frame_per_frag, u32 seg_marker)
-{
- char name[GF_MAX_PATH];
- snprintf(name, sizeof(name), "audio encoder %s", audio_data_conf->filename);
- dc_consumer_init(&audio_output_file->consumer, AUDIO_CB_SIZE, name);
-
-#ifndef GPAC_DISABLE_ISOM
- audio_output_file->sample = gf_isom_sample_new();
- audio_output_file->isof = NULL;
-#endif
-
- audio_output_file->muxer_type = muxer_type;
- audio_output_file->frame_per_seg = frame_per_seg;
- audio_output_file->frame_per_frag = frame_per_frag;
- audio_output_file->seg_marker = seg_marker;
- return 0;
-}
-
-void dc_audio_muxer_free(AudioOutputFile *audio_output_file)
-{
-#ifndef GPAC_DISABLE_ISOM
- if (audio_output_file->isof != NULL) {
- gf_isom_close(audio_output_file->isof);
- }
- //gf_isom_sample_del(&audio_output_file->sample);
-#endif
-}
-
-GF_Err dc_audio_muxer_open(AudioOutputFile *audio_output_file, char *directory, char *id_name, int seg)
-{
- GF_Err ret = GF_NOT_SUPPORTED;
- char name[GF_MAX_PATH];
-
- switch (audio_output_file->muxer_type) {
- case FFMPEG_AUDIO_MUXER:
- snprintf(name, sizeof(name), "%s/%s_%d_ffmpeg.mp4", directory, id_name, seg);
- return dc_ffmpeg_audio_muxer_open(audio_output_file, name);
-#ifndef GPAC_DISABLE_ISOM
- case GPAC_AUDIO_MUXER:
- snprintf(name, sizeof(name), "%s/%s_%d_gpac.mp4", directory, id_name, seg);
- dc_gpac_audio_moov_create(audio_output_file, name);
- return dc_gpac_audio_isom_open_seg(audio_output_file, NULL);
- case GPAC_INIT_AUDIO_MUXER:
- if (seg == 1) {
- snprintf(name, sizeof(name), "%s/%s_init_gpac.mp4", directory, id_name);
- dc_gpac_audio_moov_create(audio_output_file, name);
- audio_output_file->first_dts = 0;
- }
- snprintf(name, sizeof(name), "%s/%s_%d_gpac.m4s", directory, id_name, seg);
- ret = dc_gpac_audio_isom_open_seg(audio_output_file, name);
- return ret;
-#endif
- default:
- ret = GF_BAD_PARAM;
- break;
- }
-
- return ret;
-}
-
-int dc_audio_muxer_write(AudioOutputFile *audio_output_file, int frame_nb, Bool insert_ntp)
-{
- switch (audio_output_file->muxer_type) {
- case FFMPEG_AUDIO_MUXER:
- return dc_ffmpeg_audio_muxer_write(audio_output_file);
-#ifndef GPAC_DISABLE_ISOM
- case GPAC_AUDIO_MUXER:
- case GPAC_INIT_AUDIO_MUXER:
- if (frame_nb % audio_output_file->frame_per_frag == 0) {
- gf_isom_start_fragment(audio_output_file->isof, 1);
-
- if (insert_ntp) {
- gf_isom_set_fragment_reference_time(audio_output_file->isof, 1, audio_output_file->frame_ntp, audio_output_file->first_dts * audio_output_file->codec_ctx->frame_size);
- }
-
- gf_isom_set_traf_base_media_decode_time(audio_output_file->isof, 1, audio_output_file->first_dts * audio_output_file->codec_ctx->frame_size);
- audio_output_file->first_dts += audio_output_file->frame_per_frag;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Audio start fragment first DTS %u at "LLU"\n", audio_output_file->first_dts, gf_net_get_utc() ));
- }
- dc_gpac_audio_isom_write(audio_output_file);
- if (frame_nb % audio_output_file->frame_per_frag == audio_output_file->frame_per_frag - 1) {
- gf_isom_flush_fragments(audio_output_file->isof, 1);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Audio flush fragment first DTS %u at "LLU"\n", audio_output_file->first_dts, gf_net_get_utc() ));
- }
- //TODO - do same as video, flush based on time in case of losses
- if (frame_nb + 1 == audio_output_file->frame_per_seg) {
- return 1;
- }
-
- return 0;
-#endif
-
- default:
- return GF_BAD_PARAM;
- }
- return GF_BAD_PARAM;
-}
-
-int dc_audio_muxer_close(AudioOutputFile *audio_output_file)
-{
- switch (audio_output_file->muxer_type) {
- case FFMPEG_AUDIO_MUXER:
- return dc_ffmpeg_audio_muxer_close(audio_output_file);
-#ifndef GPAC_DISABLE_ISOM
- case GPAC_AUDIO_MUXER:
- dc_gpac_audio_isom_close_seg(audio_output_file);
- return dc_gpac_audio_isom_close(audio_output_file);
- case GPAC_INIT_AUDIO_MUXER:
- return dc_gpac_audio_isom_close_seg(audio_output_file);
-#endif
- default:
- return GF_BAD_PARAM;
- }
-
- return GF_BAD_PARAM;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef AUDIO_MUXER_H_
-#define AUDIO_MUXER_H_
-
-#include <stdlib.h>
-#include "../../modules/ffmpeg_in/ffmpeg_in.h"
-#include "libavutil/fifo.h"
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
-#ifdef DC_AUDIO_RESAMPLER
-#include "libswresample/swresample.h"
-#endif
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include <gpac/isomedia.h>
-#include <gpac/internal/media_dev.h>
-#include <gpac/constants.h>
-#include "audio_data.h"
-
-
-typedef enum {
- FFMPEG_AUDIO_MUXER,
- GPAC_AUDIO_MUXER,
- GPAC_INIT_AUDIO_MUXER
-} AudioMuxerType;
-
-/*
- * AudioOutputFile structure has the data needed
- * to encode audio samples and write them on the file.
- * It reads the data from a circular buffer so it needs
- * to keep the index to that circular buffer. This index is
- * available in Consumer data structure.
- *
- */
-typedef struct {
- AudioDataConf *audio_data_conf;
-
- /* File format context structure */
- AVFormatContext *av_fmt_ctx;
- AVCodec *codec;
- AVCodecContext *codec_ctx;
-
-#ifndef GPAC_DISABLE_ISOM
- GF_ISOFile *isof;
- GF_ISOSample *sample;
-#endif
-
- int dts;
-
- /* The index to the audio stream in the file */
- int astream_idx;
-
- /* It keeps the index with which encoder access to the circular buffer (as a consumer) */
- Consumer consumer;
-
-#ifdef DC_AUDIO_RESAMPLER
- /* Optional audio resampling between the decoder and the encoder */
- SwrContext *aresampler;
-#endif
-
- /* Variables that encoder needs to encode data */
- AVFrame *aframe;
- uint8_t *adata_buf;
- int frame_bytes;
- AVPacket packet;
-
- /*
- * Audio samples stored in the AVFrame are not always
- * complete. Which means more than 1 AVFrame is needed
- * to complete an access unit. This fifo is provided
- * to store audio samples in the fifo and once an access unit
- * is complete we can encode it.
- */
- AVFifoBuffer *fifo;
-
- AudioMuxerType muxer_type;
-
- /* Accumulated sample */
- //int acc_samples;
-
- int frame_per_seg;
- int frame_per_frag;
- int first_dts;
-
- u32 seg_marker;
- u64 frame_ntp;
-} AudioOutputFile;
-
-int dc_audio_muxer_init(AudioOutputFile *audio_output_file, AudioDataConf *audio_data_conf, AudioMuxerType muxer_type, int frame_per_seg, int frame_per_frag, u32 seg_marker);
-void dc_audio_muxer_free(AudioOutputFile *audio_output_file);
-
-/*
- * Open the output audio
- *
- * @param audio_output_file [out] open the audio output on this file
- *
- * @param audio_data_conf [in] the structure containing the
- * configuration of the output file (bitrate, samplerate, name, channels)
- *
- * @return 0 on success, -1 on failure
- */
-GF_Err dc_audio_muxer_open(AudioOutputFile *audio_output_file, char *directory, char *id_name, int seg);
-
-GF_Err dc_audio_muxer_write(AudioOutputFile *audio_output_file, int frame_nb, Bool insert_ntp);
-
-GF_Err dc_audio_muxer_close(AudioOutputFile *audio_output_file);
-
-#endif /* AUDIO_MUXER_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "circular_buffer.h"
-
-
-//#define DEBUG
-
-
-void dc_circular_buffer_create(CircularBuffer *circular_buf, u32 size, LockMode mode, int max_num_consumers)
-{
- u32 i;
- circular_buf->size = size;
- circular_buf->list = (Node*)gf_malloc(size * sizeof(Node));
- circular_buf->mode = mode;
- circular_buf->max_num_consumers = max_num_consumers;
-
- for (i=0; i<size; i++) {
- circular_buf->list[i].num_producers = 0;
- circular_buf->list[i].num_consumers = 0;
- circular_buf->list[i].num_consumers_accessed = 0;
- circular_buf->list[i].marked = 0;
- circular_buf->list[i].num_consumers_waiting = 0;
- circular_buf->list[i].consumers_semaphore = gf_sema_new(1000, 0);
- circular_buf->list[i].producers_semaphore = gf_sema_new(1000, 0);
- circular_buf->list[i].mutex = gf_mx_new("Circular Buffer Mutex");
- }
-}
-
-void dc_circular_buffer_destroy(CircularBuffer *circular_buf)
-{
- u32 i;
- for (i = 0; i < circular_buf->size; i++) {
- gf_sema_del(circular_buf->list[i].consumers_semaphore);
- gf_sema_del(circular_buf->list[i].producers_semaphore);
- gf_mx_del(circular_buf->list[i].mutex);
- }
-
- gf_free(circular_buf->list);
-}
-
-void dc_consumer_init(Consumer *consumer, int max_idx, char *name)
-{
- consumer->idx = 0;
- consumer->max_idx = max_idx;
- strcpy(consumer->name, name);
-}
-
-void * dc_consumer_consume(Consumer *consumer, CircularBuffer *circular_buf)
-{
- return circular_buf->list[consumer->idx].data;
-}
-
-int dc_consumer_lock(Consumer *consumer, CircularBuffer *circular_buf)
-{
- Node *node = &circular_buf->list[consumer->idx];
-
- gf_mx_p(node->mutex);
- if (node->marked == 2) {
- gf_mx_v(node->mutex);
- return -1;
- }
-
- node->num_consumers_waiting++;
- while (node->num_producers || !node->marked) {
- gf_mx_v(node->mutex);
- gf_sema_wait(node->consumers_semaphore);
- gf_mx_p(node->mutex);
-
- if (node->marked == 2) {
- gf_mx_v(node->mutex);
- return -1;
- }
- }
- node->num_consumers_waiting--;
-
- if (node->marked == 2) {
- gf_mx_v(node->mutex);
- return -1;
- }
- node->num_consumers++;
- node->num_consumers_accessed++;
- gf_mx_v(node->mutex);
-
- return 0;
-}
-
-int dc_consumer_unlock(Consumer *consumer, CircularBuffer *circular_buf)
-{
- int last_consumer = 0;
- Node *node = &circular_buf->list[consumer->idx];
-
- gf_mx_p(node->mutex);
- node->num_consumers--;
-
- if (node->num_consumers_accessed == circular_buf->max_num_consumers) {
- node->marked = 0;
- node->num_consumers_accessed = 0;
- last_consumer = 1;
- }
-
- gf_sema_notify(node->producers_semaphore, 1);
-
- gf_mx_v(node->mutex);
-
- return last_consumer;
-}
-
-int dc_consumer_unlock_previous(Consumer *consumer, CircularBuffer *circular_buf)
-{
- int node_idx = (consumer->idx - 1 + consumer->max_idx) % consumer->max_idx;
- int last_consumer = 0;
- Node *node = &circular_buf->list[node_idx];
-
- gf_mx_p(node->mutex);
-
- node->num_consumers--;
- if (node->num_consumers < 0)
- node->num_consumers = 0;
-
- if (node->num_consumers_accessed == circular_buf->max_num_consumers) {
- if (node->marked != 2)
- node->marked = 0;
- node->num_consumers_accessed = 0;
- last_consumer = 1;
- }
-
- gf_sema_notify(node->producers_semaphore, 1);
-
- gf_mx_v(node->mutex);
-
- return last_consumer;
-}
-
-void dc_consumer_advance(Consumer *consumer)
-{
- consumer->idx = (consumer->idx + 1) % consumer->max_idx;
-}
-
-void dc_producer_init(Producer *producer, int max_idx, char *name)
-{
- producer->idx = 0;
- producer->max_idx = max_idx;
- strcpy(producer->name, name);
-}
-
-void * dc_producer_produce(Producer *producer, CircularBuffer *circular_buf)
-{
- return circular_buf->list[producer->idx].data;
-}
-
-int dc_producer_lock(Producer *producer, CircularBuffer *circular_buf)
-{
- Node *node = &circular_buf->list[producer->idx];
-
- gf_mx_p(node->mutex);
-
- if ( (circular_buf->mode == LIVE_CAMERA || circular_buf->mode == LIVE_MEDIA) && (node->num_consumers || node->marked)) {
- gf_mx_v(node->mutex);
- return -1;
- }
-
- while (node->num_consumers || node->marked) {
- gf_mx_v(node->mutex);
- gf_sema_wait(node->producers_semaphore);
- gf_mx_p(node->mutex);
- }
-
- node->num_producers++;
- if (circular_buf->size>1) {
- node->marked = 1;
- }
-
- gf_mx_v(node->mutex);
-
- return 0;
-}
-
-void dc_producer_unlock(Producer *producer, CircularBuffer *circular_buf)
-{
- Node *node = &circular_buf->list[producer->idx];
-
- gf_mx_p(node->mutex);
- node->num_producers--;
- gf_sema_notify(node->consumers_semaphore, node->num_consumers_waiting);
- gf_mx_v(node->mutex);
-}
-
-void dc_producer_unlock_previous(Producer *producer, CircularBuffer *circular_buf)
-{
- int node_idx = (producer->idx - 1 + producer->max_idx) % producer->max_idx;
- Node *node = &circular_buf->list[node_idx];
-
- gf_mx_p(node->mutex);
- node->num_producers = 0;
- gf_sema_notify(node->consumers_semaphore, node->num_consumers_waiting);
- gf_mx_v(node->mutex);
-}
-
-void dc_producer_advance(Producer *producer, CircularBuffer *circular_buf)
-{
- if (circular_buf->size == 1) {
- Node *node = &circular_buf->list[producer->idx];
- gf_mx_p(node->mutex);
- node->marked = 1;
- gf_sema_notify(node->consumers_semaphore, node->num_consumers_waiting);
- gf_mx_v(node->mutex);
- }
- producer->idx = (producer->idx + 1) % producer->max_idx;
-}
-
-void dc_producer_end_signal(Producer *producer, CircularBuffer *circular_buf)
-{
- Node *node = &circular_buf->list[producer->idx];
-
- gf_mx_p(node->mutex);
- node->marked = 2;
- gf_sema_notify(node->consumers_semaphore, node->num_consumers_waiting);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("producer %s sends end signal %d \n", producer->name, producer->idx));
- gf_mx_v(node->mutex);
-}
-
-void dc_producer_end_signal_previous(Producer *producer, CircularBuffer *circular_buf)
-{
- int i_node = (producer->max_idx + producer->idx - 1) % producer->max_idx;
- Node *node = &circular_buf->list[i_node];
-
- gf_mx_p(node->mutex);
- node->marked = 2;
- gf_sema_notify(node->consumers_semaphore, node->num_consumers_waiting);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("producer %s sends end signal %d \n", producer->name, node));
- gf_mx_v(node->mutex);
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef CIRCULAR_BUFFER_H_
-#define CIRCULAR_BUFFER_H_
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <gpac/thread.h>
-
-
-/*
- * The method (mode) of multithread management.
- * It can be LIVE or OFFLINE.
- * LIVE means that the system is real time. The producer does not wait
- * for anyone and it always produces and finds a place on the circular buffer.
- * OFFLINE means that the system is working offline, so the producer can
- * wait for the consumers to finish their job.
- */
-typedef enum {
- LIVE_CAMERA,
- LIVE_MEDIA,
- ON_DEMAND
-} LockMode;
-
-/*
- * Every node of the circular buffer has a data, plus
- * all the variables needed for multithread management.
- */
-typedef struct {
- /* Pointer to the data on the node */
- void *data;
- /* The number of the producer currently using this node */
- int num_producers;
- /* The number of consumer currently using this node */
- int num_consumers;
- /* The number of consumer currently waiting for this node */
- int num_consumers_waiting;
- /* Mutex used for synchronizing the users of this node. */
- GF_Mutex *mutex;
- /* Semaphore for producer */
- GF_Semaphore *producers_semaphore;
- /* Semaphore for consumers */
- GF_Semaphore *consumers_semaphore;
- /* If marked is 0 it means the data on this node is not valid.
- * If marked is 1 it means that the data on this node is valid.
- * If marked is 2 it means this node is the last node. */
- int marked;
- /* Indicates the number of consumers which already accessed this node.
- * It is used for the case where the last consumer has to do something. */
- int num_consumers_accessed;
-} Node;
-
-/*
- * The circular buffer has a size, a list of nodes and it
- * has the number of consumers using it. Also it needs to know which
- * locking mechanism it needs to use. (LIVE or OFFLINE)
- */
-typedef struct {
- /* The size of circular buffer */
- u32 size;
- /* A list of all the nodes */
- Node *list;
- /* The mode for multithread management. */
- LockMode mode;
- /* The maximum number of the consumers using the circular buffer */
- u32 max_num_consumers;
-} CircularBuffer;
-
-/*
- * Producer has an index to the circular buffer.
- */
-typedef struct {
- /* The index where the producer is using */
- int idx;
- /* The maximum of the index. (Which means the size of circular buffer) */
- int max_idx;
-
- char name[GF_MAX_PATH];
-} Producer;
-
-/*
- * Consumer has an index to the circular buffer.
- */
-typedef struct {
- /* The index where the consumer is using */
- int idx;
- /* The maximum of the index. (Which means the size of circular buffer) */
- int max_idx;
-
- char name[GF_MAX_PATH];
-} Consumer;
-
-/*
- * Create a circular buffer
- *
- * @param circular_buf [out] circular buffer to be created
- * @param size [in] size of circular buffer
- * @param mode [in] mode of multithread management (LIVE or OFFLINE)
- * @param num_consumers [in] maximum number of the consumers of the circular buffer
- */
-void dc_circular_buffer_create(CircularBuffer *circular_buf, u32 size, LockMode mode, int num_consumers);
-
-/*
- * Destroy the circular buffer
- *
- * @param circular_buf [in] circular buffer to be destroyed
- */
-void dc_circular_buffer_destroy(CircularBuffer *circular_buf);
-
-/*
- * Initialize a consumer
- *
- * @param consumer [out] the consumer to be initialize
- * @param num_consumers [in] maximum number of the consumers
- */
-void dc_consumer_init(Consumer *consumer, int num_consumers, char *name);
-
-/*
- * Return the data in the node in question. (circular_buf[consumer index])
- *
- * @param consumer [in] consumer
- * @param circular_buf [in] circular buffer
- */
-void * dc_consumer_consume(Consumer *consumer, CircularBuffer *circular_buf);
-
-/*
- * Consumer lock on circular buffer
- *
- * @param consumer [in] consumer
- * @param circular_buf [in] circular buffer
- *
- * @return 0 on success, -1 if the node in question is the last node and not usable.
- */
-int dc_consumer_lock(Consumer *consumer, CircularBuffer *circular_buf);
-
-/*
- * Consumer unlock on circular buffer
- *
- * @param consumer [in] consumer
- * @param circular_buf [in] circular buffer
- *
- * @return 0 on normal exit, 1 if the consumer unlocking this node is the last consumer.
- */
-int dc_consumer_unlock(Consumer *consumer, CircularBuffer *circular_buf);
-
-/*
- * Consumer unlock on previous node of the circular buffer
- *
- * @param consumer [in] consumer
- * @param circular_buf [in] circular buffer
- *
- * @return 0 on normal exit, 1 if the consumer unlocking this node is the last consumer.
- */
-int dc_consumer_unlock_previous(Consumer *consumer, CircularBuffer *circular_buf);
-
-/*
- * Consumer leads its index
- *
- * @param consumer [in] consumer
- */
-void dc_consumer_advance(Consumer *consumer);
-
-/*
- * Initialize a producer
- *
- * @param producer [out] the producer to be initialize
- * @param maxpro [in] maximum number of the producers
- */
-void dc_producer_init(Producer *producer, int maxpro, char *name);
-
-/*
- * Return the data in the node in question. (circular_buf[consumer index])
- *
- * @param producer [in] producer
- * @param circular_buf [in] circular buffer
- */
-void * dc_producer_produce(Producer *producer, CircularBuffer *circular_buf);
-
-/*
- * Producer lock on circular buffer
- *
- * @param producer [in] producer
- * @param circular_buf [in] circular buffer
- *
- * @return 0 on success, -1 if the mode is live and cannot wait.
- */
-int dc_producer_lock(Producer *producer, CircularBuffer *circular_buf);
-
-/*
- * Producer unlock on circular buffer
- *
- * @param producer [in] producer
- * @param circular_buf [in] circular buffer
- */
-void dc_producer_unlock(Producer *producer, CircularBuffer *circular_buf);
-
-/*
- * Producer unlock on the previous node of the circular buffer
- *
- * @param producer [in] producer
- * @param circular_buf [in] circular buffer
- */
-void dc_producer_unlock_previous(Producer *, CircularBuffer *);
-
-/*
- * Producer leads its index
- *
- * @param producer [in] producer
- * @param circular_buf [in] circular buffer
- */
-void dc_producer_advance(Producer *producer, CircularBuffer *);
-
-/*
- * Producer signal that the current node is the last node
- *
- * @param producer [in] producer
- * @param circular_buf [in] circular buffer
- */
-void dc_producer_end_signal(Producer *producer, CircularBuffer *circular_buf);
-
-void dc_producer_end_signal_previous(Producer *producer, CircularBuffer *circular_buf);
-
-#endif /* CIRCULAR_BUFFER_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "cmd_data.h"
-
-
-#define DASHCAST_CHECK_NEXT_ARG \
- i++; \
- if (i >= argc) { \
- fprintf(stderr, "%s: %s", command_error, argv[i]); \
- fprintf(stderr, "%s", command_usage); \
- return -1; \
- }
-
-
-int dc_str_to_resolution(char *str, int *width, int *height)
-{
- char *token = strtok(str, "x");
- if (!token) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot parse resolution string.\n"));
- return -1;
- }
- *width = atoi(token);
-
- token = strtok(NULL, " ");
- if (!token) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot parse resolution string.\n"));
- return -1;
- }
- *height = atoi(token);
-
- return 0;
-}
-
-
-#define DEFAULT_VIDEO_BITRATE 1000000
-#define DEFAULT_VIDEO_FRAMERATE 25
-#define DEFAULT_VIDEO_WIDTH 640
-#define DEFAULT_VIDEO_HEIGHT 480
-#define DEFAULT_VIDEO_CODEC "libx264"
-#define DEFAULT_AUDIO_BITRATE 192000
-#define DEFAULT_AUDIO_SAMPLERATE 44100
-#define DEFAULT_AUDIO_CHANNELS 2
-#define DEFAULT_AUDIO_CODEC "aac"
-
-
-static void dc_create_configuration(CmdData *cmd_data)
-{
- u32 i;
- GF_Config *conf = cmd_data->conf;
- u32 sec_count = gf_cfg_get_section_count(conf);
- if (!sec_count) {
- gf_cfg_set_key(conf, "v1", "type", "video");
- gf_cfg_set_key(conf, "a1", "type", "audio");
- sec_count = gf_cfg_get_section_count(conf);
- }
- for (i=0; i<sec_count; i++) {
- char value[GF_MAX_PATH];
- const char *section_name = gf_cfg_get_section_name(conf, i);
- const char *section_type = gf_cfg_get_key(conf, section_name, "type");
-
- if (strcmp(section_type, "video") == 0) {
- if (!gf_cfg_get_key(conf, section_name, "bitrate")) {
- if (cmd_data->video_data_conf.bitrate == -1)
- cmd_data->video_data_conf.bitrate = DEFAULT_VIDEO_BITRATE;
- snprintf(value, sizeof(value), "%d", cmd_data->video_data_conf.bitrate);
- gf_cfg_set_key(conf, section_name, "bitrate", value);
- }
-
- if (!gf_cfg_get_key(conf, section_name, "framerate")) {
- if (cmd_data->video_data_conf.framerate == -1)
- cmd_data->video_data_conf.framerate = DEFAULT_VIDEO_FRAMERATE;
- snprintf(value, sizeof(value), "%d", cmd_data->video_data_conf.framerate);
- gf_cfg_set_key(conf, section_name, "framerate", value);
- }
-
- if (!gf_cfg_get_key(conf, section_name, "width")) {
- if (cmd_data->video_data_conf.width == -1)
- cmd_data->video_data_conf.width = DEFAULT_VIDEO_WIDTH;
- snprintf(value, sizeof(value), "%d", cmd_data->video_data_conf.width);
- gf_cfg_set_key(conf, section_name, "width", value);
- }
-
- if (!gf_cfg_get_key(conf, section_name, "height")) {
- if (cmd_data->video_data_conf.height == -1)
- cmd_data->video_data_conf.height = DEFAULT_VIDEO_HEIGHT;
- snprintf(value, sizeof(value), "%d", cmd_data->video_data_conf.height);
- gf_cfg_set_key(conf, section_name, "height", value);
- }
-
- if (!gf_cfg_get_key(conf, section_name, "crop_x")) {
- if (cmd_data->video_data_conf.crop_x == -1)
- cmd_data->video_data_conf.crop_x = 0;
- snprintf(value, sizeof(value), "%d", cmd_data->video_data_conf.crop_x);
- gf_cfg_set_key(conf, section_name, "crop_x", value);
- }
- if (!gf_cfg_get_key(conf, section_name, "low_delay")) {
- gf_cfg_set_key(conf, section_name, "low_delay", cmd_data->video_data_conf.low_delay ? "yes" : "no");
- }
-
- if (!gf_cfg_get_key(conf, section_name, "crop_y")) {
- if (cmd_data->video_data_conf.crop_y == -1)
- cmd_data->video_data_conf.crop_y = 0;
- snprintf(value, sizeof(value), "%d", cmd_data->video_data_conf.crop_y);
- gf_cfg_set_key(conf, section_name, "crop_y", value);
- }
-
- if (!gf_cfg_get_key(conf, section_name, "codec"))
- gf_cfg_set_key(conf, section_name, "codec", DEFAULT_VIDEO_CODEC);
- }
-
- if (strcmp(section_type, "audio") == 0) {
- if (!gf_cfg_get_key(conf, section_name, "bitrate")) {
- if (cmd_data->audio_data_conf.bitrate == -1)
- cmd_data->audio_data_conf.bitrate = DEFAULT_AUDIO_BITRATE;
- snprintf(value, sizeof(value), "%d", cmd_data->audio_data_conf.bitrate);
- gf_cfg_set_key(conf, section_name, "bitrate", value);
- }
-
- if (!gf_cfg_get_key(conf, section_name, "samplerate")) {
- if (cmd_data->audio_data_conf.samplerate == -1)
- cmd_data->audio_data_conf.samplerate = DEFAULT_AUDIO_SAMPLERATE;
- snprintf(value, sizeof(value), "%d", cmd_data->audio_data_conf.samplerate);
- gf_cfg_set_key(conf, section_name, "samplerate", value);
- }
-
- if (!gf_cfg_get_key(conf, section_name, "channels")) {
- if (cmd_data->audio_data_conf.channels == -1)
- cmd_data->audio_data_conf.channels = DEFAULT_AUDIO_CHANNELS;
- snprintf(value, sizeof(value), "%d", cmd_data->audio_data_conf.channels);
- gf_cfg_set_key(conf, section_name, "channels", value);
- }
-
- if (!gf_cfg_get_key(conf, section_name, "codec")) {
- if (strlen(cmd_data->audio_data_conf.codec))
- gf_cfg_set_key(conf, section_name, "codec", cmd_data->audio_data_conf.codec);
- else
- gf_cfg_set_key(conf, section_name, "codec", DEFAULT_AUDIO_CODEC);
- }
- }
- }
-}
-
-int dc_read_configuration(CmdData *cmd_data)
-{
- const char *opt;
- u32 i;
- GF_Config *conf = cmd_data->conf;
-
- u32 sec_count = gf_cfg_get_section_count(conf);
- for (i=0; i<sec_count; i++) {
- const char *section_name = gf_cfg_get_section_name(conf, i);
- const char *section_type = gf_cfg_get_key(conf, section_name, "type");
-
- if (strcmp(section_type, "video") == 0) {
- VideoDataConf *video_data_conf;
- GF_SAFEALLOC(video_data_conf, VideoDataConf);
- strcpy(video_data_conf->filename, section_name);
- opt = gf_cfg_get_key(conf, section_name, "codec");
- if (!opt) opt = DEFAULT_VIDEO_CODEC;
- strcpy(video_data_conf->codec, opt);
- opt = gf_cfg_get_key(conf, section_name, "bitrate");
- video_data_conf->bitrate = opt ? atoi(opt) : DEFAULT_VIDEO_BITRATE;
- opt = gf_cfg_get_key(conf, section_name, "framerate");
- video_data_conf->framerate = opt ? atoi(opt) : DEFAULT_VIDEO_FRAMERATE;
- opt = gf_cfg_get_key(conf, section_name, "height");
- video_data_conf->height = opt ? atoi(opt) : DEFAULT_VIDEO_HEIGHT;
- opt = gf_cfg_get_key(conf, section_name, "width");
- video_data_conf->width = opt ? atoi(opt) : DEFAULT_VIDEO_WIDTH;
- opt = gf_cfg_get_key(conf, section_name, "crop_x");
- video_data_conf->crop_x = opt ? atoi(opt) : 0;
- opt = gf_cfg_get_key(conf, section_name, "crop_y");
- video_data_conf->crop_x = opt ? atoi(opt) : 0;
- opt = gf_cfg_get_key(conf, section_name, "low_delay");
- video_data_conf->low_delay = (opt && !strcmp(opt, "yes")) ? 1 : 0;
- opt = gf_cfg_get_key(conf, section_name, "custom");
- if (opt) {
- if (strlen(opt) >= GF_MAX_PATH)
- fprintf(stderr, "Warning: video custom opt is too long. Truncating.\n");
- strncpy(video_data_conf->custom, opt, GF_MAX_PATH-1);
- }
- gf_list_add(cmd_data->video_lst, (void *) video_data_conf);
- }
- else if (strcmp(section_type, "audio") == 0)
- {
- AudioDataConf *audio_data_conf;
- GF_SAFEALLOC(audio_data_conf, AudioDataConf);
- strcpy(audio_data_conf->filename, section_name);
- opt = gf_cfg_get_key(conf, section_name, "codec");
- if (!opt) opt = DEFAULT_AUDIO_CODEC;
- strcpy(audio_data_conf->codec, opt);
- opt = gf_cfg_get_key(conf, section_name, "bitrate");
- audio_data_conf->bitrate = opt ? atoi(opt) : DEFAULT_AUDIO_BITRATE;
- opt = gf_cfg_get_key(conf, section_name, "samplerate");
- audio_data_conf->samplerate = opt ? atoi(opt) : DEFAULT_AUDIO_SAMPLERATE;
- opt = gf_cfg_get_key(conf, section_name, "channels");
- audio_data_conf->channels = opt ? atoi(opt) : DEFAULT_AUDIO_CHANNELS;
- opt = gf_cfg_get_key(conf, section_name, "custom");
- if (opt) {
- if (strlen(opt) >= GF_MAX_PATH)
- fprintf(stderr, "Warning: audio custom opt is too long. Truncating.\n");
- strncpy(audio_data_conf->custom, opt, GF_MAX_PATH-1);
- }
- gf_list_add(cmd_data->audio_lst, (void *) audio_data_conf);
- } else {
- fprintf(stderr, "Configuration file: type %s is not supported.\n", section_type);
- }
- }
-
- fprintf(stdout, "\33[34m\33[1m");
- fprintf(stdout, "Configurations:\n");
- for (i=0; i<gf_list_count(cmd_data->video_lst); i++) {
- VideoDataConf *video_data_conf = (VideoDataConf*)gf_list_get(cmd_data->video_lst, i);
- fprintf(stdout, " id:%s\tres:%dx%d\tvbr:%d\n", video_data_conf->filename,
- video_data_conf->width, video_data_conf->height,
- video_data_conf->bitrate/*, video_data_conf->framerate, video_data_conf->codec*/);
- }
-
- for (i=0; i<gf_list_count(cmd_data->audio_lst); i++) {
- AudioDataConf *audio_data_conf = (AudioDataConf*)gf_list_get(cmd_data->audio_lst, i);
- fprintf(stdout, " id:%s\tabr:%d\n", audio_data_conf->filename, audio_data_conf->bitrate/*, audio_data_conf->samplerate, audio_data_conf->channels,audio_data_conf->codec*/);
- }
- fprintf(stdout, "\33[0m");
- fflush(stdout);
-
- return 0;
-}
-
-/**
- * Parse time from a string to a struct tm.
- */
-static Bool parse_time(const char* str_time, struct tm *tm_time)
-{
- if (!tm_time)
- return GF_FALSE;
-
-#if defined(__GNUC__)
- strptime(str_time, "%Y-%m-%d %H:%M:%S", tm_time);
-#elif defined(WIN32)
- assert(0); //TODO
-#else
-#error
-#endif
-
- return GF_TRUE;
-}
-
-int dc_read_switch_config(CmdData *cmd_data)
-{
- u32 i;
- int src_number;
- char start_time[4096], end_time[4096];
-
- time_t now_t = time(NULL);
- struct tm start_tm = *localtime(&now_t);
- struct tm end_tm = *localtime(&now_t);
-
- GF_Config *conf = cmd_data->switch_conf;
- u32 sec_count = gf_cfg_get_section_count(conf);
-
- dc_task_init(&cmd_data->task_list);
-
- if (sec_count == 0) {
- return 0;
- }
-
- for (i = 0; i < sec_count; i++) {
- const char *section_name = gf_cfg_get_section_name(conf, i);
- const char *section_type = gf_cfg_get_key(conf, section_name, "type");
-
- if (strcmp(section_type, "video") == 0) {
- VideoDataConf *video_data_conf = (VideoDataConf*)gf_malloc(sizeof(VideoDataConf));
-
- strcpy(video_data_conf->source_id, section_name);
- strcpy(video_data_conf->filename, gf_cfg_get_key(conf, section_name, "source"));
-
- strcpy(start_time, gf_cfg_get_key(conf, section_name, "start"));
- parse_time(start_time, &start_tm);
- video_data_conf->start_time = mktime(&start_tm);
- strcpy(end_time, gf_cfg_get_key(conf, section_name, "end"));
- parse_time(end_time, &end_tm);
- video_data_conf->end_time = mktime(&end_tm);
-
- gf_list_add(cmd_data->vsrc, (void *) video_data_conf);
-
- src_number = gf_list_count(cmd_data->vsrc);
-
- dc_task_add(&cmd_data->task_list, src_number, video_data_conf->source_id, video_data_conf->start_time, video_data_conf->end_time);
- }
- else if (strcmp(section_type, "audio") == 0)
- {
- AudioDataConf *audio_data_conf = (AudioDataConf*)gf_malloc(sizeof(AudioDataConf));
- strcpy(audio_data_conf->source_id, section_name);
- strcpy(audio_data_conf->filename, gf_cfg_get_key(conf, section_name, "source"));
-
- strcpy(start_time, gf_cfg_get_key(conf, section_name, "start"));
- parse_time(start_time, &start_tm);
- audio_data_conf->start_time = mktime(&start_tm);
-
- strcpy(end_time, gf_cfg_get_key(conf, section_name, "end"));
- parse_time(end_time, &end_tm);
- audio_data_conf->end_time = mktime(&end_tm);
-
- gf_list_add(cmd_data->asrc, (void *) audio_data_conf);
- } else {
- fprintf(stdout, "Switch source configuration file: type %s is not supported.\n", section_type);
- }
- }
-
- fprintf(stdout, "\33[34m\33[1m");
- fprintf(stdout, "Sources:\n");
- for (i=0; i<gf_list_count(cmd_data->vsrc); i++) {
- VideoDataConf *video_data_conf = (VideoDataConf*)gf_list_get(cmd_data->vsrc, i);
- strftime(start_time, 20, "%Y-%m-%d %H:%M:%S", localtime(&video_data_conf->start_time));
- strftime(end_time, 20, "%Y-%m-%d %H:%M:%S", localtime(&video_data_conf->end_time));
- fprintf(stdout, " id:%s\tsource:%s\tstart:%s\tend:%s\n", video_data_conf->source_id, video_data_conf->filename, start_time, end_time);
- }
-
- for (i=0; i<gf_list_count(cmd_data->asrc); i++) {
- AudioDataConf *audio_data_conf = (AudioDataConf*)gf_list_get(cmd_data->asrc, i);
- strftime(start_time, 20, "%Y-%m-%d %H:%M:%S", localtime(&audio_data_conf->start_time));
- strftime(end_time, 20, "%Y-%m-%d %H:%M:%S", localtime(&audio_data_conf->end_time));
- fprintf(stdout, " id:%s\tsource:%s\tstart:%s\tend:%s\n", audio_data_conf->source_id, audio_data_conf->filename, start_time, end_time);
- }
- fprintf(stdout, "\33[0m");
- fflush(stdout);
-
- return 0;
-}
-
-void dc_cmd_data_init(CmdData *cmd_data)
-{
- memset(cmd_data, 0, sizeof(CmdData));
- dc_audio_data_set_default(&cmd_data->audio_data_conf);
- dc_video_data_set_default(&cmd_data->video_data_conf);
-
- cmd_data->mode = ON_DEMAND;
- cmd_data->ast_offset = -1;
- cmd_data->min_buffer_time = -1;
- cmd_data->minimum_update_period = -1;
- cmd_data->use_source_timing = GF_TRUE;
-
- cmd_data->audio_lst = gf_list_new();
- cmd_data->video_lst = gf_list_new();
- cmd_data->asrc = gf_list_new();
- cmd_data->vsrc = gf_list_new();
-}
-
-void dc_cmd_data_destroy(CmdData *cmd_data)
-{
- while (gf_list_count(cmd_data->audio_lst)) {
- AudioDataConf *audio_data_conf = (AudioDataConf*)gf_list_last(cmd_data->audio_lst);
- gf_list_rem_last(cmd_data->audio_lst);
- gf_free(audio_data_conf);
- }
- gf_list_del(cmd_data->audio_lst);
-
- while (gf_list_count(cmd_data->video_lst)) {
- VideoDataConf *video_data_conf = (VideoDataConf*)gf_list_last(cmd_data->video_lst);
- gf_list_rem_last(cmd_data->video_lst);
- gf_free(video_data_conf);
- }
- gf_list_del(cmd_data->video_lst);
-
- gf_list_del(cmd_data->asrc);
- gf_list_del(cmd_data->vsrc);
- gf_cfg_del(cmd_data->conf);
- gf_cfg_del(cmd_data->switch_conf);
- if (cmd_data->logfile)
- gf_fclose(cmd_data->logfile);
-
- dc_task_destroy(&cmd_data->task_list);
-
- gf_sys_close();
-}
-
-static void on_dc_log(void *cbk, GF_LOG_Level ll, GF_LOG_Tool lm, const char *av_fmt_ctx, va_list list)
-{
- FILE *logs = (FILE*)cbk;
- vfprintf(logs, av_fmt_ctx, list);
- fflush(logs);
-}
-
-int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
-{
- GF_MemTrackerType mem_track = GF_MemTrackerNone;
- int i;
-
- const char *command_usage =
- "Usage: DashCast [options]\n"
- "GPAC version " GPAC_FULL_VERSION"\n"
- "\n"
- "General options:\n"
- " -log-file filename set output log file. Also works with -lf\n"
- " -logs LOGS set log tools and levels, formatted as a ':'-separated list of toolX[:toolZ]@levelX\n"
-#ifdef GPAC_MEMORY_TRACKING
- " -mem-track enable the memory tracker\n"
- " -mem-track-stack enable the memory tracker with stack dumping\n"
-#endif
- " -conf filename set the configuration file name (default: dashcast.conf)\n"
- " -switch-source filename set the configuration file name for source switching\n"
- "\n"
- "Live options:\n"
- " -live system is live and input is a camera\n"
- " -live-media system is live and input is a media file\n"
- " -no-loop system does not loop on the input media file when live\n"
- " -dynamic-ast changes segment availability start time at each MPD generation (old behaviour but not allowed in most profiles)\n"
- " -insert-utc inserts UTC clock at the start of each segment\n"
- " -no-rewrite Do not rewrite the MPD as a static one at the end of the live session\n"
- "\n"
- "Source options:\n"
- " -npts use frame counting for timestamps (not error-free) instead of source timing (default)\n"
- " -av string set the source name for a multiplexed audio and video input\n"
- " - if this option is present, neither '-a' nor '-v' shall be present\n"
- "* Video options:\n"
- " -v string set the source name for a video input\n"
- " - if input is from a webcam, use \"/dev/video[x]\" \n"
- " where x is the video device number\n"
- " - if input is the screen video, use \":0.0+[x],[y]\" \n"
- " which captures from upper-left at x,y\n"
- " - if input is from stdin, use \"pipe:\"\n"
- " -vf string set the input video format\n"
-#ifdef WIN32
- " - to capture from a directshow device, set dshow\n"
-#else
- " - to capture from a webcam, set video4linux2\n"
- " - to capture the screen, set x11grab\n"
- " -v4l2f inv4l2f inv4l2f is the input format for webcam acquisition\n"
- " - it can be mjpeg, yuyv422, etc.\n"
-#endif
- " -pixf FMT set the input pixel format\n"
- " -vfr N force the input video framerate\n"
- " -vres WxH force the video resolution (e.g. 640x480)\n"
- " -vcrop XxY crop the source video from X pixels left and Y pixels top. Must be used with -vres.\n"
- " -demux-buffer SIZE sets demux buffer size to SIZE.\n"
- "* Audio options:\n"
- " -a string set the source name for an audio input\n"
- " - if input is from microphone, use \"plughw:[x],[y]\"\n"
- " where x is the card number and y is the device number\n"
- " -af string set the input audio format\n"
- "\n"
- "Output options:\n"
- "* Video encoding options:\n"
- " -vcodec string set the output video codec (default: h264)\n"
-#if 0 //TODO: bind to option and params - test first how it binds to current input parameters
- " -vb int set the output video bitrate (in bits)\n"
-#endif
- " -vcustom string send custom parameters directly to the video encoder\n"
- " -gdr use Gradual Decoder Refresh feature for video encoding (h264 codec only)\n"
- " -gop specify GOP size in frames - default is framerate (1 sec gop)\n"
- " -low-delay specify that low delay settings should be used (no B-frames, fast encoding)\n"
- "* Audio encoding options:\n"
- " -acodec string set the output audio codec (default: aac)\n"
-#if 0 //TODO: bind to option and params - test first how it binds to current input parameters
- " -ab int set the output audio bitrate in bits (default: 192000)\n"
- " -as int set the sample rate (default: 44100)\n"
- " -ach int set the number of output audio channels (default: 2)\n"
-#endif
- " -acustom string send custom parameters directly to the audio encoder\n"
- "\n"
- "DASH options:\n"
- " -seg-dur dur:int set the segment duration in millisecond (default value: 1000)\n"
- " -frag dur:int set the fragment duration in millisecond (default value: 1000) (same as -frag-dur)\n"
- " -seg-marker marker:4cc add a marker box named marker at the end of DASH segment\n"
- " -out outdir:str outdir is the output data directory (default: output)\n"
- " -mpd mpdname:str mpdname is the MPD file name (default: dashcast.mpd)\n"
- " -ast-offset dur:int dur is the MPD availabilityStartTime shift in milliseconds (default value: 0)\n"
- " -mpd-refresh dur:int dur is the MPD minimumUpdatePeriod in seconds\n"
- " -time-shift dur:int dur is the MPD TimeShiftBufferDepth in seconds\n"
- " - the default value is 10. Specify -1 to keep all files.\n"
- " -min-buffer dur:float dur is the MPD minBufferTime in seconds (default value: 1.0)\n"
- " -base-url baseurl:str baseurl is the MPD BaseURL\n"
- "\n"
- "\n"
- "Examples:\n"
- "\n"
- " DashCast -av test.avi -live-media\n"
- " DashCast -a test_audio.mp3 -v test_audio.mp4 -live-media\n"
-#ifdef WIN32
- " DashCast -vf dshow -vres 1280x720 -vfr 24 -v video=\"screen-capture-recorder\" -live (please install http://screencapturer.sf.net/)\n"
- " DashCast -vf dshow -vres 1280x720 -vfr 24 -v video=\"YOUR-WEBCAM\" -pixf yuv420p -live (see https://trac.ffmpeg.org/wiki/DirectShow)\n"
-#elif defined(__DARWIN) || defined(__APPLE__)
- " DashCast -vf avfoundation -vres 1280x720 -v \"FaceTime HD Camera\" -vfr 25 -live\n"
- " DashCast -vf avfoundation -vres 1280x720 -v \"Capture screen 0\" -vfr 25 -live\n"
-#else
- " DashCast -vf video4linux2 -vres 1280x720 -vfr 24 -v4l2f mjpeg -v /dev/video0 -af alsa -a plughw:1,0 -live\n"
- " DashCast -vf x11grab -vres 800x600 -vfr 25 -v :0.0 -live\n"
-#endif
- "\n";
-
- const char *command_error = "\33[31mUnknown option or missing mandatory argument.\33[0m\n";
-
- if (argc == 1) {
- fprintf(stderr, "%s", command_usage);
- return -2;
- }
-
-#ifdef GPAC_MEMORY_TRACKING
- i = 1;
- while (i < argc) {
- if (strcmp(argv[i], "-mem-track") == 0) {
- mem_track = GF_MemTrackerSimple;
- break;
- }
- else if (strcmp(argv[i], "-mem-track-stack") == 0) {
- mem_track = GF_MemTrackerBackTrace;
- break;
- }
- i++;
- }
-#endif
-
- gf_sys_init(mem_track);
-
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_WARNING);
- if (mem_track) {
- gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
- }
-
- /* Initialize command data */
- dc_cmd_data_init(cmd_data);
- cmd_data->mem_track = mem_track;
-
- i = 1;
- while (i < argc) {
- if (strcmp(argv[i], "-a") == 0 || strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "-av") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (strcmp(argv[i - 1], "-a") == 0 || strcmp(argv[i - 1], "-av") == 0) {
- if (strcmp(cmd_data->audio_data_conf.filename, "") != 0) {
- fprintf(stderr, "Audio source has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- strcpy(cmd_data->audio_data_conf.filename, argv[i]);
- }
-
- if (strcmp(argv[i - 1], "-v") == 0 || strcmp(argv[i - 1], "-av") == 0) {
- if (strcmp(cmd_data->video_data_conf.filename, "") != 0) {
- fprintf(stderr, "Video source has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- strcpy(cmd_data->video_data_conf.filename, argv[i]);
- }
-
- i++;
- } else if (strcmp(argv[i], "-af") == 0 || strcmp(argv[i], "-vf") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (strcmp(argv[i - 1], "-af") == 0) {
- if (strcmp(cmd_data->audio_data_conf.format, "") != 0) {
- fprintf(stderr, "Audio format has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- strcpy(cmd_data->audio_data_conf.format, argv[i]);
- }
- if (strcmp(argv[i - 1], "-vf") == 0) {
- if (strcmp(cmd_data->video_data_conf.format, "") != 0) {
- fprintf(stderr, "Video format has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- strcpy(cmd_data->video_data_conf.format, argv[i]);
- }
- i++;
- } else if (strcmp(argv[i], "-pixf") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (strcmp(cmd_data->video_data_conf.pixel_format, "") != 0) {
- fprintf(stderr, "Input pixel format has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- strcpy(cmd_data->video_data_conf.pixel_format, argv[i]);
- i++;
- } else if (strcmp(argv[i], "-vfr") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->video_data_conf.framerate != -1) {
- fprintf(stderr, "Video framerate has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- cmd_data->video_data_conf.framerate = atoi(argv[i]);
- i++;
- } else if (strcmp(argv[i], "-vres") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->video_data_conf.height != -1 && cmd_data->video_data_conf.width != -1) {
- fprintf(stderr, "Video resolution has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- dc_str_to_resolution(argv[i], &cmd_data->video_data_conf.width, &cmd_data->video_data_conf.height);
- i++;
- } else if (strcmp(argv[i], "-vcrop") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->video_data_conf.crop_x && cmd_data->video_data_conf.crop_y) {
- fprintf(stderr, "Video crop has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- dc_str_to_resolution(argv[i], &cmd_data->video_data_conf.crop_x, &cmd_data->video_data_conf.crop_y);
- i++;
- } else if (strcmp(argv[i], "-vcodec") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (strcmp(cmd_data->video_data_conf.codec, "") != 0) {
- fprintf(stderr, "Video codec has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- strncpy(cmd_data->video_data_conf.codec, argv[i], GF_MAX_PATH-1);
- i++;
- } else if (strcmp(argv[i], "-vcustom") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (strlen(cmd_data->video_data_conf.custom)) {
- fprintf(stderr, "Video custom has already been specified: appending\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- if (strlen(argv[i]) >= GF_MAX_PATH)
- fprintf(stderr, "Warning: video custom is too long. Truncating.\n");
- strncpy(cmd_data->video_data_conf.custom, argv[i], GF_MAX_PATH-1);
- i++;
- } else if (strcmp(argv[i], "-acodec") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (strcmp(cmd_data->audio_data_conf.codec, "") != 0) {
- fprintf(stderr, "Audio codec has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- strncpy(cmd_data->audio_data_conf.codec, argv[i], GF_MAX_PATH-1);
- i++;
- } else if (strcmp(argv[i], "-acustom") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (strlen(cmd_data->audio_data_conf.custom)) {
- fprintf(stderr, "Audio custom has already been specified: appending\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- if (strlen(argv[i]) >= GF_MAX_PATH)
- fprintf(stderr, "Warning: audio custom is too long. Truncating.\n");
- strncpy(cmd_data->audio_data_conf.custom, argv[i], GF_MAX_PATH-1);
- i++;
- } else if (strcmp(argv[i], "-conf") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- cmd_data->conf = gf_cfg_force_new(NULL, argv[i]);
- i++;
- } else if (strcmp(argv[i], "-switch-source") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- cmd_data->switch_conf = gf_cfg_force_new(NULL, argv[i]);
- i++;
- } else if (strcmp(argv[i], "-out") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- strcpy(cmd_data->out_dir, argv[i]);
- i++;
-#ifndef WIN32
- } else if (strcmp(argv[i], "-v4l2f") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- strcpy(cmd_data->video_data_conf.v4l2f, argv[i]);
- i++;
-#endif
- } else if (strcmp(argv[i], "-seg-marker") == 0) {
- char *m;
- DASHCAST_CHECK_NEXT_ARG
- m = argv[i];
- if (strlen(m) == 4) {
- cmd_data->seg_marker = GF_4CC(m[0], m[1], m[2], m[3]);
- } else {
- fprintf(stderr, "Invalid marker box name specified: %s\n", m);
- return -1;
- }
- i++;
- } else if (strcmp(argv[i], "-mpd") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (strcmp(cmd_data->mpd_filename, "") != 0) {
- fprintf(stderr, "MPD file has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- strncpy(cmd_data->mpd_filename, argv[i], GF_MAX_PATH-1);
- i++;
- } else if (strcmp(argv[i], "-seg-dur") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->seg_dur != 0) {
- fprintf(stderr, "Segment duration has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- cmd_data->seg_dur = atoi(argv[i]);
- i++;
- } else if ((strcmp(argv[i], "-frag-dur") == 0) || (strcmp(argv[i], "-frag") == 0)) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->frag_dur != 0) {
- fprintf(stderr, "Fragment duration has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- cmd_data->frag_dur = atoi(argv[i]);
- i++;
- } else if (strcmp(argv[i], "-ast-offset") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->ast_offset != -1) {
- fprintf(stderr, "AvailabilityStartTime offset has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- cmd_data->ast_offset = atoi(argv[i]);
- i++;
- } else if (strcmp(argv[i], "-mpd-refresh") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->minimum_update_period != -1) {
- fprintf(stderr, "minimumUpdatePeriod (mpd-refresh) has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- cmd_data->minimum_update_period = atoi(argv[i]);
- i++;
- } else if (strcmp(argv[i], "-time-shift") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->time_shift != 0) {
- fprintf(stderr, "TimeShiftBufferDepth has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- cmd_data->time_shift = atoi(argv[i]);
- i++;
- } else if (strcmp(argv[i], "-gop") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->gop_size != 0) {
- fprintf(stderr, "GOP size has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- cmd_data->gop_size = atoi(argv[i]);
- i++;
- } else if (strcmp(argv[i], "-min-buffer") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (cmd_data->min_buffer_time != -1) {
- fprintf(stderr, "Min Buffer Time has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- cmd_data->min_buffer_time = (float)atof(argv[i]);
- i++;
- } else if (strcmp(argv[i], "-demux-buffer") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- cmd_data->video_data_conf.demux_buffer_size = (int)atoi(argv[i]);
- i++;
- } else if (strcmp(argv[i], "-base-url") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (strcmp(cmd_data->base_url, "") != 0) {
- fprintf(stderr, "BaseURL has already been specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- strncpy(cmd_data->base_url, argv[i], GF_MAX_PATH-1);
- i++;
- } else if (strcmp(argv[i], "-low-delay") == 0) {
- cmd_data->video_data_conf.low_delay = 1;
- i++;
- } else if (strcmp(argv[i], "-live") == 0) {
- cmd_data->mode = LIVE_CAMERA;
- i++;
- } else if (strcmp(argv[i], "-npts") == 0) {
- cmd_data->use_source_timing = GF_FALSE;
- i++;
- } else if (strcmp(argv[i], "-live-media") == 0) {
- cmd_data->mode = LIVE_MEDIA;
- i++;
- } else if (strcmp(argv[i], "-no-loop") == 0) {
- cmd_data->no_loop = 1;
- i++;
- } else if (strcmp(argv[i], "-insert-utc") == 0) {
- cmd_data->insert_utc = 1;
- i++;
- } else if (strcmp(argv[i], "-no-rewrite") == 0) {
- cmd_data->no_mpd_rewrite = 1;
- i++;
- } else if (strcmp(argv[i], "-dynamic-ast") == 0) {
- cmd_data->use_dynamic_ast = 1;
- i++;
- } else if (strcmp(argv[i], "-send-message") == 0) {
- //FIXME: unreferenced option. Seems related to a separate fragment thread.
- cmd_data->send_message = 1;
- i++;
- } else if (strcmp(argv[i], "-logs") == 0) {
- DASHCAST_CHECK_NEXT_ARG
- if (gf_log_set_tools_levels(argv[i]) != GF_OK) {
- fprintf(stderr, "Invalid log format %s", argv[i]);
- return 1;
- }
- i++;
- } else if (!strcmp(argv[i], "-mem-track") || !strcmp(argv[i], "-mem-track-stack") ) {
- i++;
-#ifndef GPAC_MEMORY_TRACKING
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("WARNING - GPAC not compiled with Memory Tracker - ignoring \"%s\"\n", argv[i]));
-#endif
- } else if (!strcmp(argv[i], "-lf") || !strcmp(argv[i], "-log-file")) {
- DASHCAST_CHECK_NEXT_ARG
- cmd_data->logfile = gf_fopen(argv[i], "wt");
- gf_log_set_callback(cmd_data->logfile, on_dc_log);
- i++;
- } else if (strcmp(argv[i], "-gdr") == 0) {
- if ( (i+1 <= argc) && (argv[i+1][0] != '-')) {
- DASHCAST_CHECK_NEXT_ARG
- cmd_data->gdr = atoi(argv[i]);
- } else {
- //for historical reasons in dashcast
- cmd_data->gdr = 8;
- }
- i++;
- } else {
- fprintf(stderr, "%s: %s", command_error, argv[i]);
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- }
-
- if (strcmp(cmd_data->mpd_filename, "") == 0) {
- strcpy(cmd_data->mpd_filename, "dashcast.mpd");
- }
-
- if (strcmp(cmd_data->out_dir, "") == 0) {
- struct stat status;
- strcpy(cmd_data->out_dir, "output");
- if (stat(cmd_data->out_dir, &status) != 0) {
- gf_mkdir(cmd_data->out_dir);
- }
- }
-
- if (strcmp(cmd_data->video_data_conf.filename, "") == 0 && strcmp(cmd_data->audio_data_conf.filename, "") == 0) {
- fprintf(stderr, "Audio/Video source must be specified.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
-
- if (cmd_data->seg_dur == 0) {
- cmd_data->seg_dur = 1000;
- }
-
- if (cmd_data->frag_dur == 0) {
- cmd_data->frag_dur = cmd_data->seg_dur;
- }
-
- if (cmd_data->ast_offset == -1) {
- //generate MPD as soon as possible (no offset)
- cmd_data->ast_offset = 0;
- }
-
- if (cmd_data->mode == ON_DEMAND)
- cmd_data->time_shift = -1;
- else {
- if (cmd_data->time_shift == 0) {
- cmd_data->time_shift = 10;
- }
- }
-
- if (cmd_data->min_buffer_time == -1) {
- cmd_data->min_buffer_time = 1.0;
- }
-
- if ((cmd_data->minimum_update_period == -1) && (cmd_data->mode == LIVE_CAMERA)) {
- fprintf(stderr, "MPD refresh time not set in live - defaulting to segment duration\n");
- cmd_data->minimum_update_period = cmd_data->seg_dur / 1000;
- }
-
- //safety checks
- if (cmd_data->video_data_conf.crop_x || cmd_data->video_data_conf.crop_y) {
- if (cmd_data->video_data_conf.width == -1 && cmd_data->video_data_conf.height == -1) {
- fprintf(stderr, "You cannot use '-vcrop' without '-vres'. Please check usage.\n");
- fprintf(stderr, "%s", command_usage);
- return -1;
- }
- }
-
- fprintf(stdout, "\33[34m\33[1m");
- fprintf(stdout, "Options:\n");
- fprintf(stdout, " video source: %s\n", cmd_data->video_data_conf.filename);
- if (strcmp(cmd_data->video_data_conf.format, "") != 0) {
- fprintf(stdout, " video format: %s\n", cmd_data->video_data_conf.format);
- }
-#ifndef WIN32
- if (strcmp(cmd_data->video_data_conf.v4l2f, "") != 0) {
- fprintf(stdout, " v4l2 format: %s\n", cmd_data->video_data_conf.v4l2f);
- }
-#endif
- if (cmd_data->video_data_conf.framerate != -1) {
- fprintf(stdout, " video framerate: %d\n", cmd_data->video_data_conf.framerate);
- }
- if (cmd_data->video_data_conf.height != -1 && cmd_data->video_data_conf.width != -1) {
- fprintf(stdout, " video resolution: %dx%d\n", cmd_data->video_data_conf.width, cmd_data->video_data_conf.height);
- }
- if (cmd_data->video_data_conf.crop_x != -1 && cmd_data->video_data_conf.crop_y != -1) {
- fprintf(stdout, " video crop: %dx%d\n", cmd_data->video_data_conf.crop_x, cmd_data->video_data_conf.crop_y);
- }
-
- fprintf(stdout, " audio source: %s\n", cmd_data->audio_data_conf.filename);
- if (strcmp(cmd_data->audio_data_conf.format, "") != 0) {
- fprintf(stdout, " audio format: %s\n", cmd_data->audio_data_conf.format);
- }
- fprintf(stdout, "\33[0m");
- fflush(stdout);
-
- if (!cmd_data->conf) {
- cmd_data->conf = gf_cfg_force_new(NULL, "dashcast.conf");
- dc_create_configuration(cmd_data);
- }
- dc_read_configuration(cmd_data);
-
- if (!cmd_data->switch_conf) {
- cmd_data->switch_conf = gf_cfg_force_new(NULL, "switch.conf");
- }
- dc_read_switch_config(cmd_data);
-
- return 0;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef CMD_DATA_H_
-#define CMD_DATA_H_
-
-#define MAX_SOURCE_NUMBER 20
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <gpac/config_file.h>
-#include <gpac/list.h>
-#include "audio_data.h"
-#include "video_data.h"
-#include "task.h"
-
-
-/*
- * This structure corresponds to
- * the data in command line
- */
-typedef struct {
- /* input video */
- VideoDataConf video_data_conf;
- /* audio input data */
- AudioDataConf audio_data_conf;
- /* Configuration file */
- GF_Config *conf;
- /* Switch source configuration file */
- GF_Config *switch_conf;
- /* MPD file */
- char mpd_filename[GF_MAX_PATH];
- /* segment duration */
- int seg_dur;
- /* fragment duration */
- int frag_dur;
- /* Exit signal emitting from user to end the program */
- volatile int exit_signal;
- /* List of entries for video in configuration file */
- GF_List *video_lst;
- /* List of entries for audio in configuration file */
- GF_List *audio_lst;
- /* Indicates that the system is live */
- /* List of video input sources */
- GF_List *vsrc;
- /* List of audio input sources */
- GF_List *asrc;
- //int live;
- /* Indicates that the system is live from a media input */
- //int live_media;
- /* The mode of the system: ON_DEMAND, LIVE_CAMERA, LIVE_MEDIA */
- int mode;
- /* Does not loop on input */
- int no_loop;
- /* MPD AvailabilityStartTime offset in milliseconds. Default is 1000 milliseconds delay */
- int ast_offset;
- /* MPD time shift buffer depth in seconds */
- int time_shift;
- /* MPD minimumUpdatePeriod in seconds */
- int minimum_update_period;
- /* Send message on port 1234 once fragment is ready */
- int send_message;
- /* End of Segment Box name */
- u32 seg_marker;
- /* GDR */
- int gdr;
- /* GOP size in frames - 0 means framerate (1 sec)*/
- int gop_size;
- /* MPD min buffer time */
- float min_buffer_time;
- /* MPD BaseURL*/
- char base_url[GF_MAX_PATH];
- /* output directory name */
- char out_dir[GF_MAX_PATH];
- /* switch source configuration file */
- //char switch_cfg_filename[GF_MAX_PATH];
- FILE *logfile;
- TaskList task_list;
- /*dynamic ast*/
- int use_dynamic_ast;
- /*insert UTC */
- int insert_utc;
-
- Bool use_source_timing;
- GF_MemTrackerType mem_track;
- Bool no_mpd_rewrite;
-} CmdData;
-
-/*
- * Initilize the command data structure
- *
- * @param cmd_data [out] structure to be initialize
- */
-void dc_cmd_data_init(CmdData *cmd_data);
-
-/*
- * Destroy the command data structure
- *
- * @param cmd_data [out] structure to be destroyed
- */
-void dc_cmd_data_destroy(CmdData *cmd_data);
-
-/*
- * Parse command line
- *
- * @param argc [in] number of arguments
- * @param argv [in] a list of strings each containing one argument
- * @param cmd_data [out] the data structure to fill
- */
-int dc_parse_command(int argc, char **argv, CmdData *cmd_data);
-
-#endif /* CMD_DATA_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "controler.h"
-
-
-#if (!defined(__DARWIN__) && !defined(__APPLE__))
-# include <malloc.h>
-#endif
-
-#include <time.h>
-
-#if defined(__GNUC__)
-# include <unistd.h>
-# include <sys/time.h>
-#elif defined(WIN32)
-# include <Winsock.h>
-# include <sys/timeb.h>
-# define suseconds_t long
-#else
-# error
-#endif
-
-#include <gpac/network.h>
-
-typedef struct {
- int segnum;
- u64 utc_time, ntpts;
-} segtime;
-
-
-//#define MAX_SOURCE_NUMBER 20
-#define FRAGMENTER 0
-//#define DEBUG 1
-
-//#define VIDEO_MUXER FFMPEG_VIDEO_MUXER
-//#define VIDEO_MUXER RAW_VIDEO_H264
-//#define VIDEO_MUXER GPAC_VIDEO_MUXER
-#define VIDEO_MUXER GPAC_INIT_VIDEO_MUXER_AVC1
-//#define VIDEO_MUXER GPAC_INIT_VIDEO_MUXER_AVC3
-
-//#define AUDIO_MUXER FFMPEG_AUDIO_MUXER
-//#define AUDIO_MUXER GPAC_AUDIO_MUXER
-#define AUDIO_MUXER GPAC_INIT_AUDIO_MUXER
-
-#define AUDIO_FRAME_SIZE 1024
-
-
-void optimize_seg_frag_dur(int *seg, int *frag)
-{
- int min_rem;
- int seg_nb = *seg;
- int frag_nb = *frag;
- if (!frag_nb) frag_nb = 1;
-
- min_rem = seg_nb % frag_nb;
-
- if (seg_nb % (frag_nb + 1) < min_rem) {
- min_rem = seg_nb % (frag_nb + 1);
- *seg = seg_nb;
- *frag = frag_nb + 1;
- }
-
- if ((seg_nb + 1) % frag_nb < min_rem) {
- min_rem = (seg_nb + 1) % frag_nb;
- *seg = seg_nb + 1;
- *frag = frag_nb;
- }
-
- if ((seg_nb + 1) % (frag_nb + 1) < min_rem) {
- min_rem = (seg_nb + 1) % (frag_nb + 1);
- *seg = seg_nb + 1;
- *frag = frag_nb + 1;
- }
-
- *seg -= min_rem;
-}
-
-Bool change_source_thread(void *params)
-{
- Bool ret = GF_FALSE;
- return ret;
-}
-
-u32 send_frag_event(void *params)
-{
- int ret;
- //int status;
- char buff[GF_MAX_PATH];
- ThreadParam *th_param = (ThreadParam*)params;
- CmdData *cmd_data = th_param->in_data;
- MessageQueue *mq = th_param->mq;
-
- while (1) {
- if (cmd_data->exit_signal) {
- break;
- }
-
- ret = dc_message_queue_get(mq, (void*) buff);
- if (ret > 0) {
- fprintf(stdout, "Message received: %s\n", buff);
- }
- }
-
- return 0;
-}
-
-static void dc_write_mpd(CmdData *cmddata, const AudioDataConf *audio_data_conf, const VideoDataConf *video_data_conf, const char *presentation_duration, const char *availability_start_time, const char *time_shift, const int segnum, const int ast_offset)
-{
- u32 i = 0, sec;
- int audio_seg_dur = 0, video_seg_dur = 0, audio_frag_dur = 0, video_frag_dur = 0;
- int audio_frame_size = AUDIO_FRAME_SIZE;
- time_t gtime;
- struct tm *t;
- FILE *f;
-
- char name[GF_MAX_PATH];
-
- snprintf(name, sizeof(name), "%s/%s", cmddata->out_dir, cmddata->mpd_filename);
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Write MPD at UTC "LLU" ms - %s : %s\n", gf_net_get_utc(), (cmddata->mode == ON_DEMAND) ? "mediaPresentationDuration" : "availabilityStartTime", (cmddata->mode == ON_DEMAND) ? presentation_duration : availability_start_time));
-
- if (strcmp(cmddata->audio_data_conf.filename, "") != 0) {
- audio_data_conf = (const AudioDataConf*)gf_list_get(cmddata->audio_lst, 0);
- if (audio_data_conf) {
- audio_seg_dur = (int)((audio_data_conf->samplerate / (double) audio_frame_size) * (cmddata->seg_dur / 1000.0));
- audio_frag_dur = (int)((audio_data_conf->samplerate / (double) audio_frame_size) * (cmddata->frag_dur / 1000.0));
- optimize_seg_frag_dur(&audio_seg_dur, &audio_frag_dur);
- }
- }
-
- if (strcmp(cmddata->video_data_conf.filename, "") != 0) {
- video_data_conf = (VideoDataConf*)gf_list_get(cmddata->video_lst, 0);
- if (video_data_conf) {
- video_seg_dur = (int)(video_data_conf->framerate * (cmddata->seg_dur / 1000.0));
- video_frag_dur = (int)(video_data_conf->framerate * (cmddata->frag_dur / 1000.0));
- optimize_seg_frag_dur(&video_seg_dur, &video_frag_dur);
- }
- }
-
- f = gf_fopen(name, "w");
- //TODO: if (!f) ...
-
- // time_t t = time(NULL);
- // time_t t2 = t + 2;
- // t += (2 * (cmddata->seg_dur / 1000.0));
- // tm = *gmtime(&t2);
- // snprintf(availability_start_time, "%d-%d-%dT%d:%d:%dZ", tm.tm_year + 1900,
- // tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
- // fprintf(stdout, "%s \n", availability_start_time);
-
- fprintf(f, "<?xml version=\"1.0\"?>\n");
- fprintf(f, "<MPD xmlns=\"urn:mpeg:dash:schema:mpd:2011\" profiles=\"urn:mpeg:dash:profile:full:2011\" minBufferTime=\"PT%fS\"", cmddata->min_buffer_time);
-
- if (cmddata->mode == ON_DEMAND) {
- fprintf(f, " type=\"static\" mediaPresentationDuration=\"%s\"", presentation_duration);
- } else {
- fprintf(f, " type=\"dynamic\" availabilityStartTime=\"%s\"", availability_start_time);
- if (time_shift) fprintf(f, " timeShiftBufferDepth=\"%s\"", time_shift);
-
- if (cmddata->minimum_update_period > 0)
- fprintf(f, " minimumUpdatePeriod=\"PT%dS\"", cmddata->minimum_update_period);
-
- gf_net_get_ntp(&sec, NULL);
- gtime = sec - GF_NTP_SEC_1900_TO_1970;
- t = gmtime(>ime);
- fprintf(f, " publishTime=\"%d-%02d-%02dT%02d:%02d:%02dZ\"", 1900+t->tm_year, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
-
- }
-
- fprintf(f, ">\n");
-
- fprintf(f,
- " <ProgramInformation moreInformationURL=\"http://gpac.io\">\n"
- " <Title>%s</Title>\n"
- " </ProgramInformation>\n", cmddata->mpd_filename);
-
- if (strcmp(cmddata->base_url, "") != 0) {
- fprintf(f, " <BaseURL>%s</BaseURL>\n", cmddata->base_url);
- }
-
- fprintf(f, " <Period start=\"PT0H0M0.000S\" id=\"P1\">\n");
-
- if (strcmp(cmddata->audio_data_conf.filename, "") != 0) {
- fprintf(f, " <AdaptationSet segmentAlignment=\"true\" bitstreamSwitching=\"false\">\n");
-
- fprintf(f,
- " <AudioChannelConfiguration schemeIdUri=\"urn:mpeg:dash:23003:3:audio_channel_configuration:2011\" "
- "value=\"2\"/>\n");
-
- fprintf(f,
- " <SegmentTemplate timescale=\"%d\" duration=\"%d\" media=\"$RepresentationID$_$Number$_gpac.m4s\""
- " startNumber=\"%d\" initialization=\"$RepresentationID$_init_gpac.mp4\"",
- audio_data_conf->samplerate, audio_seg_dur * audio_frame_size, segnum);
-
- if (ast_offset<0) {
- fprintf(f, " availabilityTimeOffset=\"%g\"", -ast_offset/1000.0);
- }
- fprintf(f, "/>\n");
-
-
-
- for (i = 0; i < gf_list_count(cmddata->audio_lst); i++) {
- audio_data_conf = (const AudioDataConf*)gf_list_get(cmddata->audio_lst, i);
- fprintf(f,
- " <Representation id=\"%s\" mimeType=\"audio/mp4\" codecs=\"%s\" "
- "audioSamplingRate=\"%d\" startWithSAP=\"1\" bandwidth=\"%d\">\n"
- " </Representation>\n", audio_data_conf->filename, audio_data_conf->codec6381, audio_data_conf->samplerate, audio_data_conf->bitrate);
- }
-
- fprintf(f, " </AdaptationSet>\n");
- }
-
- if (strcmp(cmddata->video_data_conf.filename, "") != 0) {
- fprintf(f, " <AdaptationSet segmentAlignment=\"true\" bitstreamSwitching=\"false\">\n");
-
- fprintf(f,
- " <SegmentTemplate timescale=\"%d\" duration=\"%d\" media=\"$RepresentationID$_$Number$_gpac.m4s\""
- " startNumber=\"%d\" initialization=\"$RepresentationID$_init_gpac.mp4\"",
- video_data_conf->framerate, video_seg_dur, segnum);
-
-
- if (ast_offset<0) {
- fprintf(f, " availabilityTimeOffset=\"%g\"", -ast_offset/1000.0);
- }
- fprintf(f, "/>\n");
-
- for (i = 0; i < gf_list_count(cmddata->video_lst); i++) {
- video_data_conf = (VideoDataConf*)gf_list_get(cmddata->video_lst, i);
- fprintf(f, " <Representation id=\"%s\" mimeType=\"video/mp4\" codecs=\"%s\" "
- "width=\"%d\" height=\"%d\" frameRate=\"%d\" sar=\"1:1\" startWithSAP=\"1\" bandwidth=\"%d\">\n"
- " </Representation>\n", video_data_conf->filename,
- VIDEO_MUXER == GPAC_INIT_VIDEO_MUXER_AVC1 ? video_data_conf->codec6381 : "avc3",
- video_data_conf->width, video_data_conf->height, video_data_conf->framerate,
- video_data_conf->bitrate);
- }
-
- fprintf(f, " </AdaptationSet>\n");
- }
-
- fprintf(f, " </Period>\n");
-
- fprintf(f, "</MPD>\n");
-
- gf_fclose(f);
-}
-
-static u32 mpd_thread(void *params)
-{
- ThreadParam *th_param = (ThreadParam*)params;
- CmdData *cmddata = th_param->in_data;
- MessageQueue *mq = th_param->mq;
- char availability_start_time[GF_MAX_PATH];
- char presentation_duration[GF_MAX_PATH];
- char time_shift[GF_MAX_PATH] = "";
- AudioDataConf *audio_data_conf = NULL;
- VideoDataConf *video_data_conf = NULL;
- struct tm ast_time;
- int dur = 0;
- int h, m, s, ms;
- segtime last_seg_time;
- segtime main_seg_time;
- Bool first = GF_TRUE;
- main_seg_time.segnum = 0;
- main_seg_time.utc_time = 0;
- main_seg_time.ntpts = 0;
- last_seg_time = main_seg_time;
-
- if (cmddata->mode == LIVE_CAMERA || cmddata->mode == LIVE_MEDIA) {
- while (1) {
- u32 msecs;
- time_t t;
- segtime seg_time;
- seg_time.segnum = 0;
- seg_time.utc_time = 0;
- seg_time.ntpts = 0;
-
- if (cmddata->exit_signal) {
- break;
- }
-
- if (strcmp(cmddata->video_data_conf.filename, "") != 0) {
- if (dc_message_queue_get(mq, &seg_time) < 0) {
- continue;
- }
- }
-
- if (strcmp(cmddata->audio_data_conf.filename, "") != 0) {
- if (dc_message_queue_get(mq, &seg_time) < 0) {
- continue;
- }
- }
- assert(seg_time.ntpts);
-
- if (cmddata->use_dynamic_ast) {
- main_seg_time = seg_time;
- } else {
- //get the last notification of AST
- if (first) {
- main_seg_time = seg_time;
- first = GF_FALSE;
- }
- assert(main_seg_time.ntpts);
- }
-
- last_seg_time = seg_time;
- assert(main_seg_time.ntpts <= seg_time.ntpts);
-
- t = (seg_time.ntpts >> 32) - GF_NTP_SEC_1900_TO_1970;
- msecs = (u32) ( (seg_time.ntpts & 0xFFFFFFFF) * (1000.0/0xFFFFFFFF) );
- ast_time = *gmtime(&t);
- fprintf(stdout, "Generating MPD at %d-%02d-%02dT%02d:%02d:%02d.%03dZ\n", 1900 + ast_time.tm_year, ast_time.tm_mon+1, ast_time.tm_mday, ast_time.tm_hour, ast_time.tm_min, ast_time.tm_sec, msecs);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Generating MPD at %d-%02d-%02dT%02d:%02d:%02d.%03dZ - UTC "LLU" ms - AST UTC "LLU" ms\n", 1900 + ast_time.tm_year, ast_time.tm_mon+1, ast_time.tm_mday, ast_time.tm_hour, ast_time.tm_min, ast_time.tm_sec, msecs, seg_time.utc_time, main_seg_time.utc_time));
-
- t = (main_seg_time.ntpts >> 32) - GF_NTP_SEC_1900_TO_1970;
- if (cmddata->ast_offset>0) {
- t += cmddata->ast_offset/1000;
- }
- msecs = (u32) ( (main_seg_time.ntpts & 0xFFFFFFFF) * (1000.0/0xFFFFFFFF) );
- ast_time = *gmtime(&t);
- assert(ast_time.tm_year);
-
- sprintf(availability_start_time, "%d-%02d-%02dT%02d:%02d:%02d.%03dZ", 1900 + ast_time.tm_year, ast_time.tm_mon+1, ast_time.tm_mday, ast_time.tm_hour, ast_time.tm_min, ast_time.tm_sec, msecs);
- fprintf(stdout, "StartTime: %s - startNumber %d - last number %d\n", availability_start_time, main_seg_time.segnum+1, seg_time.segnum+1);
-
- if (cmddata->time_shift != -1) {
- int ts, h, m, s;
- ts = cmddata->time_shift;
- h = ts / 3600;
- ts = ts % 3600;
- m = ts / 60;
- s = ts % 60;
- snprintf(time_shift, sizeof(time_shift), "PT%02dH%02dM%02dS", h, m, s);
- }
-
- dc_write_mpd(cmddata, audio_data_conf, video_data_conf, presentation_duration, availability_start_time, time_shift, main_seg_time.segnum+1, cmddata->ast_offset);
- }
-
- if (cmddata->no_mpd_rewrite) return 0;
-
- //finally rewrite the MPD to static
- dur = cmddata->seg_dur * (last_seg_time.segnum - main_seg_time.segnum);
- if (cmddata->time_shift) {
- if (dur > cmddata->time_shift * 1000) {
- u32 nb_seg = cmddata->time_shift*1000 / cmddata->seg_dur;
- main_seg_time.segnum = last_seg_time.segnum - nb_seg;
- //dur = cmddata->time_shift;
- }
- dur = cmddata->seg_dur * (last_seg_time.segnum - main_seg_time.segnum);
- }
- cmddata->mode = ON_DEMAND;
-
- } else {
- int a_dur = 0;
- int v_dur = 0;
-
- if (strcmp(cmddata->audio_data_conf.filename, "") != 0) {
- dc_message_queue_get(mq, &a_dur);
- }
-
- if (strcmp(cmddata->video_data_conf.filename, "") != 0) {
- dc_message_queue_get(mq, &v_dur);
- }
-
- dur = v_dur > a_dur ? v_dur : a_dur;
- }
-
-
- h = dur / 3600000;
- dur = dur % 3600000;
- m = dur / 60000;
- dur = dur % 60000;
- s = dur / 1000;
- ms = dur % 1000;
- snprintf(presentation_duration, sizeof(presentation_duration), "PT%02dH%02dM%02d.%03dS", h, m, s, ms);
- fprintf(stdout, "Duration: %s\n", presentation_duration);
-
-
- dc_write_mpd(cmddata, audio_data_conf, video_data_conf, presentation_duration, availability_start_time, 0, main_seg_time.segnum+1, 0);
-
- return 0;
-}
-
-u32 delete_seg_thread(void *params)
-{
- int ret;
- ThreadParam *th_param = (ThreadParam*)params;
- CmdData *cmd_data = th_param->in_data;
- MessageQueue *mq = th_param->mq;
-
- char buff[GF_MAX_PATH];
-
- while (1) {
- ret = dc_message_queue_get(mq, (void*) buff);
- if (ret > 0) {
- int status;
- status = unlink(buff);
- if (status != 0) {
- GF_LOG(GF_LOG_WARNING, GF_LOG_DASH, ("Unable to delete the file %s\n", buff));
- }
- }
-
- if (cmd_data->exit_signal) {
- break;
- }
- }
-
- return 0;
-}
-
-Bool fragmenter_thread(void *params)
-{
-// int ret;
- ThreadParam *th_param = (ThreadParam*)params;
- CmdData *cmd_data = th_param->in_data;
- MessageQueue *mq = th_param->mq;
-
- char buff[GF_MAX_PATH];
-
- while (1) {
- /*ret = */dc_message_queue_get(mq, (void*) buff);
- if (cmd_data->exit_signal) {
- break;
- }
- }
-
- return GF_FALSE;
-}
-
-static u32 keyboard_thread(void *params)
-{
-
- ThreadParam *th_param = (ThreadParam*)params;
- CmdData *in_data = th_param->in_data;
- char c;
-
- while (1) {
- if (gf_prompt_has_input()) {
- c = gf_prompt_get_char();
- if (c == 'q' || c == 'Q') {
- in_data->exit_signal = 1;
- break;
- }
- }
-
- if (in_data->exit_signal) {
- break;
- }
-
- gf_sleep(100);
- }
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Keyboard thread exit\n"));
- return 0;
-}
-
-u32 video_decoder_thread(void *params)
-{
-#ifdef DASHCAST_PRINT
- int i = 0;
-#endif
- int ret;
- int source_number = 0;
-
- //int first_time = 1;
- struct timeval time_start, time_end, time_wait;
- VideoThreadParam *thread_params = (VideoThreadParam *) params;
-
- CmdData *in_data = thread_params->in_data;
- VideoInputData *video_input_data = thread_params->video_input_data;
- VideoInputFile **video_input_file = thread_params->video_input_file;
-
- suseconds_t total_wait_time = (int) (1000000.0 / (double) in_data->video_data_conf.framerate);
- suseconds_t pick_packet_delay, select_delay = 0, real_wait, other_delays = 2;
-
- Task t;
- //fprintf(stdout, "wait time : %f\n", total_wait_time);
-
- if (!gf_list_count(in_data->video_lst))
- return 0;
-
- while (1) {
- dc_task_get_current(&in_data->task_list, &t);
- source_number = t.source_number;
-
- //fprintf(stdout, "sourcenumber: %d\n", source_number);
-
-// if (video_input_file[source_number]->mode == LIVE_MEDIA) {
- gf_gettimeofday(&time_start, NULL);
-// }
-
- ret = dc_video_decoder_read(video_input_file[source_number], video_input_data, source_number, in_data->use_source_timing, (in_data->mode == LIVE_CAMERA) ? 1 : 0, (const int *) &in_data->exit_signal);
-#ifdef DASHCAST_PRINT
- fprintf(stdout, "Read video frame %d\r", i++);
- fflush(stdout);
-#endif
- if (ret == -2) {
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("Video reader has no more frame to read.\n"));
- break;
- }
- if (ret == -1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("An error occurred while reading video frame.\n"));
- break;
- }
-
- if (in_data->exit_signal) {
- dc_video_input_data_end_signal(video_input_data);
- break;
- }
-
- if (video_input_file[source_number]->mode == LIVE_MEDIA) {
- gf_gettimeofday(&time_end, NULL);
- pick_packet_delay = ((time_end.tv_sec - time_start.tv_sec) * 1000000) + time_end.tv_usec - time_start.tv_usec;
- time_wait.tv_sec = 0;
- real_wait = total_wait_time - pick_packet_delay - select_delay - other_delays;
- time_wait.tv_usec = real_wait;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("delay: %ld = %ld - %ld\n", time_wait.tv_usec, total_wait_time, pick_packet_delay));
-
- gf_gettimeofday(&time_start, NULL);
- select(0, NULL, NULL, NULL, &time_wait);
- gf_gettimeofday(&time_end, NULL);
-
- select_delay = (((time_end.tv_sec - time_start.tv_sec) * 1000000) + time_end.tv_usec - time_start.tv_usec) - real_wait;
- }
- }
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("Video decoder is exiting...\n"));
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("video decoder thread exit\n"));
- return 0;
-}
-
-u32 audio_decoder_thread(void *params)
-{
- int ret;
- struct timeval time_start, time_end, time_wait;
- AudioThreadParam *thread_params = (AudioThreadParam*)params;
-
- CmdData *in_data = thread_params->in_data;
- AudioInputData *audio_input_data = thread_params->audio_input_data;
- AudioInputFile *audio_input_file = thread_params->audio_input_file;
-
- suseconds_t pick_packet_delay, select_delay = 0, real_wait, other_delays = 1;
- suseconds_t total_wait_time;
- if (in_data->audio_data_conf.samplerate < 1024) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error: invalid audio sample rate: %d\n", in_data->audio_data_conf.samplerate));
- dc_audio_inout_data_end_signal(audio_input_data);
- //FIXME: deadlock on the mpd thread. Reproduce with big_buck_bunny.mp4.
- return 1;
- }
- total_wait_time = (int) (1000000.0 / (in_data->audio_data_conf.samplerate / (double) AUDIO_FRAME_SIZE));
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("wait time : %ld\n", total_wait_time));
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("sample-rate : %ld\n", in_data->audio_data_conf.samplerate));
-
- if (!gf_list_count(in_data->audio_lst))
- return 0;
-
- while (1) {
-// if (audio_input_file->mode == LIVE_MEDIA) {
- gf_gettimeofday(&time_start, NULL);
-// }
-
- ret = dc_audio_decoder_read(audio_input_file, audio_input_data);
- if (ret == -2) {
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("Audio decoder has no more frame to read.\n"));
- break;
- }
- if (ret == -1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("An error occurred while reading audio frame.\n"));
- break;
- }
-
- if (in_data->exit_signal) {
- dc_audio_inout_data_end_signal(audio_input_data);
- break;
- }
-
- if (audio_input_file->mode == LIVE_MEDIA) {
- gf_gettimeofday(&time_end, NULL);
- pick_packet_delay = ((time_end.tv_sec - time_start.tv_sec) * 1000000) + time_end.tv_usec - time_start.tv_usec;
- time_wait.tv_sec = 0;
- real_wait = total_wait_time - pick_packet_delay - select_delay - other_delays;
- time_wait.tv_usec = real_wait;
-
- gf_gettimeofday(&time_start, NULL);
- select(0, NULL, NULL, NULL, &time_wait);
- gf_gettimeofday(&time_end, NULL);
-
- select_delay = (((time_end.tv_sec - time_start.tv_sec) * 1000000) + time_end.tv_usec - time_start.tv_usec) - real_wait;
- }
- }
-
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("Audio decoder is exiting...\n"));
- return 0;
-}
-
-u32 video_scaler_thread(void *params)
-{
- int ret;
- VideoThreadParam *thread_params = (VideoThreadParam *) params;
- CmdData *in_data = thread_params->in_data;
- VideoInputData *video_input_data = thread_params->video_input_data;
- VideoScaledData *video_scaled_data = thread_params->video_scaled_data;
-
- if (!gf_list_count(in_data->video_lst))
- return 0;
-
- while (1) {
- ret = dc_video_scaler_scale(video_input_data, video_scaled_data);
- if (ret == -2) {
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("Video scaler has no more frame to read.\n"));
- break;
- }
- }
-
- dc_video_scaler_end_signal(video_scaled_data);
-
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("video scaler thread exit\n"));
- return 0;
-}
-
-u32 video_encoder_thread(void *params)
-{
- int ret, shift, frame_nb, seg_frame_max, frag_frame_max, seg_nb = 0, loss_state = 0, quit = 0, real_video_seg_dur;
- char name_to_delete[GF_MAX_PATH], name_to_send[GF_MAX_PATH];
- u64 start_utc, seg_utc;
- segtime time_at_segment_start;
- VideoMuxerType muxer_type = VIDEO_MUXER;
- VideoThreadParam *thread_params = (VideoThreadParam*)params;
- u32 sec, frac;
- Bool init_mpd = GF_FALSE;
- CmdData *in_data = thread_params->in_data;
- int video_conf_idx = thread_params->video_conf_idx;
- VideoDataConf *video_data_conf = (VideoDataConf*)gf_list_get(in_data->video_lst, video_conf_idx);
-
- VideoScaledData *video_scaled_data = thread_params->video_scaled_data;
- int video_cb_size = (in_data->mode == LIVE_MEDIA || in_data->mode == LIVE_CAMERA) ? 1 : VIDEO_CB_DEFAULT_SIZE;
- VideoOutputFile out_file;
-
- MessageQueue *mq = thread_params->mq;
- MessageQueue *delete_seg_mq = thread_params->delete_seg_mq;
- MessageQueue *send_seg_mq = thread_params->send_seg_mq;
-
- if (!gf_list_count(in_data->video_lst))
- return 0;
-
- seg_frame_max = (int)(video_data_conf->framerate * (float) (in_data->seg_dur / 1000.0));
- frag_frame_max = (int)(video_data_conf->framerate * (float) (in_data->frag_dur / 1000.0));
- optimize_seg_frag_dur(&seg_frame_max, &frag_frame_max);
-
- real_video_seg_dur = (int) (seg_frame_max * 1000.0 / (float) video_data_conf->framerate);
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[video_encoder] seg_frame_max=%d, frag_frame_max=%d, real_video_seg_dur=%d ms\n", seg_frame_max, frag_frame_max, real_video_seg_dur));
-
-
- if (seg_frame_max <= 0)
- seg_frame_max = -1;
-
- if (dc_video_muxer_init(&out_file, video_data_conf, muxer_type, seg_frame_max, frag_frame_max, in_data->seg_marker, in_data->gdr, in_data->seg_dur, in_data->frag_dur, (u32) video_scaled_data->vsprop->video_input_data->frame_duration, in_data->gop_size, video_cb_size) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot init output video file.\n"));
- in_data->exit_signal = 1;
- return -1;
- }
-
- if (dc_video_encoder_open(&out_file, video_data_conf, in_data->use_source_timing, video_scaled_data->sar) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output video stream.\n"));
- in_data->exit_signal = 1;
- return -1;
- }
-
- if (in_data->mode == LIVE_MEDIA || in_data->mode == LIVE_CAMERA) {
- init_mpd = GF_TRUE;
- }
-
-
- time_at_segment_start.ntpts = 0;
- start_utc = gf_net_get_utc();
-
- while (1) {
- frame_nb = 0;
- //log time at segment start, because segment availabilityStartTime is computed from AST anchor + segment duration
- //logging at the end of the segment production will induce one segment delay
- time_at_segment_start.segnum = seg_nb;
- time_at_segment_start.utc_time = gf_net_get_utc();
- gf_net_get_ntp(&sec, &frac);
-
-#ifndef GPAC_DISABLE_LOG
- if (gf_log_tool_level_on(GF_LOG_DASH, GF_LOG_INFO)) {
- if (time_at_segment_start.ntpts) {
- u32 ref_sec, ref_frac;
- Double tr, t;
- ref_sec = (time_at_segment_start.ntpts>>32) & 0xFFFFFFFFULL;
- ref_frac = (u32) (time_at_segment_start.ntpts & 0xFFFFFFFFULL);
- tr = ref_sec * 1000.0;
- tr += ref_frac*1000.0 /0xFFFFFFFF;
- t = sec * 1000.0;
- t += frac*1000.0 /0xFFFFFFFF;
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] NTP diff since last segment start in msec is %f\n", t - tr));
-
- }
- }
-#endif
-
- time_at_segment_start.ntpts = sec;
- time_at_segment_start.ntpts <<= 32;
- time_at_segment_start.ntpts |= frac;
-
- //force writing MPD before any encoding happens (eg don't wait for the end of the first segment)
- if (init_mpd) {
- init_mpd = GF_FALSE;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Initial MPD publish at UTC "LLU" ms\n", time_at_segment_start.utc_time));
- dc_message_queue_put(mq, &time_at_segment_start, sizeof(time_at_segment_start));
- }
-
- assert(! out_file.segment_started);
-
- if (dc_video_muxer_open(&out_file, in_data->out_dir, video_data_conf->filename, seg_nb+1) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output video file.\n"));
- in_data->exit_signal = 1;
- return -1;
- }
-// fprintf(stdout, "Header size: %d\n", ret);
- while (1) {
- //we have the RAP already encoded, skip coder
- if (loss_state == 2) {
- ret = 1;
- loss_state = 0;
- } else {
- ret = dc_video_encoder_encode(&out_file, video_scaled_data);
- }
-
- if (ret == -2) {
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("Video encoder has no more data to encode.\n"));
- quit = 1;
- break;
- }
- if (ret == -1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("An error occured while writing video frame.\n"));
- quit = 1;
- break;
- }
-
- if (ret > 0) {
- int r;
-
- /*resync at first RAP: flush current broken segment and restart next one on rap*/
- if ((loss_state==1) && out_file.codec_ctx->coded_frame->key_frame) {
- loss_state = 2;
- break;
- }
-
- r = dc_video_muxer_write(&out_file, frame_nb, in_data->insert_utc ? GF_TRUE : GF_FALSE);
- if (r < 0) {
- quit = 1;
- in_data->exit_signal = 1;
- break;
- } else if (r == 1) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("fragment is written!\n"));
- if (in_data->send_message == 1) {
- snprintf(name_to_send, sizeof(name_to_send), "%s/%s_%d_gpac.m4s", in_data->out_dir, video_data_conf->filename, seg_nb);
- dc_message_queue_put(send_seg_mq, name_to_send, sizeof(name_to_send));
- }
-
- break;
- }
-
- frame_nb++;
- }
- }
-
- dc_video_muxer_close(&out_file);
-
- // If system is live,
- // Send the time that a segment is available to MPD generator thread.
- if (in_data->mode == LIVE_MEDIA || in_data->mode == LIVE_CAMERA) {
- //check we don't loose sync
- int diff;
- int seg_diff;
- seg_utc = gf_net_get_utc();
- diff = (int) (seg_utc - start_utc);
-
- //if seg UTC is after next segment UTC (current ends at seg_nb+1, next at seg_nb+2), adjust numbers
- if (diff > (seg_nb+2) * real_video_seg_dur) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[video_encoder] Rep %s UTC diff %d bigger than segment duration %d - some frame where probably lost. Adjusting\n", out_file.rep_id, diff, seg_nb));
-
- while (diff > (seg_nb+2) * real_video_seg_dur) {
- seg_nb++;
-
- //do a rough estimate of losses to adjust timing...
- if (! in_data->use_source_timing) {
- out_file.first_dts_in_fragment += out_file.codec_ctx->time_base.den;
- }
- }
- //wait for RAP to cut next segment
- loss_state = 1;
- } else {
-#define SYNC_SAFE 800
-
- seg_diff = diff;
- seg_diff -= (seg_nb+1) * real_video_seg_dur;
- if (seg_diff > SYNC_SAFE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[video_encoder] Rep %s UTC diff at segment close: %d is higher than cumulated segment duration %d (diff %d) - frame rate is probably not correct!\n", out_file.rep_id, diff, (seg_nb+1) * in_data->seg_dur, seg_diff));
- }
- else if (seg_diff < -SYNC_SAFE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[video_encoder] Rep %s UTC diff at segment close: %d is lower than cumulated segment duration %d (diff %d) - frame rate is probably not correct or frames were lost!\n", out_file.rep_id, diff, (seg_nb+1) * in_data->seg_dur, seg_diff));
- } else {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[video_encoder] Rep %s UTC diff at segment close: %d - cumulated segment duration %d (diff %d)\n", out_file.rep_id, diff, (seg_nb+1) * in_data->seg_dur, seg_diff));
- }
- }
-
- //time_t t = time(NULL);
- dc_message_queue_put(mq, &time_at_segment_start, sizeof(time_at_segment_start));
- }
-
- if ((in_data->time_shift != -1)) {
- shift = 1000 * in_data->time_shift / in_data->seg_dur;
- if (seg_nb > shift) {
- snprintf(name_to_delete, sizeof(name_to_delete), "%s/%s_%d_gpac.m4s", in_data->out_dir, video_data_conf->filename, (seg_nb - shift));
- dc_message_queue_put(delete_seg_mq, name_to_delete, sizeof(name_to_delete));
- }
- }
-
- seg_nb++;
-
- if (quit)
- break;
- }
-
- // If system is not live,
- // Send the duration of the video
- if (in_data->mode == ON_DEMAND) {
- if (thread_params->video_conf_idx == 0) {
- int dur = (seg_nb * seg_frame_max * 1000) / video_data_conf->framerate;
- int dur_tot = (out_file.codec_ctx->frame_number * 1000)
- / video_data_conf->framerate;
- if (dur > dur_tot)
- dur = dur_tot;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("Duration: %d \n", dur));
- dc_message_queue_put(mq, &dur, sizeof(dur));
- }
- }
-
- /* Close output video file */
- dc_video_encoder_close(&out_file);
-
- dc_video_muxer_free(&out_file);
-
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("video encoder thread exit\n"));
- return 0;
-}
-
-u32 audio_encoder_thread(void *params)
-{
- int ret, exit_loop = 0, quit = 0, seg_nb = 0, frame_per_seg, frame_per_frag, frame_nb, shift, real_audio_seg_dur;
- //int seg_frame_max;
- //int frag_frame_max;
- //int audio_frame_size = AUDIO_FRAME_SIZE;
- char name_to_delete[GF_MAX_PATH];
- u64 start_utc, seg_utc;
- segtime time_at_segment_start;
- Bool check_first_seg_utc = GF_TRUE;
-
- AudioMuxerType muxer_type = AUDIO_MUXER;
- AudioThreadParam *thread_params = (AudioThreadParam *) params;
-
- CmdData *in_data = thread_params->in_data;
- int audio_conf_idx = thread_params->audio_conf_idx;
- AudioDataConf *audio_data_conf = (AudioDataConf*)gf_list_get(in_data->audio_lst, audio_conf_idx);
-
- AudioInputData *audio_input_data = thread_params->audio_input_data;
- AudioOutputFile audio_output_file;
-
- MessageQueue *mq = thread_params->mq;
- MessageQueue *delete_seg_mq = thread_params->delete_seg_mq;
-
- if (!gf_list_count(in_data->audio_lst))
- return 0;
-
- //seg_frame_max = audio_data_conf->samplerate
- // * (float) (in_data->seg_dur / 1000.0);
-
- //frag_frame_max = audio_data_conf->samplerate * (float) (in_data->frag_dur / 1000.0);
- //if (seg_frame_max <= 0)
- // seg_frame_max = -1;
-
- if (dc_audio_encoder_open(&audio_output_file, audio_data_conf) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output audio stream.\n"));
- in_data->exit_signal = 1;
- return -1;
- }
-
- frame_per_seg = (int)((audio_data_conf->samplerate / (double) audio_output_file.codec_ctx->frame_size) * (in_data->seg_dur / 1000.0));
- frame_per_frag = (int)((audio_data_conf->samplerate / (double) audio_output_file.codec_ctx->frame_size) * (in_data->frag_dur / 1000.0));
- optimize_seg_frag_dur(&frame_per_seg, &frame_per_frag);
-
- real_audio_seg_dur = (int) (frame_per_seg * (double) audio_output_file.codec_ctx->frame_size * 1000.0 / (double) audio_data_conf->samplerate);
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH,("[audio_encoder] frame_per_seg=%d, frame_per_frag=%d, real_audio_seg_dur=%d ms\n", frame_per_seg, frame_per_frag, real_audio_seg_dur) );
-
- if (dc_audio_muxer_init(&audio_output_file, audio_data_conf, muxer_type, frame_per_seg, frame_per_frag, in_data->seg_marker) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot init output audio.\n"));
- in_data->exit_signal = 1;
- return -1;
- }
-
- start_utc = gf_net_get_utc();
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[audio_encoder] start_utc="LLU"\n", start_utc));
-
- while (1) {
- //logging at the end of the segment production will induce one segment delay
- time_at_segment_start.utc_time = gf_net_get_utc();
- time_at_segment_start.ntpts = gf_net_get_ntp_ts();
-
- frame_nb = 0;
- quit = 0;
-
- if (dc_audio_muxer_open(&audio_output_file, in_data->out_dir, audio_data_conf->filename, seg_nb+1) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output audio.\n"));
- in_data->exit_signal = 1;
- return -1;
- }
-
- while (1) {
- exit_loop = 0;
-// if (frame_per_seg > 0) {
-// if (frame_nb == frame_per_seg) {
-//
-// //if (dc_audio_encoder_flush(&audio_output_file, audio_input_data) == 0) {
-// // dc_audio_muxer_write(&audio_output_file);
-// // frame_nb++;//= audio_output_file.codec_ctx->frame_size; //audio_output_file.acc_samples;
-// //}
-//
-// exit_loop = 1;
-// break;
-// }
-// }
-
- audio_output_file.frame_ntp = gf_net_get_ntp_ts();
- ret = dc_audio_encoder_read(&audio_output_file, audio_input_data);
- if (ret == -2) {
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("Audio encoder has no more data to encode.\n"));
- //if (dc_audio_encoder_flush(&audio_output_file, audio_input_data) == 0) {
- // dc_audio_muxer_write(&audio_output_file);
- // frame_nb++;//= audio_output_file.codec_ctx->frame_size; //audio_output_file.acc_samples;
- //}
- quit = 1;
- break;
- }
-
- while (1) {
- ret = dc_audio_encoder_encode(&audio_output_file, audio_input_data);
- if (ret == 1) {
- break;
- }
- if (ret == -1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("An error occured while encoding audio frame.\n"));
- quit = 1;
- break;
- }
-
- ret = dc_audio_muxer_write(&audio_output_file, frame_nb, in_data->insert_utc);
- if (ret == -1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("An error occured while writing audio frame.\n"));
- quit = 1;
- break;
- }
-
- if (ret == 1) {
- exit_loop = 1;
- break;
- }
-
- frame_nb++; //= audio_output_file.codec_ctx->frame_size; //audio_output_file.acc_samples;
- }
-
- if (exit_loop || quit)
- break;
- }
-
- dc_audio_muxer_close(&audio_output_file);
-
- // Send the time that a segment is available to MPD generator thread.
- if (in_data->mode == LIVE_CAMERA || in_data->mode == LIVE_MEDIA) {
- int diff;
- if (check_first_seg_utc) {
- u64 now = gf_net_get_utc();
- check_first_seg_utc = GF_FALSE;
-
- diff = (int) (now - time_at_segment_start.utc_time);
- if (diff < real_audio_seg_dur / 2) {
- u32 sec, frac, ms;
- s32 left, nb_s;
- gf_net_get_ntp(&sec, &frac);
- nb_s = real_audio_seg_dur/1000;
- sec -= nb_s;
- ms = (u32) ((u64) 1000 * frac / 0xFFFFFFFF);
- left = ms;
- left -= (s32) (real_audio_seg_dur - 1000*nb_s);
- while (left<0) {
- left += 1000;
- sec-=1;
- }
- time_at_segment_start.ntpts = sec;
- time_at_segment_start.ntpts <<= 32;
- time_at_segment_start.ntpts |= (u32) ((0xFFFFFFFF*left)/1000);
-
- start_utc = time_at_segment_start.utc_time = now - real_audio_seg_dur;
- GF_LOG(GF_LOG_WARNING, GF_LOG_DASH, ("[audio_encoder] First segment produced faster (%d ms) than duration (%d ms) probably due to HW buffers - adjusting ast\n", diff, real_audio_seg_dur));
- }
- }
- if (thread_params->audio_conf_idx == 0) {
-
- //check we don't loose sync
- seg_utc = gf_net_get_utc();
- diff = (int) (seg_utc - start_utc);
- //if seg UTC is after next segment UTC (current ends at seg_nb+1, next at seg_nb+2), adjust numbers
- if (diff > (seg_nb+2) * real_audio_seg_dur) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[audio_encoder] UTC dur %d bigger than segment duration %d - some frame where probably lost. Adjusting\n", diff, seg_nb));
- while (diff > (seg_nb+2) * real_audio_seg_dur) {
- seg_nb++;
- }
- }
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[audio_encoder] UTC dur %d - cumulated segment duration %d (diff %d ms)\n", diff, (seg_nb+1) * real_audio_seg_dur, diff - (seg_nb+1) * real_audio_seg_dur));
-
-
- time_at_segment_start.segnum = seg_nb;
- dc_message_queue_put(mq, &time_at_segment_start, sizeof(time_at_segment_start));
- }
- }
-
- if (in_data->time_shift != -1) {
- shift = 1000 * in_data->time_shift / in_data->seg_dur;
- if (seg_nb > shift) {
- snprintf(name_to_delete, sizeof(name_to_delete), "%s/%s_%d_gpac.m4s", in_data->out_dir, audio_data_conf->filename, (seg_nb - shift));
- dc_message_queue_put(delete_seg_mq, name_to_delete, sizeof(name_to_delete));
- }
- }
-
- seg_nb++;
-
- if (quit)
- break;
- }
-
- // If system is not live,
- // Send the duration of the video
- if (in_data->mode == ON_DEMAND) {
- if (thread_params->audio_conf_idx == 0) {
- int dur = (seg_nb * audio_output_file.codec_ctx->frame_size * frame_per_seg * 1000) / audio_data_conf->samplerate;
- int dur_tot = (audio_output_file.codec_ctx->frame_number * audio_output_file.codec_ctx->frame_size * 1000) / audio_data_conf->samplerate;
- if (dur > dur_tot)
- dur = dur_tot;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("Duration: %d \n", dur));
- dc_message_queue_put(mq, &dur, sizeof(dur));
- }
- }
-
- dc_audio_muxer_free(&audio_output_file);
-
- /* Close output audio file */
- dc_audio_encoder_close(&audio_output_file);
-
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("Audio encoder is exiting...\n"));
- return 0;
-}
-
-int dc_run_controler(CmdData *in_data)
-{
- int ret = 0;
- u32 video_cb_size = VIDEO_CB_DEFAULT_SIZE;
- u32 i, j;
-
- ThreadParam keyboard_th_params;
- ThreadParam mpd_th_params;
- ThreadParam delete_seg_th_params;
- ThreadParam send_frag_th_params;
-
- //Video parameters
- VideoThreadParam vdecoder_th_params;
- VideoThreadParam *vencoder_th_params = (VideoThreadParam*)alloca(gf_list_count(in_data->video_lst) * sizeof(VideoThreadParam));
- VideoInputData video_input_data;
- VideoInputFile *video_input_file[MAX_SOURCE_NUMBER];
- VideoScaledDataList video_scaled_data_list;
- VideoThreadParam *vscaler_th_params = NULL;
-
- //Audio parameters
- AudioThreadParam adecoder_th_params;
- AudioThreadParam *aencoder_th_params = (AudioThreadParam*)alloca(gf_list_count(in_data->audio_lst) * sizeof(AudioThreadParam));
- AudioInputData audio_input_data;
- AudioInputFile audio_input_file;
-
- MessageQueue mq;
- MessageQueue delete_seg_mq;
- MessageQueue send_frag_mq;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Controler init at UTC "LLU"\n", gf_net_get_utc() ));
- dc_register_libav();
-
- for (i = 0; i < MAX_SOURCE_NUMBER; i++)
- video_input_file[i] = (VideoInputFile*)gf_malloc(sizeof(VideoInputFile));
-
- dc_message_queue_init(&mq);
- dc_message_queue_init(&delete_seg_mq);
- dc_message_queue_init(&send_frag_mq);
-
- memset(&audio_input_data, 0, sizeof(AudioInputData));
- memset(&audio_input_file, 0, sizeof(AudioInputFile));
- memset(&video_input_data, 0, sizeof(VideoInputData));
-
-
- if (in_data->mode == LIVE_CAMERA || in_data->mode == LIVE_MEDIA)
- video_cb_size = 1;
-
- if (strcmp(in_data->video_data_conf.filename, "") != 0) {
- dc_video_scaler_list_init(&video_scaled_data_list, in_data->video_lst);
- vscaler_th_params = (VideoThreadParam*)gf_malloc(video_scaled_data_list.size * sizeof(VideoThreadParam));
-
- /* Open input video */
- if (dc_video_decoder_open(video_input_file[0], &in_data->video_data_conf, in_data->mode, in_data->no_loop, video_scaled_data_list.size) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open input video.\n"));
- ret = -1;
- goto exit;
- }
-
- if (dc_video_input_data_init(&video_input_data, /*video_input_file[0]->width, video_input_file[0]->height,
- video_input_file[0]->pix_fmt,*/video_scaled_data_list.size, in_data->mode, MAX_SOURCE_NUMBER, video_cb_size) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot initialize audio data.\n"));
- ret = -1;
- goto exit;
- }
-
- /* open other input videos for source switching */
- for (i = 0; i < gf_list_count(in_data->vsrc); i++) {
- VideoDataConf *video_data_conf = (VideoDataConf*)gf_list_get(in_data->vsrc, i);
- if (dc_video_decoder_open(video_input_file[i + 1], video_data_conf, LIVE_MEDIA, 1, video_scaled_data_list.size) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open input video.\n"));
- ret = -1;
- goto exit;
- }
- }
-
- for (i=0; i<gf_list_count(in_data->vsrc) + 1; i++) {
- dc_video_input_data_set_prop(&video_input_data, i, video_input_file[i]->width, video_input_file[i]->height, in_data->video_data_conf.crop_x, in_data->video_data_conf.crop_y, video_input_file[i]->pix_fmt, video_input_file[i]->sar);
- }
-
- for (i=0; i<video_scaled_data_list.size; i++) {
- dc_video_scaler_data_init(&video_input_data, video_scaled_data_list.video_scaled_data[i], MAX_SOURCE_NUMBER, video_cb_size);
-
- for (j=0; j<gf_list_count(in_data->vsrc) + 1; j++) {
- dc_video_scaler_data_set_prop(&video_input_data, video_scaled_data_list.video_scaled_data[i], j);
- }
- }
-
- /* Initialize video decoder thread */
- vdecoder_th_params.thread = gf_th_new("video_decoder_thread");
-
- for (i=0; i<video_scaled_data_list.size; i++) {
- vscaler_th_params[i].thread = gf_th_new("video_scaler_thread");
- }
-
- /* Initialize video encoder threads */
- for (i=0; i<gf_list_count(in_data->video_lst); i++)
- vencoder_th_params[i].thread = gf_th_new("video_encoder_thread");
- }
-
- /* When video and audio share the same source, open it once. This allow to read from unicast streams */
- if (!strcmp(in_data->video_data_conf.filename, in_data->audio_data_conf.filename)) {
- audio_input_file.av_fmt_ctx = video_input_file[0]->av_fmt_ctx;
- video_input_file[0]->av_fmt_ctx_ref_cnt++;
- audio_input_file.av_pkt_list = video_input_file[0]->av_pkt_list = gf_list_new();
- audio_input_file.av_pkt_list_mutex = video_input_file[0]->av_pkt_list_mutex = gf_mx_new("Demux AVPackets List");
- }
-
- if (strcmp(in_data->audio_data_conf.filename, "") != 0) {
- /* Open input audio */
- if (dc_audio_decoder_open(&audio_input_file, &in_data->audio_data_conf, in_data->mode, in_data->no_loop, in_data->video_data_conf.framerate) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open input audio.\n"));
- ret = -1;
- goto exit;
- }
-
- if (dc_audio_input_data_init(&audio_input_data, in_data->audio_data_conf.channels, in_data->audio_data_conf.samplerate, gf_list_count(in_data->audio_lst), in_data->mode) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot initialize audio data.\n"));
- ret = -1;
- goto exit;
- }
-
- /* Initialize audio decoder thread */
- adecoder_th_params.thread = gf_th_new("audio_decoder_thread");
-
- /* Initialize audio encoder threads */
- for (i = 0; i < gf_list_count(in_data->audio_lst); i++)
- aencoder_th_params[i].thread = gf_th_new("video_encoder_thread");
- }
-
- /******** Keyboard controler Thread ********/
-
- /* Initialize keyboard controller thread */
- keyboard_th_params.thread = gf_th_new("keyboard_thread");
-
- /* Create keyboard controller thread */
- keyboard_th_params.in_data = in_data;
- if (gf_th_run(keyboard_th_params.thread, keyboard_thread, (void *)&keyboard_th_params) != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while doing pthread_create for keyboard_thread.\n"));
- }
-
- /********************************************/
-
- //Communication between decoder and audio encoder
- for (i = 0; i < gf_list_count(in_data->audio_lst); i++) {
- AudioDataConf *tmadata = (AudioDataConf*)gf_list_get(in_data->audio_lst, i);
- tmadata->channels = in_data->audio_data_conf.channels;
- tmadata->samplerate = in_data->audio_data_conf.samplerate;
- }
-
- //Communication between decoder and video encoder
- for (i = 0; i < gf_list_count(in_data->video_lst); i++) {
- VideoDataConf *tmvdata = (VideoDataConf*)gf_list_get(in_data->video_lst, i);
- tmvdata->framerate = in_data->video_data_conf.framerate;
- if (in_data->use_source_timing) {
- tmvdata->time_base = in_data->video_data_conf.time_base;
- }
- }
-
- /******** MPD Thread ********/
-
- /* Initialize MPD generator thread */
- mpd_th_params.thread = gf_th_new("mpd_thread");
-
- /* Create MPD generator thread */
- mpd_th_params.in_data = in_data;
- mpd_th_params.mq = &mq;
- if (gf_th_run(mpd_th_params.thread, mpd_thread, (void *)&mpd_th_params) != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while doing pthread_create for mpd_thread.\n"));
- }
-
-
- if (strcmp(in_data->video_data_conf.filename, "") != 0) {
- /* Create video decoder thread */
- vdecoder_th_params.in_data = in_data;
- vdecoder_th_params.video_input_data = &video_input_data;
- vdecoder_th_params.video_input_file = video_input_file;
- if (gf_th_run(vdecoder_th_params.thread, video_decoder_thread, (void *) &vdecoder_th_params) != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while doing pthread_create for video_decoder_thread.\n"));
- }
-
- while ((in_data->mode == LIVE_CAMERA) && !video_input_data.frame_duration) {
- gf_sleep(0);
- }
- }
-
- if (strcmp(in_data->audio_data_conf.filename, "") != 0) {
- /* Create audio decoder thread */
- adecoder_th_params.in_data = in_data;
- adecoder_th_params.audio_input_data = &audio_input_data;
- adecoder_th_params.audio_input_file = &audio_input_file;
- if (gf_th_run(adecoder_th_params.thread, audio_decoder_thread, (void *) &adecoder_th_params) != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while doing pthread_create for audio_decoder_thread.\n"));
- }
- }
-
- /****************************/
-
- if (strcmp(in_data->video_data_conf.filename, "") != 0) {
- /* Create video encoder threads */
- for (i=0; i<gf_list_count(in_data->video_lst); i++) {
- VideoDataConf * video_data_conf = (VideoDataConf*)gf_list_get(in_data->video_lst, i);
-
- vencoder_th_params[i].in_data = in_data;
- vencoder_th_params[i].video_conf_idx = i;
- vencoder_th_params[i].video_scaled_data = dc_video_scaler_get_data(&video_scaled_data_list, video_data_conf->width, video_data_conf->height);
-
- vencoder_th_params[i].mq = &mq;
- vencoder_th_params[i].delete_seg_mq = &delete_seg_mq;
- vencoder_th_params[i].send_seg_mq = &send_frag_mq;
-
- if (gf_th_run(vencoder_th_params[i].thread, video_encoder_thread, (void*)&vencoder_th_params[i]) != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while doing pthread_create for video_encoder_thread.\n"));
- }
- }
-
- /* Create video scaler threads */
- for (i=0; i<video_scaled_data_list.size; i++) {
- vscaler_th_params[i].in_data = in_data;
- vscaler_th_params[i].video_scaled_data = video_scaled_data_list.video_scaled_data[i];
- vscaler_th_params[i].video_input_data = &video_input_data;
-
- if (gf_th_run(vscaler_th_params[i].thread, video_scaler_thread, (void*)&vscaler_th_params[i]) != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while doing pthread_create for video_scaler_thread.\n"));
- }
- }
- }
-
- if (strcmp(in_data->audio_data_conf.filename, "") != 0) {
- /* Create audio encoder threads */
- for (i = 0; i < gf_list_count(in_data->audio_lst); i++) {
- aencoder_th_params[i].in_data = in_data;
- aencoder_th_params[i].audio_conf_idx = i;
- aencoder_th_params[i].audio_input_data = &audio_input_data;
-
- aencoder_th_params[i].mq = &mq;
- aencoder_th_params[i].delete_seg_mq = &delete_seg_mq;
- aencoder_th_params[i].send_seg_mq = &send_frag_mq;
-
- if (gf_th_run(aencoder_th_params[i].thread, audio_encoder_thread, (void *) &aencoder_th_params[i]) != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while doing pthread_create for audio_encoder_thread.\n"));
- }
- }
- }
-
- if (in_data->time_shift != -1) {
- /* Initialize delete segment thread */
- delete_seg_th_params.thread = gf_th_new("delete_seg_thread");
- delete_seg_th_params.in_data = in_data;
- delete_seg_th_params.mq = &delete_seg_mq;
- if (gf_th_run(delete_seg_th_params.thread, delete_seg_thread, (void *) &delete_seg_th_params) != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while doing pthread_create for delete_seg_thread.\n"));
- }
- }
-
- if (in_data->send_message == 1) {
- /* Initialize delete segment thread */
- send_frag_th_params.thread = gf_th_new("send_frag_event_thread");
- send_frag_th_params.in_data = in_data;
- send_frag_th_params.mq = &send_frag_mq;
- if (gf_th_run(send_frag_th_params.thread, send_frag_event, (void *) &send_frag_th_params) != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while doing pthread_create for send_frag_event_thread.\n"));
- }
- }
-
- fprintf(stdout, "Press q or Q to exit...\n");
-
- if (strcmp(in_data->audio_data_conf.filename, "") != 0) {
- /* Wait for and destroy audio decoder threads */
- gf_th_stop(adecoder_th_params.thread);
- gf_th_del(adecoder_th_params.thread);
- }
-
- if (strcmp(in_data->video_data_conf.filename, "") != 0) {
- /* Wait for and destroy video decoder threads */
- gf_th_stop(vdecoder_th_params.thread);
- gf_th_del(vdecoder_th_params.thread);
- }
-
- if (strcmp(in_data->audio_data_conf.filename, "") != 0) {
- /* Wait for and destroy audio encoder threads */
- for (i = 0; i < gf_list_count(in_data->audio_lst); i++) {
- gf_th_stop(aencoder_th_params[i].thread);
- gf_th_del(aencoder_th_params[i].thread);
- }
- }
-
- if (strcmp(in_data->video_data_conf.filename, "") != 0) {
- /* Wait for and destroy video encoder threads */
- for (i=0; i<gf_list_count(in_data->video_lst); i++) {
- gf_th_stop(vencoder_th_params[i].thread);
- gf_th_del(vencoder_th_params[i].thread);
- }
-
- /* Wait for and destroy video scaler threads */
- for (i=0; i<video_scaled_data_list.size; i++) {
- gf_th_stop(vscaler_th_params[i].thread);
- gf_th_del(vscaler_th_params[i].thread);
- }
- }
-
- keyboard_th_params.in_data->exit_signal = 1;
-
- /********** Keyboard thread ***********/
-
- /* Wait for and destroy keyboard controler thread */
- gf_th_stop(keyboard_th_params.thread);
- gf_th_del(keyboard_th_params.thread);
-
- /**************************************/
-
- /********** MPD generator thread ***********/
-
- /* Wait for and destroy MPD generator thread */
- gf_th_stop(mpd_th_params.thread);
- gf_th_del(mpd_th_params.thread);
-
- /**************************************/
-
- if (in_data->time_shift != -1) {
- // dc_message_queue_flush(&delete_seg_mq);
- /* Wait for and destroy delete segment thread */
- gf_th_stop(delete_seg_th_params.thread);
- gf_th_del(delete_seg_th_params.thread);
- }
-
- if (in_data->send_message == 1) {
- /* Wait for and destroy delete segment thread */
- gf_th_stop(send_frag_th_params.thread);
- gf_th_del(send_frag_th_params.thread);
- }
-
-exit:
- if (strcmp(in_data->audio_data_conf.filename, "") != 0) {
- /* Destroy audio input data */
- dc_audio_input_data_destroy(&audio_input_data);
- /* Close input audio */
- dc_audio_decoder_close(&audio_input_file);
- }
-
- if (strcmp(in_data->video_data_conf.filename, "") != 0) {
- /* Destroy video input data */
- dc_video_input_data_destroy(&video_input_data);
-
- for (i = 0; i < gf_list_count(in_data->vsrc); i++) {
- /* Close input video */
- dc_video_decoder_close(video_input_file[i]);
- }
-
- for (i=0; i<video_scaled_data_list.size; i++) {
- dc_video_scaler_data_destroy(video_scaled_data_list.video_scaled_data[i]);
- }
-
- /* Destroy video scaled data */
- dc_video_scaler_list_destroy(&video_scaled_data_list);
- }
-
- if (vscaler_th_params)
- gf_free(vscaler_th_params);
-
- for (i = 0; i < MAX_SOURCE_NUMBER; i++)
- gf_free(video_input_file[i]);
-
- dc_message_queue_free(&mq);
- dc_message_queue_free(&delete_seg_mq);
- dc_message_queue_free(&send_frag_mq);
-
- dc_unregister_libav();
-
- return ret;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef CONTROLER_H_
-#define CONTROLER_H_
-
-#include <gpac/tools.h>
-#include <gpac/thread.h>
-#include <gpac/media_tools.h>
-
-#include "register.h"
-#include "video_decoder.h"
-#include "video_encoder.h"
-#include "audio_decoder.h"
-#include "audio_encoder.h"
-#include "cmd_data.h"
-#include "message_queue.h"
-
-
-/* General thread parameters */
-typedef struct {
- /* command data */
- CmdData *in_data;
- /* handle to thread */
- GF_Thread *thread;
-
- MessageQueue *mq;
-} ThreadParam;
-
-/* Video thread parameters */
-typedef struct {
- /* command data */
- CmdData *in_data;
- /* The index in the configuration file to a video entry corresponding to the thread. */
- int video_conf_idx;
- /* Video input data structure corresponding to the thread. (This data is shared between video decoder and video scaler) */
- VideoInputData *video_input_data;
- /* Video scaled data structure corresponding to the thread. (This data is shared between video scaler and video encoder) */
- VideoScaledData *video_scaled_data;
- /* Video input file structure corresponding to the thread */
- VideoInputFile **video_input_file;
- /* handle to the thread */
- GF_Thread *thread;
-
- MessageQueue *mq;
- MessageQueue *delete_seg_mq;
- MessageQueue *send_seg_mq;
-} VideoThreadParam;
-
-/* Audio thread parameters */
-typedef struct {
- /* command data */
- CmdData *in_data;
- /* The index in the configuration file to an audio entry corresponding to the thread */
- int audio_conf_idx;
- /* Audio input data (This data is shared between audio decoder and audio encoder */
- AudioInputData *audio_input_data;
- /* Audio input file structure */
- AudioInputFile *audio_input_file;
- /* handle to the thread */
- GF_Thread *thread;
-
- MessageQueue *mq;
- MessageQueue *delete_seg_mq;
- MessageQueue *send_seg_mq;
-} AudioThreadParam;
-
-/*
- * Run controler runs all decoder, scalers, and encoders
- * of audio and video
- *
- * @param cmd_data [in] command data
- *
- * @return 0 on success, -1 on failure
- */
-int dc_run_controler(CmdData *);
-
-#endif /* CONTROLER_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "cmd_data.h"
-#include "controler.h"
-
-
-int main(int argc, char **argv)
-{
-#ifdef GPAC_MEMORY_TRACKING
- GF_MemTrackerType mem_track = GF_MemTrackerNone;
-#endif
- s32 res;
- CmdData cmd_data;
-
- /* Read command line (performs init) and parse input */
- res = dc_parse_command(argc, argv, &cmd_data);
- if (res < 0) {
- if (res==-1) dc_cmd_data_destroy(&cmd_data);
- return -1;
- }
-
- res = dc_run_controler(&cmd_data);
-
-#ifdef GPAC_MEMORY_TRACKING
- mem_track = cmd_data.mem_track;
-#endif
-
- /* Destroy command data */
- dc_cmd_data_destroy(&cmd_data);
-
- if (res) return res;
-
-#ifdef GPAC_MEMORY_TRACKING
- if (mem_track && (gf_memory_size() || gf_file_handles_count() )) {
- gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
- gf_memory_print();
- return 2;
- }
-#endif
- return 0;
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Romain Bouqueau
- * Copyright (c) Telecom ParisTech 2000-2013 - Romain Bouqueau 2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef LIBAV_COMPAT_H_
-#define LIBAV_COMPAT_H_
-
-#ifndef URL_WRONLY
-#define URL_WRONLY AVIO_FLAG_WRITE
-#endif
-
-#if (LIBAVCODEC_VERSION_MAJOR>54)
-#define CODEC_ID_RAWVIDEO AV_CODEC_ID_RAWVIDEO
-#define CODEC_ID_H264 AV_CODEC_ID_H264
-#endif
-
-#if (LIBAVCODEC_VERSION_MAJOR<54)
-#define LIBAV_ENCODE_OLD
-#endif
-
-#ifndef AV_CH_LAYOUT_STEREO
-#define AV_CH_FRONT_LEFT 0x00000001
-#define AV_CH_FRONT_RIGHT 0x00000002
-#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
-#endif
-
-#if (LIBAVCODEC_VERSION_MAJOR<55) || ((LIBAVCODEC_VERSION_MAJOR==55) && (LIBAVCODEC_VERSION_MINOR<=40))
-#define FF_ALLOC_FRAME avcodec_alloc_frame
-#define LIBAV_FRAME_OLD
-#else
-#define FF_ALLOC_FRAME av_frame_alloc
-#endif
-
-#endif
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "message_queue.h"
-
-
-void dc_message_queue_init(MessageQueue *mq)
-{
- memset(mq, 0, sizeof(MessageQueue));
- mq->first_node = NULL;
- mq->last_node = NULL;
- mq->nb_nodes = 0;
- mq->mutex = gf_mx_new("MessageQueue Mutex");
- mq->sem = gf_sema_new(1000, 0); //TODO: why 1000 (at other places too)
-}
-
-void dc_message_queue_put(MessageQueue *mq, void *data, u32 size)
-{
- MessageQueueNode *mqn = (MessageQueueNode*)gf_malloc(sizeof(MessageQueueNode));
- mqn->data = gf_malloc(size);
- memcpy(mqn->data, data, size);
- mqn->size = size;
- mqn->next = NULL;
-
- gf_mx_p(mq->mutex);
-
- if (!mq->last_node)
- mq->first_node = mqn;
- else
- mq->last_node->next = mqn;
-
- mq->last_node = mqn;
- mq->nb_nodes++;
-
- gf_sema_notify(mq->sem, 1);
- gf_mx_v(mq->mutex);
-}
-
-int dc_message_queue_get(MessageQueue *mq, void * data)
-{
- int ret = 0;
- MessageQueueNode *mqn;
-
- gf_mx_p(mq->mutex);
-
- mqn = mq->first_node;
- if (!mqn) {
- gf_mx_v(mq->mutex);
- ret = gf_sema_wait_for(mq->sem, 10000);
- gf_mx_p(mq->mutex);
-
- mqn = mq->first_node;
-
- if (!ret || !mqn) {
- gf_mx_v(mq->mutex);
- return -1;
- }
- }
- if (mqn) {
- mq->first_node = mqn->next;
- if (!mq->first_node)
- mq->last_node = NULL;
- mq->nb_nodes--;
- memcpy(data, mqn->data, mqn->size);
- ret = (int)mqn->size;
- gf_free(mqn->data);
- gf_free(mqn);
- }
-
- gf_mx_v(mq->mutex);
-
- return ret;
-}
-
-void dc_message_queue_flush(MessageQueue *mq)
-{
- MessageQueueNode *mqn, *mqn1;
-
- gf_mx_p(mq->mutex);
-
- for (mqn = mq->first_node; mqn != NULL; mqn = mqn1) {
- mqn1 = mqn->next;
- gf_free(mqn);
- }
- mq->last_node = NULL;
- mq->first_node = NULL;
- mq->nb_nodes = 0;
-
- gf_sema_notify(mq->sem, 1);
- gf_mx_v(mq->mutex);
-}
-
-void dc_message_queue_free(MessageQueue *mq)
-{
- dc_message_queue_flush(mq);
- gf_mx_del(mq->mutex);
- gf_sema_del(mq->sem);
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef MESSAGE_QUEUE_H_
-#define MESSAGE_QUEUE_H_
-
-#include <string.h>
-#include <stdlib.h>
-#include <gpac/thread.h>
-
-
-typedef struct MessageQueueNode {
- void *data;
- u32 size;
- struct MessageQueueNode *next;
-} MessageQueueNode;
-
-typedef struct MessageQueue {
- MessageQueueNode *last_node;
- MessageQueueNode *first_node;
- int nb_nodes;
- GF_Semaphore *sem;
- GF_Mutex *mutex;
-} MessageQueue;
-
-void dc_message_queue_init(MessageQueue *mq);
-
-void dc_message_queue_put(MessageQueue *mq, void *data, u32 size);
-
-int dc_message_queue_get(MessageQueue *mq, void *data);
-
-void dc_message_queue_flush(MessageQueue *mq);
-
-void dc_message_queue_free(MessageQueue *mq);
-
-#endif /* MESSAGE_QUEUE_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "register.h"
-
-
-static GF_List *av_mutex = NULL;
-
-int lock_call_back(void ** mutex, enum AVLockOp op)
-{
- switch (op) {
- case AV_LOCK_CREATE:
- {
- static int i = 0;
- char mxName[64];
- snprintf(mxName, 64, "AVLIB callback mutex %d", i++);
- *mutex = gf_mx_new(mxName);
- gf_list_add(av_mutex, *mutex);
- break;
- }
- case AV_LOCK_OBTAIN:
- gf_mx_p(*mutex);
- break;
- case AV_LOCK_RELEASE:
- gf_mx_v(*mutex);
- break;
- case AV_LOCK_DESTROY:
- gf_list_del_item(av_mutex, *mutex);
- gf_mx_del(*mutex);
- *mutex = NULL;
- break;
- }
-
- return 0;
-}
-
-void dc_register_libav()
-{
- av_mutex = gf_list_new();
-
- av_register_all();
- avcodec_register_all();
- avdevice_register_all();
- avformat_network_init();
-
- av_lockmgr_register(&lock_call_back);
-}
-
-void dc_unregister_libav()
-{
- av_lockmgr_register(NULL);
-
- if (av_mutex) {
- while (gf_list_count(av_mutex)) {
- GF_Mutex *mx = (GF_Mutex*)gf_list_last(av_mutex);
- gf_list_rem_last(av_mutex);
- gf_mx_del(mx);
- }
- gf_list_del(av_mutex);
- av_mutex = NULL;
- }
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef REGISTER_H_
-#define REGISTER_H_
-
-//#include <pthread.h>
-#include "../../modules/ffmpeg_in/ffmpeg_in.h"
-#include "libavcodec/avcodec.h"
-#include "libavdevice/avdevice.h"
-#include "libavformat/avformat.h"
-
-#include <gpac/thread.h>
-
-
-/*
- * Register all codecs and define
- * the lock manager on top of avlib
- */
-void dc_register_libav();
-void dc_unregister_libav();
-
-/*
- * performs libav* cleanup
- */
-void dc_unregister_libav();
-
-#endif /* REGISTER_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "task.h"
-
-
-void dc_task_init(TaskList *list)
-{
- list->tasks = gf_list_new();
- list->size = 0;
-}
-
-void dc_task_destroy(TaskList *list)
-{
- gf_list_del(list->tasks);
-}
-
-void dc_task_add(TaskList *list, int source_number, char *id_name, time_t start, time_t end)
-{
- Task *task = (Task*)gf_malloc(sizeof(Task));
- task->source_number = source_number;
- strncpy(task->id, id_name, MAX_ID_SIZE-1);
- task->start_time_t = start;
- task->end_time_t = end;
- gf_list_add(list->tasks, task);
- list->size++;
-}
-
-int dc_task_get_current(TaskList *list, Task *task)
-{
- u32 i;
- time_t now_time = time(NULL);
- for (i = 0; i<list->size; i++) {
- Task *cur_task = (Task*)gf_list_get(list->tasks, i);
- if (now_time > cur_task->start_time_t && now_time < cur_task->end_time_t) {
- //strncpy(task->id, cur_task->id, MAX_ID_SIZE-1);
- //memcpy(&task->start_time, &cur_task->start_time, sizeof(struct tm));
- //memcpy(&task->end_time, &cur_task->end_time, sizeof(struct tm));
- task->source_number = cur_task->source_number;
- return 0;
- }
- }
-
- task->source_number = 0;
- return -1;
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef TASK_H_
-#define TASK_H_
-
-#define MAX_ID_SIZE 512
-
-#include <stdio.h>
-#include <time.h>
-#include <gpac/list.h>
-
-
-typedef struct {
- char id[MAX_ID_SIZE];
- int source_number;
- time_t start_time_t;
- time_t end_time_t;
-} Task;
-
-typedef struct {
- GF_List *tasks;
- u32 size;
-} TaskList;
-
-/**
- * initialize a list of task
- */
-void dc_task_init(TaskList *list);
-
-/**
- * destroy the list of task
- */
-void dc_task_destroy(TaskList *list);
-
-/**
- * audio_input_data a task to the list
- */
-void dc_task_add(TaskList *list, int source_number, char *id_name, time_t start, time_t end);
-
-/**
- * give the task which corresponds to the time=NOW
- * note: in the case of infering tasks, the first one is picked
- */
-int dc_task_get_current(TaskList *list, Task *task);
-
-#endif /* TASK_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "video_data.h"
-
-
-void dc_video_data_set_default(VideoDataConf *video_data_conf)
-{
- memset(video_data_conf, 0, sizeof(VideoDataConf));
- video_data_conf->bitrate = -1;
- video_data_conf->framerate = -1;
- video_data_conf->crop_x = 0;
- video_data_conf->crop_y = 0;
- video_data_conf->height = -1;
- video_data_conf->width = -1;
-}
-
-void dc_video_input_data_end_signal(VideoInputData *video_input_data)
-{
- dc_producer_end_signal(&video_input_data->producer, &video_input_data->circular_buf);
- dc_producer_end_signal_previous(&video_input_data->producer, &video_input_data->circular_buf);
-}
-
-int dc_video_input_data_init(VideoInputData *video_input_data, /*int width, int height, int pix_fmt*/ int num_consumers, int mode, int max_source, int video_cb_size)
-{
- int i;
-
- dc_producer_init(&video_input_data->producer, video_cb_size, "video decoder");
-
- //video_input_data->width = width;
- //video_input_data->height = height;
- //video_input_data->pix_fmt = pix_fmt;
-
- video_input_data->vprop = (VideoInputProp*)gf_malloc(max_source * sizeof(VideoInputProp));
-
- dc_circular_buffer_create(&video_input_data->circular_buf, video_cb_size, mode, num_consumers);
-
- for (i=0; i<video_cb_size; i++) {
- VideoDataNode *video_data_node;
- GF_SAFEALLOC(video_data_node, VideoDataNode);
- if (!video_data_node) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_APP, ("Cannot allocate video input\n"));
- return -1;
- }
- video_input_data->circular_buf.list[i].data = (void *) video_data_node;
- video_data_node->vframe = FF_ALLOC_FRAME();
- }
-
- return 0;
-}
-
-void dc_video_input_data_set_prop(VideoInputData *video_input_data, int index, int width, int height, int crop_x, int crop_y, int pix_fmt, AVRational sar)
-{
- video_input_data->vprop[index].width = width;
- video_input_data->vprop[index].height = height;
- video_input_data->vprop[index].crop_x = crop_x;
- video_input_data->vprop[index].crop_y = crop_y;
- video_input_data->vprop[index].pix_fmt = pix_fmt;
- video_input_data->vprop[index].sar = sar;
-}
-
-void dc_video_input_data_destroy(VideoInputData *video_input_data)
-{
- int i;
- for (i=0; i<(int) video_input_data->circular_buf.size; i++) {
- if (video_input_data->circular_buf.list) {
- VideoDataNode *video_data_node = (VideoDataNode*)video_input_data->circular_buf.list[i].data;
- av_free(video_data_node->vframe);
- gf_free(video_data_node);
- }
- }
-
- dc_circular_buffer_destroy(&video_input_data->circular_buf);
- gf_free(video_input_data->vprop);
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef VIDEO_DATA_H_
-#define VIDEO_DATA_H_
-
-#include "../../modules/ffmpeg_in/ffmpeg_in.h"
-#include "libavcodec/avcodec.h"
-#include "libswscale/swscale.h"
-#include "libav_compat.h"
-
-#include "circular_buffer.h"
-
-#include <time.h>
-
-//anything different is broken in dash cast (random frame inversions at encoding time ...)
-#define VIDEO_CB_DEFAULT_SIZE 1
-
-
-/*
- * This structure corresponds to an
- * entry of video configuration in the
- * configuration file.
- */
-typedef struct {
- /* video file name */
- char filename[GF_MAX_PATH];
- /* video format */
- char format[GF_MAX_PATH];
- /* video format */
- char pixel_format[GF_MAX_PATH];
- /* v4l2 format */
- char v4l2f[GF_MAX_PATH];
- /* left crop */
- int crop_x;
- /* top crop */
- int crop_y;
- /* video final width */
- int width;
- /* video final height */
- int height;
- /* video bitrate */
- int bitrate;
- /* video frame rate */
- int framerate;
- /* video codec */
- char codec[GF_MAX_PATH];
- /* RFC6381 codec name, only valid when VIDEO_MUXER == GPAC_INIT_VIDEO_MUXER_AVC1 */
- char codec6381[RFC6381_CODEC_NAME_SIZE_MAX];
- /* custom parameter to be passed directly to the encoder - free it once you're done */
- char custom[GF_MAX_PATH];
- /*low delay is used*/
- int low_delay;
- /*demuxer buffer size or 0 if default FFmpeg one is used*/
- int demux_buffer_size;
-
- /* used for source switching */
- char source_id[GF_MAX_PATH];
- time_t start_time;
- time_t end_time;
-
- //copy over from source file
- AVRational time_base;
- u64 frame_duration;
-} VideoDataConf;
-
-typedef struct {
- /* Width, height and pixel format of the input video. */
- int width;
- int height;
- int crop_x, crop_y;
- int pix_fmt;
- AVRational sar;
-} VideoInputProp;
-
-/*
- * VideoInputData is designed to keep the data
- * of input video in a circular buffer.
- * The circular buffer has its own mechanism for synchronization.
- */
-typedef struct {
- /* The circular buffer of the video frames after decoding. */
- CircularBuffer circular_buf;
- /* The user of circular buffer has an index to it, which is in this variable. */
- Producer producer;
-
- VideoInputProp *vprop;
-
- /* Width, height and pixel format of the input video */
- //int width;
- //int height;
- //int pix_fmt;
- u64 frame_duration;
-} VideoInputData;
-
-
-/*
- * Each node in a circular buffer is a pointer.
- * To use the circular buffer for video frame we must
- * define the node. VideoDataNode simply contains
- * an AVFrame.
- */
-typedef struct {
- AVFrame * vframe;
- int source_number;
- uint8_t nb_raw_frames_ref;
- AVPacket raw_packet;
-
- u64 frame_ntp, frame_utc;
-} VideoDataNode;
-
-void dc_video_data_set_default(VideoDataConf *video_data_conf);
-
-/*
- * Initialize a VideoInputData.
- *
- * @param video_input_data [out] is the structure to be initialize.
- * @param width [in] input video width
- * @param height [in] input video height
- * @param pixfmt [in] input video pixel format
- * @param num_consumers [in] contains information on the number of users of circular buffer;
- * which means the number of video encoders.
- * @param live [in] indicates the system is live
- *
- * @return 0 on success, -1 on failure.
- *
- * @note Must use dc_video_data_destroy to free memory.
- */
-int dc_video_input_data_init(VideoInputData *video_input_data,/* int width, int height, int pix_fmt,*/ int num_consumers, int mode, int num_producers, int video_cb_size);
-
-/*
- * Set properties for a VideoInputData.
- */
-void dc_video_input_data_set_prop(VideoInputData *video_input_data, int index, int width, int height, int crop_x, int crop_y, int pix_fmt, AVRational sar);
-
-/*
- * Destroy a VideoInputData.
- *
- * @param video_input_data [in] the structure to be destroyed.
- */
-void dc_video_input_data_destroy(VideoInputData *video_input_data);
-
-/*
- * Signal to all the users of the circular buffer in the VideoInputData
- * which the current node is the last node to consume.
- *
- * @param video_input_data [in] the structure to be signaled on.
- */
-void dc_video_input_data_end_signal(VideoInputData *video_input_data);
-
-#endif /* VIDEO_DATA_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "video_decoder.h"
-#include <time.h>
-#include <gpac/network.h>
-
-
-//#define DASHCAST_DEBUG_TIME_
-
-
-int dc_video_decoder_open(VideoInputFile *video_input_file, VideoDataConf *video_data_conf, int mode, int no_loop, int nb_consumers)
-{
- s32 ret;
- u32 i;
- s32 open_res;
- AVInputFormat *in_fmt = NULL;
- AVDictionary *options = NULL;
- AVCodecContext *codec_ctx;
- AVCodec *codec;
-
- memset(video_input_file, 0, sizeof(VideoInputFile));
-
- if (video_data_conf->width > 0 && video_data_conf->height > 0) {
- char vres[16];
- snprintf(vres, sizeof(vres), "%dx%d", video_data_conf->width, video_data_conf->height);
- ret = av_dict_set(&options, "video_size", vres, 0);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not set video size %s.\n", vres));
- return -1;
- }
- }
-
- if (video_data_conf->framerate > 0) {
- char vfr[16];
- snprintf(vfr, sizeof(vfr), "%d", video_data_conf->framerate);
- ret = av_dict_set(&options, "framerate", vfr, 0);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not set video framerate %s.\n", vfr));
- return -1;
- }
- }
-
- if (strlen(video_data_conf->pixel_format)) {
- ret = av_dict_set(&options, "pixel_format", video_data_conf->pixel_format, 0);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not set pixel format %s.\n", video_data_conf->pixel_format));
- return -1;
- }
- }
-
-#ifndef WIN32
- if (strcmp(video_data_conf->v4l2f, "") != 0) {
- ret = av_dict_set(&options, "input_format", video_data_conf->v4l2f, 0);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not set input format %s.\n", video_data_conf->v4l2f));
- return -1;
- }
- }
-#endif
-
- if (strcmp(video_data_conf->format, "") != 0) {
- in_fmt = av_find_input_format(video_data_conf->format);
- if (in_fmt == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot find the format %s.\n", video_data_conf->format));
- return -1;
- }
- }
-
- video_input_file->av_fmt_ctx = NULL;
-
- if (video_data_conf->demux_buffer_size) {
- char szBufSize[100];
- sprintf(szBufSize, "%d", video_data_conf->demux_buffer_size);
- ret = av_dict_set(&options, "buffer_size", szBufSize, 0);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not set demuxer's input buffer size.\n"));
- return -1;
- }
- }
-
- /* Open video */
- open_res = avformat_open_input(&video_input_file->av_fmt_ctx, video_data_conf->filename, in_fmt, options ? &options : NULL);
- if ( (open_res < 0) && !stricmp(video_data_conf->filename, "screen-capture-recorder") ) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Buggy screen capture input (open failed with code %d), retrying without specifying resolution\n", open_res));
- av_dict_set(&options, "video_size", NULL, 0);
- open_res = avformat_open_input(&video_input_file->av_fmt_ctx, video_data_conf->filename, in_fmt, options ? &options : NULL);
- }
-
- if ( (open_res < 0) && options) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error %d opening input - retrying without options\n", open_res));
- av_dict_free(&options);
- open_res = avformat_open_input(&video_input_file->av_fmt_ctx, video_data_conf->filename, in_fmt, NULL);
- }
-
- if (open_res < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open file %s\n", video_data_conf->filename));
- return -1;
- }
-
- /* Retrieve stream information */
- if (avformat_find_stream_info(video_input_file->av_fmt_ctx, NULL) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot find stream information\n"));
- return -1;
- }
-
- av_dump_format(video_input_file->av_fmt_ctx, 0, video_data_conf->filename, 0);
-
- /* Find the first video stream */
- video_input_file->vstream_idx = -1;
- for (i = 0; i < video_input_file->av_fmt_ctx->nb_streams; i++) {
- if (video_input_file->av_fmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
- video_input_file->vstream_idx = i;
- break;
- }
- }
- if (video_input_file->vstream_idx == -1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot find a video stream\n"));
- return -1;
- }
-
- /* Get a pointer to the codec context for the video stream */
- codec_ctx = video_input_file->av_fmt_ctx->streams[video_input_file->vstream_idx]->codec;
-
- /* Find the decoder for the video stream */
- codec = avcodec_find_decoder(codec_ctx->codec_id);
- if (codec == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Codec is not supported.\n"));
- if (!video_input_file->av_fmt_ctx_ref_cnt)
- avformat_close_input(&video_input_file->av_fmt_ctx);
- return -1;
- }
-
- /* Open codec */
- if (avcodec_open2(codec_ctx, codec, NULL) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open codec.\n"));
- if (!video_input_file->av_fmt_ctx_ref_cnt)
- avformat_close_input(&video_input_file->av_fmt_ctx);
- return -1;
- }
-
- video_input_file->width = codec_ctx->width;
- video_input_file->height = codec_ctx->height;
- video_input_file->sar = codec_ctx->sample_aspect_ratio;
-
- video_input_file->pix_fmt = codec_ctx->pix_fmt;
- if (codec_ctx->time_base.num==1) {
- GF_LOG(GF_LOG_WARNING, GF_LOG_DASH, ("AVCTX give frame duration of %d/%d - keeping requested rate %d, but this may result in unexpected behaviour.\n", codec_ctx->time_base.num, codec_ctx->time_base.den, video_data_conf->framerate ));
-
- if (codec_ctx->time_base.den==1000000) {
- codec_ctx->time_base.num = codec_ctx->time_base.den / video_data_conf->framerate;
- }
- }
- else if (video_data_conf->framerate >= 0 && codec_ctx->time_base.num) {
- video_data_conf->framerate = codec_ctx->time_base.den / codec_ctx->time_base.num;
- }
- if (video_data_conf->framerate <= 1 || video_data_conf->framerate > 1000) {
- const int num = video_input_file->av_fmt_ctx->streams[video_input_file->vstream_idx]->avg_frame_rate.num;
- const int den = video_input_file->av_fmt_ctx->streams[video_input_file->vstream_idx]->avg_frame_rate.den == 0 ? 1 : video_input_file->av_fmt_ctx->streams[video_input_file->vstream_idx]->avg_frame_rate.den;
- video_data_conf->framerate = num / den;
- if (video_data_conf->framerate / 1000 != 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Framerate %d was divided by 1000: %d\n", video_data_conf->framerate, video_data_conf->framerate/1000));
- video_data_conf->framerate = video_data_conf->framerate / 1000;
- }
-
- if (video_data_conf->framerate <= 1 || video_data_conf->framerate > 1000) {
- video_data_conf->framerate = num / den;
- if (video_data_conf->framerate / 1000 != 0) {
- video_data_conf->framerate = video_data_conf->framerate / 1000;
- }
- }
- }
-
- if (video_data_conf->framerate <= 1 || video_data_conf->framerate > 1000) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Invalid input framerate %d (AVCTX timebase is %d/%d).\n", video_data_conf->framerate, codec_ctx->time_base.num, codec_ctx->time_base.den));
- return -1;
- }
-
- video_data_conf->time_base = video_input_file->av_fmt_ctx->streams[video_input_file->vstream_idx]->time_base;
- video_input_file->mode = mode;
- video_input_file->no_loop = no_loop;
- video_input_file->nb_consumers = nb_consumers;
- return 0;
-}
-
-int dc_video_decoder_read(VideoInputFile *video_input_file, VideoInputData *video_input_data, int source_number, int use_source_timing, int is_live_capture, const int *exit_signal_addr)
-{
-#ifdef DASHCAST_DEBUG_TIME_
- struct timeval start, end;
- long elapsed_time;
-#endif
- AVPacket packet;
- int ret, got_frame, already_locked = 0;
- AVCodecContext *codec_ctx;
- VideoDataNode *video_data_node;
-
- /* Get a pointer to the codec context for the video stream */
- codec_ctx = video_input_file->av_fmt_ctx->streams[video_input_file->vstream_idx]->codec;
-
- /* Read frames */
- while (1) {
-#ifdef DASHCAST_DEBUG_TIME_
- gf_gettimeofday(&start, NULL);
-#endif
- memset(&packet, 0, sizeof(AVPacket));
- ret = av_read_frame(video_input_file->av_fmt_ctx, &packet);
-#ifdef DASHCAST_DEBUG_TIME_
- gf_gettimeofday(&end, NULL);
- elapsed_time = (end.tv_sec * 1000000 + end.tv_usec) - (start.tv_sec * 1000000 + start.tv_usec);
- fprintf(stdout, "fps: %f\n", 1000000.0/elapsed_time);
-#endif
-
- /* If we demux for the audio thread, send the packet to the audio */
- if (video_input_file->av_fmt_ctx_ref_cnt && ((packet.stream_index != video_input_file->vstream_idx) || (ret == AVERROR_EOF))) {
- AVPacket *packet_copy = NULL;
- if (ret != AVERROR_EOF) {
- GF_SAFEALLOC(packet_copy, AVPacket);
- if (packet_copy)
- memcpy(packet_copy, &packet, sizeof(AVPacket));
- }
-
- assert(video_input_file->av_pkt_list);
- gf_mx_p(video_input_file->av_pkt_list_mutex);
- gf_list_add(video_input_file->av_pkt_list, packet_copy);
- gf_mx_v(video_input_file->av_pkt_list_mutex);
-
- if (ret != AVERROR_EOF) {
- continue;
- }
- }
-
- if (ret == AVERROR_EOF) {
- if (video_input_file->mode == LIVE_MEDIA && video_input_file->no_loop == 0) {
- av_seek_frame(video_input_file->av_fmt_ctx, video_input_file->vstream_idx, 0, 0);
- av_free_packet(&packet);
- continue;
- }
-
- dc_producer_lock(&video_input_data->producer, &video_input_data->circular_buf);
- dc_producer_unlock_previous(&video_input_data->producer, &video_input_data->circular_buf);
- video_data_node = (VideoDataNode *) dc_producer_produce(&video_input_data->producer, &video_input_data->circular_buf);
- video_data_node->source_number = source_number;
- /* Flush decoder */
- memset(&packet, 0, sizeof(AVPacket));
-#ifndef FF_API_AVFRAME_LAVC
- avcodec_get_frame_defaults(video_data_node->vframe);
-#else
- av_frame_unref(video_data_node->vframe);
-#endif
-
- avcodec_decode_video2(codec_ctx, video_data_node->vframe, &got_frame, &packet);
- if (got_frame) {
- dc_producer_advance(&video_input_data->producer, &video_input_data->circular_buf);
- return 0;
- }
-
- dc_producer_end_signal(&video_input_data->producer, &video_input_data->circular_buf);
- dc_producer_unlock(&video_input_data->producer, &video_input_data->circular_buf);
- return -2;
- }
- else if (ret < 0)
- {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot read video frame.\n"));
- continue;
- }
-
- /* Is this a packet from the video stream? */
- if (packet.stream_index == video_input_file->vstream_idx) {
- u32 nb_retry = 10;
- while (!already_locked) {
- if (dc_producer_lock(&video_input_data->producer, &video_input_data->circular_buf) < 0) {
- if (!nb_retry) break;
- gf_sleep(10);
- nb_retry--;
- continue;
- }
- dc_producer_unlock_previous(&video_input_data->producer, &video_input_data->circular_buf);
- already_locked = 1;
- }
- if (!already_locked) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[dashcast] Live system dropped a video frame\n"));
- continue;
- }
-
- video_data_node = (VideoDataNode *) dc_producer_produce(&video_input_data->producer, &video_input_data->circular_buf);
- video_data_node->source_number = source_number;
-
- /* Set video frame to default */
-#ifndef FF_API_AVFRAME_LAVC
- avcodec_get_frame_defaults(video_data_node->vframe);
-#else
- av_frame_unref(video_data_node->vframe);
-#endif
-
- video_data_node->frame_ntp = gf_net_get_ntp_ts();
- video_data_node->frame_utc = gf_net_get_utc();
-
- /* Decode video frame */
- if (avcodec_decode_video2(codec_ctx, video_data_node->vframe, &got_frame, &packet) < 0) {
- av_free_packet(&packet);
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error while decoding video.\n"));
- dc_producer_end_signal(&video_input_data->producer, &video_input_data->circular_buf);
- dc_producer_unlock(&video_input_data->producer, &video_input_data->circular_buf);
- return -1;
- }
-
- /* Did we get a video frame? */
- if (got_frame) {
- if (use_source_timing && is_live_capture) {
- u64 pts;
- if (video_input_file->pts_init == 0) {
- video_input_file->pts_init = 1;
- video_input_file->utc_at_init = gf_net_get_utc();
- video_input_file->first_pts = packet.pts;
- video_input_file->prev_pts = 0;
- video_input_data->frame_duration = 0;
- }
-#if 0
- if (video_input_file->pts_init && (video_input_file->pts_init!=3) ) {
- if (packet.pts==AV_NOPTS_VALUE) {
- video_input_file->pts_init=1;
- } else if (video_input_file->pts_init==1) {
- video_input_file->pts_init=2;
- video_input_file->pts_dur_estimate = packet.pts;
- } else if (video_input_file->pts_init==2) {
- video_input_file->pts_init=3;
- video_input_data->frame_duration = packet.pts - video_input_file->pts_dur_estimate;
- video_input_file->sync_tolerance = 9*video_input_data->frame_duration/5;
- //TODO - check with audio if sync is OK
- }
- }
-#endif
-
- //move to 0-based PTS
- if (packet.pts!=AV_NOPTS_VALUE) {
- pts = packet.pts - video_input_file->first_pts;
- } else {
- pts = video_input_file->prev_pts + video_input_data->frame_duration;
- }
-
- //check for drop frames
-#ifndef GPAC_DISABLE_LOG
- if (0 && gf_log_tool_level_on(GF_LOG_DASH, GF_LOG_WARNING)) {
- if (pts - video_input_file->prev_pts > video_input_file->sync_tolerance) {
- u32 nb_lost=0;
- while (video_input_file->prev_pts + video_input_data->frame_duration + video_input_file->sync_tolerance < pts) {
- video_input_file->prev_pts += video_input_data->frame_duration;
- nb_lost++;
- }
- if (nb_lost) {
- GF_LOG(GF_LOG_WARNING, GF_LOG_DASH, ("[DashCast] Capture lost %d video frames \n", nb_lost));
- }
- }
- }
-#endif
-
- if ((pts != video_input_file->prev_pts) && (video_input_file->pts_init == 1)) {
- video_input_file->pts_init = 2;
- video_input_data->frame_duration = pts - video_input_file->prev_pts;
- video_input_file->sync_tolerance = 9*video_input_data->frame_duration/5;
- }
-
- video_input_file->prev_pts = pts;
- video_data_node->vframe->pts = pts;
- }
-
- if (video_data_node->vframe->pts==AV_NOPTS_VALUE) {
- if (!use_source_timing) {
- video_data_node->vframe->pts = video_input_file->frame_decoded;
- } else {
- video_data_node->vframe->pts = video_data_node->vframe->pkt_pts;
- }
- }
- video_input_file->frame_decoded++;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Video Frame TS "LLU" decoded at UTC "LLU" ms (frame duration %d)\n", video_data_node->vframe->pts, gf_net_get_utc(), video_input_data->frame_duration));
-
- // For a decode/encode process we must free this memory.
- //But if the input is raw and there is no need to decode then
- // the packet is directly passed for decoded frame. We must wait until rescale is done before freeing it
-
- if (codec_ctx->codec->id == CODEC_ID_RAWVIDEO) {
- if (is_live_capture && !video_input_data->frame_duration) {
- } else {
- video_data_node->nb_raw_frames_ref = video_input_file->nb_consumers;
-
- video_data_node->raw_packet = packet;
-
- dc_producer_advance(&video_input_data->producer, &video_input_data->circular_buf);
- while (video_data_node->nb_raw_frames_ref && ! *exit_signal_addr) {
- gf_sleep(0);
- }
- }
- } else {
- dc_producer_advance(&video_input_data->producer, &video_input_data->circular_buf);
- av_free_packet(&packet);
- }
- return 0;
-
- }
- }
-
- /* Free the packet that was allocated by av_read_frame */
- av_free_packet(&packet);
- }
-
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Unknown error while reading video frame.\n"));
- return -1;
-}
-
-void dc_video_decoder_close(VideoInputFile *video_input_file)
-{
- /* Close the video format context */
- if (!video_input_file->av_fmt_ctx_ref_cnt)
- avformat_close_input(&video_input_file->av_fmt_ctx);
-
- video_input_file->av_pkt_list = NULL;
- video_input_file->av_pkt_list_mutex = NULL;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef VIDEO_DECODER_H_
-#define VIDEO_DECODER_H_
-
-#include "video_data.h"
-
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
-
-
-/*
- * The structure which keeps the data of
- * input video file.
- */
-typedef struct {
- /* Format context structure provided by avlib to open and read from a media file. */
- AVFormatContext *av_fmt_ctx;
- /* A reference counter on the format context (may be shared with other sources). Currently redundant with av_pkt_list non-NULLness. */
- int av_fmt_ctx_ref_cnt;
- /* A list of AVPackets and return value to be processed: when this parameter is non-null,
- * the video thread makes the demux and pushes the packets. Packets must be freed when retrieved.*/
- GF_List *av_pkt_list;
- GF_Mutex *av_pkt_list_mutex;
- /* The index of the video stream in the file. */
- int vstream_idx;
- /* video width, height, and pixel format. */
- int width;
- int height;
- int pix_fmt;
- AVRational sar;
-
- int mode;
- int no_loop, nb_consumers;
-
- u32 frame_decoded;
- u32 pts_init;
- u64 first_pts, prev_pts, pts_dur_estimate, sync_tolerance;
- u64 utc_at_init;
-} VideoInputFile;
-
-/*
- * Open the input video
- *
- * @param cmd_data [in] contains information about the file name
- * and the video format.
- *
- * @param video_input_file [out] pointer to the structure which we want to
- * open the file
- *
- * @return 0 on success -1 on failure.
- */
-int dc_video_decoder_open(VideoInputFile *video_input_file, VideoDataConf *video_data_conf, int mode, int no_loop, int nb_consumers);
-
-/*
- * Read and decode video and put decoded frames on circular buffer
- *
- * @param video_input_file [in] contains info on input video.
- * @param video_input_data [out] the decoded samples will be put
- * on the circular buffer of this parameter.
- *
- * @return 0 on success, -1 on failure, -2 on EOF (end of the file)
- */
-int dc_video_decoder_read(VideoInputFile *video_input_file, VideoInputData *video_input_data, int source_number, int use_source_timing, int is_live_capture, const int *exit_signal_addr);
-
-/*
- * Close the input video
- *
- * @param video_input_file [in] the video file to be closed
- *
- */
-void dc_video_decoder_close(VideoInputFile *);
-
-#endif /* VIDEO_DECODER_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "video_encoder.h"
-#include "libavutil/opt.h"
-#include "libavdevice/avdevice.h"
-
-
-#if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(__GNUC__)
-
-#define _TOSTR(_val) #_val
-#define TOSTR(_val) _TOSTR(_val)
-
-#endif
-
-
-//#define DEBUG 1
-
-
-/**
- * A function which pushes argument to a libav codec using its private data.
- * param priv_data
- * param options a list of space separated and ':' affected options (e.g. "a:b c:d e:f"). @options be non NULL.
- */
-void build_dict(void *priv_data, const char *options) {
- char *opt = gf_strdup(options);
- char *tok = strtok(opt, "=");
- char *tokval = NULL;
- while (tok && (tokval=strtok(NULL, " "))) {
- if (av_opt_set(priv_data, tok, tokval, 0) < 0)
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Unknown custom option \"%s\" with value \"%s\" in %s\n", tok, tokval, options));
- tok = strtok(NULL, "=");
- }
- gf_free(opt);
-}
-
-int dc_video_encoder_open(VideoOutputFile *video_output_file, VideoDataConf *video_data_conf, Bool use_source_timing, AVRational sar)
-{
- video_output_file->vbuf_size = 9 * video_data_conf->width * video_data_conf->height + 10000;
- video_output_file->vbuf = (uint8_t *) av_malloc(video_output_file->vbuf_size);
- video_output_file->video_data_conf = video_data_conf;
-
- video_output_file->codec = avcodec_find_encoder_by_name(video_data_conf->codec);
- if (video_output_file->codec == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Output video codec %s not found\n", video_data_conf->codec));
- return -1;
- }
-
- video_output_file->codec_ctx = avcodec_alloc_context3(video_output_file->codec);
-
- video_output_file->codec_ctx->codec_id = video_output_file->codec->id;
- video_output_file->codec_ctx->codec_type = AVMEDIA_TYPE_VIDEO;
- video_output_file->codec_ctx->bit_rate = video_data_conf->bitrate;
- video_output_file->codec_ctx->width = video_data_conf->width;
- video_output_file->codec_ctx->height = video_data_conf->height;
- video_output_file->codec_ctx->sample_aspect_ratio = sar;
-
- video_output_file->codec_ctx->time_base.num = 1;
- video_output_file->codec_ctx->time_base.den = video_output_file->gop_size ? video_output_file->gop_size : video_data_conf->framerate;
-
- video_output_file->use_source_timing = use_source_timing;
- if (use_source_timing) {
- //for avcodec to do rate allocation, we need to have ctx->timebase == 1/framerate
- video_output_file->codec_ctx->time_base.den = video_data_conf->time_base.den;
- video_output_file->codec_ctx->time_base.num = video_data_conf->time_base.num * video_data_conf->time_base.den / video_data_conf->framerate;
- }
- video_output_file->codec_ctx->pix_fmt = PIX_FMT_YUV420P;
- video_output_file->codec_ctx->gop_size = video_data_conf->framerate;
-
-// video_output_file->codec_ctx->codec_id = video_codec->id;
-// video_output_file->codec_ctx->codec_type = AVMEDIA_TYPE_VIDEO;
-// video_output_file->codec_ctx->bit_rate = video_data_conf->bitrate;
-// video_output_file->codec_ctx->width = video_data_conf->width;
-// video_output_file->codec_ctx->height = video_data_conf->height;
-// video_output_file->codec_ctx->time_base = (AVRational) {1 ,
-// video_output_file->video_data_conf->framerate};
-// video_output_file->codec_ctx->codec->pix_fmt = PIX_FMT_YUV420P;
- video_output_file->codec_ctx->gop_size = video_data_conf->framerate;
-//
-// av_opt_set(video_output_file->codec_ctx->priv_data, "preset", "ultrafast", 0);
-// av_opt_set(video_output_file->codec_ctx->priv_data, "tune", "zerolatency", 0);
-
- /*
- video_output_file->codec_ctx->max_b_frames = 0;
- video_output_file->codec_ctx->thread_count = 1;
- video_output_file->codec_ctx->delay = 0;
- video_output_file->codec_ctx->rc_lookahead = 0;
- */
-
- /*
- * video_stream->codec->gosize = video_output_file->vfr;
- * videoStream->codec->gosize = 1;
- * video_stream->codec->rc_lookahead = 0;
- * videoStream->time_base = (AVRational) {1 , 1000000};
- * videoStream->r_frame_rate = (AVRational) {outVideoCtx->video_framerate, 1};
- * av_opt_set(videoStream->codec->priv_data, "preset", "slow", 0);
- * videoStream->codec->me_range = 16;
- * videoStream->codec->max_qdiff = 4;
- * videoStream->codec->qmin = 10;
- * videoStream->codec->qmax = 51;
- * videoStream->codec->qcompress = 0.6;
- * videoStream->codec->profile = FF_PROFILE_H264_BASELINE;
- * videoStream->codec->level = 10;
- *
- */
-
- if ( strlen(video_data_conf->custom) ) {
- build_dict(video_output_file->codec_ctx->priv_data, video_data_conf->custom);
- } else if (video_data_conf->low_delay) {
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("Video Encoder: applying default options (preset=ultrafast tune=zerolatency)\n"));
- av_opt_set(video_output_file->codec_ctx->priv_data, "vprofile", "baseline", 0);
- av_opt_set(video_output_file->codec_ctx->priv_data, "preset", "ultrafast", 0);
- av_opt_set(video_output_file->codec_ctx->priv_data, "tune", "zerolatency", 0);
- if (strstr(video_data_conf->codec, "264")) {
- av_opt_set(video_output_file->codec_ctx->priv_data, "x264opts", "no-mbtree:sliced-threads:sync-lookahead=0", 0);
- }
- }
-
- if (video_output_file->gdr) {
- av_opt_set_int(video_output_file->codec_ctx->priv_data, "intra-refresh", 1, 0);
- av_opt_set_int(video_output_file->codec_ctx->priv_data, "key-int", video_output_file->gdr, 0);
- }
-
-#ifdef AV_CODEC_FLAG_GLOBAL_HEADER
- //the global header gives access to the extradata (SPS/PPS)
- video_output_file->codec_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
-#endif
-
- video_output_file->vstream_idx = 0;//video_stream->index;
-
- /* open the video codec - options are passed thru video_output_file->codec_ctx->priv_data */
- if (avcodec_open2(video_output_file->codec_ctx, video_output_file->codec, NULL) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output video codec\n"));
- return -1;
- }
-
- video_output_file->rep_id = video_data_conf->filename;
- return 0;
-}
-
-int dc_video_encoder_encode(VideoOutputFile *video_output_file, VideoScaledData *video_scaled_data)
-{
- VideoScaledDataNode *video_data_node;
- int ret;
- u64 time_spent;
- int got_packet = 0;
- AVPacket pkt;
-
- AVCodecContext *video_codec_ctx = video_output_file->codec_ctx;
-
- //FIXME: deadlock when pressing 'q' with BigBuckBunny_640x360.m4v
- ret = dc_consumer_lock(&video_output_file->consumer, &video_scaled_data->circular_buf);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Video encoder got an end of buffer!\n"));
- return -2;
- }
-
- if (video_scaled_data->circular_buf.size > 1)
- dc_consumer_unlock_previous(&video_output_file->consumer, &video_scaled_data->circular_buf);
-
- video_data_node = (VideoScaledDataNode*)dc_consumer_consume(&video_output_file->consumer, &video_scaled_data->circular_buf);
-
- /*
- * Set PTS (method 1)
- */
- if (!video_output_file->use_source_timing) {
- video_data_node->vframe->pts = video_codec_ctx->frame_number;
- }
-
- time_spent = gf_sys_clock_high_res();
- /* Encoding video */
- av_init_packet(&pkt);
- pkt.data = video_output_file->vbuf;
- pkt.size = video_output_file->vbuf_size;
- pkt.pts = pkt.dts = video_data_node->vframe->pkt_dts = video_data_node->vframe->pkt_pts = video_data_node->vframe->pts;
- video_data_node->vframe->pict_type = 0;
- video_data_node->vframe->width = video_codec_ctx->width;
- video_data_node->vframe->height = video_codec_ctx->height;
- video_data_node->vframe->format = video_codec_ctx->pix_fmt;
-
-
-#ifdef LIBAV_ENCODE_OLD
- if (!video_output_file->segment_started)
- video_data_node->vframe->pict_type = FF_I_TYPE;
-
- video_output_file->encoded_frame_size = avcodec_encode_video(video_codec_ctx, video_output_file->vbuf, video_output_file->vbuf_size, video_data_node->vframe);
- got_packet = video_output_file->encoded_frame_size>=0 ? 1 : 0;
-#else
- //this is correct but unfortunately doesn't work with some versions of FFMPEG (output is just grey video ...)
- if (!video_output_file->segment_started)
- video_data_node->vframe->pict_type = AV_PICTURE_TYPE_I;
-
- video_output_file->encoded_frame_size = avcodec_encode_video2(video_codec_ctx, &pkt, video_data_node->vframe, &got_packet);
-#endif
-
- time_spent = gf_sys_clock_high_res() - time_spent;
- //this is not true with libav !
-#ifndef GPAC_USE_LIBAV
- if (video_output_file->encoded_frame_size >= 0)
- video_output_file->encoded_frame_size = pkt.size;
-#else
- if (got_packet)
- video_output_file->encoded_frame_size = pkt.size;
-#endif
- if (video_output_file->encoded_frame_size >= 0) {
- if (got_packet) {
- video_codec_ctx->coded_frame->pts = video_codec_ctx->coded_frame->pkt_pts = pkt.pts;
- video_codec_ctx->coded_frame->pkt_dts = pkt.dts;
- video_codec_ctx->coded_frame->key_frame = (pkt.flags & AV_PKT_FLAG_KEY) ? 1 : 0;
- video_output_file->frame_ntp = video_data_node->frame_ntp;
- video_output_file->frame_utc = video_data_node->frame_utc;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Video %s Frame TS "LLU" encoded at UTC "LLU" ms in "LLU" us size %d bytes\n", video_output_file->rep_id, pkt.pts, gf_net_get_utc(), time_spent, video_output_file->encoded_frame_size ));
- }
- }
-
- dc_consumer_advance(&video_output_file->consumer);
-
- if (video_scaled_data->circular_buf.size == 1)
- dc_consumer_unlock_previous(&video_output_file->consumer, &video_scaled_data->circular_buf);
-
- if (video_output_file->encoded_frame_size < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Error occured while encoding video frame.\n"));
- return -1;
- }
-
- /* if zero size, it means the image was buffered */
-// if (out_size > 0) {
-// av_init_packet(&pkt);
-// pkt.data = NULL;
-// pkt.size = 0;
-//
-// if (video_codec_ctx->coded_frame->pts != AV_NOPTS_VALUE) {
-// pkt.pts = av_rescale_q(video_codec_ctx->coded_frame->pts,
-// video_codec_ctx->time_base, video_stream->time_base);
-// }
-//
-//
-// if (video_codec_ctx->coded_frame->key_frame)
-// pkt.flags |= AV_PKT_FLAG_KEY;
-//
-// pkt.stream_index = video_stream->index;
-// pkt.data = video_output_file->vbuf;
-// pkt.size = out_size;
-//
-// // write the compressed frame in the media file
-// if (av_interleaved_write_frame(video_output_file->av_fmt_ctx, &pkt)
-// != 0) {
-// GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Writing frame is not successful\n"));
-// return -1;
-// }
-//
-// av_free_packet(&pkt);
-//
-// }
-
- return video_output_file->encoded_frame_size;
-}
-
-void dc_video_encoder_close(VideoOutputFile *video_output_file)
-{
-// int i;
-//
-// // free the streams
-// for (i = 0; i < video_output_file->av_fmt_ctx->nb_streams; i++) {
-// avcodec_close(video_output_file->av_fmt_ctx->streams[i]->codec);
-// av_freep(&video_output_file->av_fmt_ctx->streams[i]->info);
-// }
- av_free(video_output_file->vbuf);
- avcodec_close(video_output_file->codec_ctx);
- av_free(video_output_file->codec_ctx);
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef VIDEO_ENCODER_H_
-#define VIDEO_ENCODER_H_
-
-#include "video_muxer.h"
-
-
-/*
- * Open an video stream
- *
- * @param video_output_file [in] add a video stream to the file
- * with the parameters already passed to open_video_output
- *
- * @return 0 on success, -1 on failure
- */
-int dc_video_encoder_open(VideoOutputFile *video_output_file, VideoDataConf *video_data_conf, Bool use_source_timing, AVRational sar);
-
-/*
- * Read the decoded video frames from circular buffer
- * of the corresponding resolution
- * and encode and write them on the output file
- *
- * @param video_output_file [in] video output file
- * @param video_scaled_data [in] scaled video data structure which
- * contains a circular buffer with video frames
- *
- * @return 0 on success, -1 on failure, -2 on finishing;
- * when there is no more data on circular buffer to encode
- */
-int dc_video_encoder_encode(VideoOutputFile *video_output_file, VideoScaledData *video_scaled_data);
-
-/*
- * Close the output video file
- *
- * @param video_output_file [in] video output file
- */
-void dc_video_encoder_close(VideoOutputFile *video_output_file);
-
-#endif /* VIDEO_ENCODER_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "video_muxer.h"
-#include "libavutil/opt.h"
-#include <gpac/network.h>
-
-
-/**
- * A function which takes FFmpeg H264 extradata (SPS/PPS) and bring them ready to be pushed to the MP4 muxer.
- * @param extradata
- * @param extradata_size
- * @param dstcfg
- * @returns GF_OK is the extradata was parsed and is valid, other values otherwise.
- */
-static GF_Err avc_import_ffextradata(const u8 *extradata, const u64 extradata_size, GF_AVCConfig *dstcfg)
-{
-#ifdef GPAC_DISABLE_AV_PARSERS
- return GF_OK;
-#else
- u8 nal_size;
- AVCState avc;
- GF_BitStream *bs;
- if (!extradata || (extradata_size < sizeof(u32)))
- return GF_BAD_PARAM;
- bs = gf_bs_new((const char *) extradata, extradata_size, GF_BITSTREAM_READ);
- if (!bs)
- return GF_BAD_PARAM;
- if (gf_bs_read_u32(bs) != 0x00000001) {
- gf_bs_del(bs);
- return GF_BAD_PARAM;
- }
-
- //SPS
- {
- s32 idx;
- char *buffer = NULL;
- const u64 nal_start = 4;
- nal_size = gf_media_nalu_next_start_code_bs(bs);
- if (nal_start + nal_size > extradata_size) {
- gf_bs_del(bs);
- return GF_BAD_PARAM;
- }
- buffer = (char*)gf_malloc(nal_size);
- gf_bs_read_data(bs, buffer, nal_size);
- gf_bs_seek(bs, nal_start);
- if ((gf_bs_read_u8(bs) & 0x1F) != GF_AVC_NALU_SEQ_PARAM) {
- gf_bs_del(bs);
- gf_free(buffer);
- return GF_BAD_PARAM;
- }
-
- idx = gf_media_avc_read_sps(buffer, nal_size, &avc, 0, NULL);
- if (idx < 0) {
- gf_bs_del(bs);
- gf_free(buffer);
- return GF_BAD_PARAM;
- }
-
- dstcfg->configurationVersion = 1;
- dstcfg->profile_compatibility = avc.sps[idx].prof_compat;
- dstcfg->AVCProfileIndication = avc.sps[idx].profile_idc;
- dstcfg->AVCLevelIndication = avc.sps[idx].level_idc;
- dstcfg->chroma_format = avc.sps[idx].chroma_format;
- dstcfg->luma_bit_depth = 8 + avc.sps[idx].luma_bit_depth_m8;
- dstcfg->chroma_bit_depth = 8 + avc.sps[idx].chroma_bit_depth_m8;
-
- {
- GF_AVCConfigSlot *slc = (GF_AVCConfigSlot*)gf_malloc(sizeof(GF_AVCConfigSlot));
- slc->size = nal_size;
- slc->id = idx;
- slc->data = buffer;
- gf_list_add(dstcfg->sequenceParameterSets, slc);
- }
- }
-
- //PPS
- {
- s32 idx;
- char *buffer = NULL;
- const u64 nal_start = 4 + nal_size + 4;
- gf_bs_seek(bs, nal_start);
- nal_size = gf_media_nalu_next_start_code_bs(bs);
- if (nal_start + nal_size > extradata_size) {
- gf_bs_del(bs);
- return GF_BAD_PARAM;
- }
- buffer = (char*)gf_malloc(nal_size);
- gf_bs_read_data(bs, buffer, nal_size);
- gf_bs_seek(bs, nal_start);
- if ((gf_bs_read_u8(bs) & 0x1F) != GF_AVC_NALU_PIC_PARAM) {
- gf_bs_del(bs);
- gf_free(buffer);
- return GF_BAD_PARAM;
- }
-
- idx = gf_media_avc_read_pps(buffer, nal_size, &avc);
- if (idx < 0) {
- gf_bs_del(bs);
- gf_free(buffer);
- return GF_BAD_PARAM;
- }
-
- {
- GF_AVCConfigSlot *slc = (GF_AVCConfigSlot*)gf_malloc(sizeof(GF_AVCConfigSlot));
- slc->size = nal_size;
- slc->id = idx;
- slc->data = buffer;
- gf_list_add(dstcfg->pictureParameterSets, slc);
- }
- }
-
- gf_bs_del(bs);
- return GF_OK;
-#endif
-}
-
-/**
- * A function which takes FFmpeg H265 extradata (SPS/PPS) and bring them ready to be pushed to the MP4 muxer.
- * @param extradata
- * @param extradata_size
- * @param dstcfg
- * @returns GF_OK is the extradata was parsed and is valid, other values otherwise.
- */
-static GF_Err hevc_import_ffextradata(const u8 *extradata, const u64 extradata_size, GF_HEVCConfig *dst_cfg)
-{
-#ifdef GPAC_DISABLE_AV_PARSERS
- return GF_OK;
-#else
- HEVCState hevc;
- GF_HEVCParamArray *vpss = NULL, *spss = NULL, *ppss = NULL, *seis = NULL;
- GF_BitStream *bs;
- char *buffer = NULL;
- u32 buffer_size = 0;
- if (!extradata || (extradata_size < sizeof(u32)))
- return GF_BAD_PARAM;
- bs = gf_bs_new((const char *) extradata, extradata_size, GF_BITSTREAM_READ);
- if (!bs)
- return GF_BAD_PARAM;
-
- memset(&hevc, 0, sizeof(HEVCState));
- hevc.sps_active_idx = -1;
-
- while (gf_bs_available(bs)) {
- s32 idx;
- GF_AVCConfigSlot *slc;
- u8 nal_unit_type, temporal_id, layer_id;
- u64 nal_start, start_code;
- u32 nal_size;
-
- start_code = gf_bs_read_u32(bs);
- if (start_code>>8 == 0x000001) {
- nal_start = gf_bs_get_position(bs) - 1;
- gf_bs_seek(bs, nal_start);
- start_code = 1;
- }
- if (start_code != 0x00000001) {
- gf_bs_del(bs);
- if (buffer) gf_free(buffer);
- if (vpss && spss && ppss) return GF_OK;
- return GF_BAD_PARAM;
- }
- nal_start = gf_bs_get_position(bs);
- nal_size = gf_media_nalu_next_start_code_bs(bs);
- if (nal_start + nal_size > extradata_size) {
- gf_bs_del(bs);
- return GF_BAD_PARAM;
- }
-
- if (nal_size > buffer_size) {
- buffer = (char*)gf_realloc(buffer, nal_size);
- buffer_size = nal_size;
- }
- gf_bs_read_data(bs, buffer, nal_size);
-
- gf_media_hevc_parse_nalu(buffer, nal_size, &hevc, &nal_unit_type, &temporal_id, &layer_id);
- if (layer_id) {
- gf_bs_del(bs);
- gf_free(buffer);
- return GF_BAD_PARAM;
- }
-
- switch (nal_unit_type) {
- case GF_HEVC_NALU_VID_PARAM:
- idx = gf_media_hevc_read_vps(buffer, nal_size , &hevc);
- if (idx < 0) {
- gf_bs_del(bs);
- gf_free(buffer);
- return GF_BAD_PARAM;
- }
-
- assert(hevc.vps[idx].state == 1); //we don't expect multiple VPS
- if (hevc.vps[idx].state == 1) {
- hevc.vps[idx].state = 2;
- hevc.vps[idx].crc = gf_crc_32(buffer, nal_size);
-
- dst_cfg->avgFrameRate = hevc.vps[idx].rates[0].avg_pic_rate;
- dst_cfg->constantFrameRate = hevc.vps[idx].rates[0].constand_pic_rate_idc;
- dst_cfg->numTemporalLayers = hevc.vps[idx].max_sub_layers;
- dst_cfg->temporalIdNested = hevc.vps[idx].temporal_id_nesting;
-
- if (!vpss) {
- GF_SAFEALLOC(vpss, GF_HEVCParamArray);
- if (vpss) {
- vpss->nalus = gf_list_new();
- gf_list_add(dst_cfg->param_array, vpss);
- vpss->array_completeness = 1;
- vpss->type = GF_HEVC_NALU_VID_PARAM;
- }
- }
-
- slc = (GF_AVCConfigSlot*)gf_malloc(sizeof(GF_AVCConfigSlot));
- if (slc) {
- slc->size = nal_size;
- slc->id = idx;
- slc->data = (char*)gf_malloc(sizeof(char)*slc->size);
- if (slc->data)
- memcpy(slc->data, buffer, sizeof(char)*slc->size);
-
- if (vpss)
- gf_list_add(vpss->nalus, slc);
- }
- }
- break;
- case GF_HEVC_NALU_SEQ_PARAM:
- idx = gf_media_hevc_read_sps(buffer, nal_size, &hevc);
- if (idx < 0) {
- gf_bs_del(bs);
- gf_free(buffer);
- return GF_BAD_PARAM;
- }
-
- assert(!(hevc.sps[idx].state & AVC_SPS_DECLARED)); //we don't expect multiple SPS
- if ((hevc.sps[idx].state & AVC_SPS_PARSED) && !(hevc.sps[idx].state & AVC_SPS_DECLARED)) {
- hevc.sps[idx].state |= AVC_SPS_DECLARED;
- hevc.sps[idx].crc = gf_crc_32(buffer, nal_size);
- }
-
- dst_cfg->configurationVersion = 1;
- dst_cfg->profile_space = hevc.sps[idx].ptl.profile_space;
- dst_cfg->tier_flag = hevc.sps[idx].ptl.tier_flag;
- dst_cfg->profile_idc = hevc.sps[idx].ptl.profile_idc;
- dst_cfg->general_profile_compatibility_flags = hevc.sps[idx].ptl.profile_compatibility_flag;
- dst_cfg->progressive_source_flag = hevc.sps[idx].ptl.general_progressive_source_flag;
- dst_cfg->interlaced_source_flag = hevc.sps[idx].ptl.general_interlaced_source_flag;
- dst_cfg->non_packed_constraint_flag = hevc.sps[idx].ptl.general_non_packed_constraint_flag;
- dst_cfg->frame_only_constraint_flag = hevc.sps[idx].ptl.general_frame_only_constraint_flag;
-
- dst_cfg->constraint_indicator_flags = hevc.sps[idx].ptl.general_reserved_44bits;
- dst_cfg->level_idc = hevc.sps[idx].ptl.level_idc;
-
- dst_cfg->chromaFormat = hevc.sps[idx].chroma_format_idc;
- dst_cfg->luma_bit_depth = hevc.sps[idx].bit_depth_luma;
- dst_cfg->chroma_bit_depth = hevc.sps[idx].bit_depth_chroma;
-
- if (!spss) {
- GF_SAFEALLOC(spss, GF_HEVCParamArray);
- if (spss) {
- spss->nalus = gf_list_new();
- gf_list_add(dst_cfg->param_array, spss);
- spss->array_completeness = 1;
- spss->type = GF_HEVC_NALU_SEQ_PARAM;
- }
- }
-
- slc = (GF_AVCConfigSlot*)gf_malloc(sizeof(GF_AVCConfigSlot));
- if (slc) {
- slc->size = nal_size;
- slc->id = idx;
- slc->data = (char*)gf_malloc(sizeof(char)*slc->size);
- if (slc->data)
- memcpy(slc->data, buffer, sizeof(char)*slc->size);
- if (spss)
- gf_list_add(spss->nalus, slc);
- }
- break;
- case GF_HEVC_NALU_PIC_PARAM:
- idx = gf_media_hevc_read_pps(buffer, nal_size, &hevc);
- if (idx < 0) {
- gf_bs_del(bs);
- gf_free(buffer);
- return GF_BAD_PARAM;
- }
-
- assert(hevc.pps[idx].state == 1); //we don't expect multiple PPS
- if (hevc.pps[idx].state == 1) {
- hevc.pps[idx].state = 2;
- hevc.pps[idx].crc = gf_crc_32(buffer, nal_size);
-
- if (!ppss) {
- GF_SAFEALLOC(ppss, GF_HEVCParamArray);
- if (ppss) {
- ppss->nalus = gf_list_new();
- gf_list_add(dst_cfg->param_array, ppss);
- ppss->array_completeness = 1;
- ppss->type = GF_HEVC_NALU_PIC_PARAM;
- }
- }
-
- slc = (GF_AVCConfigSlot*)gf_malloc(sizeof(GF_AVCConfigSlot));
- if (slc) {
- slc->size = nal_size;
- slc->id = idx;
- slc->data = (char*)gf_malloc(sizeof(char)*slc->size);
- if (slc->data)
- memcpy(slc->data, buffer, sizeof(char)*slc->size);
-
- if (ppss)
- gf_list_add(ppss->nalus, slc);
- }
- }
- break;
- case GF_HEVC_NALU_SEI_PREFIX:
- if (!seis) {
- GF_SAFEALLOC(seis, GF_HEVCParamArray);
- if (seis) {
- seis->nalus = gf_list_new();
- seis->array_completeness = 0;
- seis->type = GF_HEVC_NALU_SEI_PREFIX;
- }
- }
- slc = (GF_AVCConfigSlot*)gf_malloc(sizeof(GF_AVCConfigSlot));
- if (slc) {
- slc->size = nal_size;
- slc->data = (char*)gf_malloc(sizeof(char)*slc->size);
- if (slc->data)
- memcpy(slc->data, buffer, sizeof(char)*slc->size);
- if (seis)
- gf_list_add(seis->nalus, slc);
- }
- break;
- default:
- break;
- }
- }
-
- gf_bs_del(bs);
- if (buffer) gf_free(buffer);
-
- return GF_OK;
-#endif
-}
-
-#ifndef GPAC_DISABLE_ISOM
-
-static GF_Err dc_gpac_video_write_config(VideoOutputFile *video_output_file, u32 *di, u32 track) {
- GF_Err ret;
- if (video_output_file->codec_ctx->codec_id == CODEC_ID_H264) {
- GF_AVCConfig *avccfg;
- avccfg = gf_odf_avc_cfg_new();
- if (!avccfg) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot create AVCConfig\n"));
- return GF_OUT_OF_MEM;
- }
-
- ret = avc_import_ffextradata(video_output_file->codec_ctx->extradata, video_output_file->codec_ctx->extradata_size, avccfg);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot parse AVC/H264 SPS/PPS\n"));
- gf_odf_avc_cfg_del(avccfg);
- return ret;
- }
-
- ret = gf_isom_avc_config_new(video_output_file->isof, track, avccfg, NULL, NULL, di);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_avc_config_new\n", gf_error_to_string(ret)));
- return ret;
- }
-
- gf_odf_avc_cfg_del(avccfg);
-
- //inband SPS/PPS
- if (video_output_file->muxer_type == GPAC_INIT_VIDEO_MUXER_AVC3) {
- ret = gf_isom_avc_set_inband_config(video_output_file->isof, track, 1);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_avc_set_inband_config\n", gf_error_to_string(ret)));
- return ret;
- }
- }
- } else if (!strcmp(video_output_file->codec_ctx->codec->name, "libx265")) { //FIXME CODEC_ID_HEVC would break on old releases
- GF_HEVCConfig *hevccfg = gf_odf_hevc_cfg_new();
- if (!hevccfg) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot create HEVCConfig\n"));
- return GF_OUT_OF_MEM;
- }
-
- ret = hevc_import_ffextradata(video_output_file->codec_ctx->extradata, video_output_file->codec_ctx->extradata_size, hevccfg);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot parse HEVC/H265 SPS/PPS\n"));
- gf_odf_hevc_cfg_del(hevccfg);
- return ret;
- }
-
- ret = gf_isom_hevc_config_new(video_output_file->isof, track, hevccfg, NULL, NULL, di);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_hevc_config_new\n", gf_error_to_string(ret)));
- return ret;
- }
-
- gf_odf_hevc_cfg_del(hevccfg);
-
- //inband SPS/PPS
- if (video_output_file->muxer_type == GPAC_INIT_VIDEO_MUXER_AVC3) {
- ret = gf_isom_hevc_set_inband_config(video_output_file->isof, track, 1);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_hevc_set_inband_config\n", gf_error_to_string(ret)));
- return ret;
- }
- }
- }
-
- return GF_OK;
-}
-
-int dc_gpac_video_moov_create(VideoOutputFile *video_output_file, char *filename)
-{
- GF_Err ret;
- AVCodecContext *video_codec_ctx = video_output_file->codec_ctx;
- u32 di=1, track;
-
- //TODO: For the moment it is fixed
- //u32 sample_dur = video_output_file->codec_ctx->time_base.den;
-
- //int64_t profile = 0;
- //av_opt_get_int(video_output_file->codec_ctx->priv_data, "level", AV_OPT_SEARCH_CHILDREN, &profile);
-
- video_output_file->isof = gf_isom_open(filename, GF_ISOM_OPEN_WRITE, NULL);
- if (!video_output_file->isof) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open iso file %s\n", filename));
- return -1;
- }
- //gf_isom_store_movie_config(video_output_file->isof, 0);
- track = gf_isom_new_track(video_output_file->isof, 0, GF_ISOM_MEDIA_VISUAL, video_codec_ctx->time_base.den);
- video_output_file->trackID = gf_isom_get_track_id(video_output_file->isof, track);
-
- video_output_file->timescale = video_codec_ctx->time_base.den;
- if (!video_output_file->frame_dur)
- video_output_file->frame_dur = video_codec_ctx->time_base.num;
-
- if (!track) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot create new track\n"));
- return -1;
- }
-
- ret = gf_isom_set_track_enabled(video_output_file->isof, track, 1);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_set_track_enabled\n", gf_error_to_string(ret)));
- return -1;
- }
-
- ret = dc_gpac_video_write_config(video_output_file, &di, track);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: dc_gpac_video_write_config\n", gf_error_to_string(ret)));
- return -1;
- }
-
- gf_isom_set_visual_info(video_output_file->isof, track, di, video_codec_ctx->width, video_codec_ctx->height);
- gf_isom_set_sync_table(video_output_file->isof, track);
-
- ret = gf_isom_setup_track_fragment(video_output_file->isof, track, 1, video_output_file->use_source_timing ? (u32) video_output_file->frame_dur : 1, 0, 0, 0, 0, 0);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_setup_track_fragment\n", gf_error_to_string(ret)));
- return -1;
- }
-
- ret = gf_isom_finalize_for_fragment(video_output_file->isof, track);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_finalize_for_fragment\n", gf_error_to_string(ret)));
- return -1;
- }
-
- ret = gf_media_get_rfc_6381_codec_name(video_output_file->isof, track, video_output_file->video_data_conf->codec6381, GF_FALSE, GF_FALSE);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_finalize_for_fragment\n", gf_error_to_string(ret)));
- return -1;
- }
-
- return 0;
-}
-
-int dc_gpac_video_isom_open_seg(VideoOutputFile *video_output_file, char *filename)
-{
- GF_Err ret;
- ret = gf_isom_start_segment(video_output_file->isof, filename, 1);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_start_segment\n", gf_error_to_string(ret)));
- return -1;
- }
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Opening new segment %s at UTC "LLU" ms\n", filename, gf_net_get_utc() ));
- return 0;
-}
-
-int dc_gpac_video_isom_write(VideoOutputFile *video_output_file)
-{
- GF_Err ret;
- AVCodecContext *video_codec_ctx = video_output_file->codec_ctx;
-
- u32 sc_size = 0;
- u32 nalu_size = 0;
-
- u32 buf_len = video_output_file->encoded_frame_size;
- u8 *buf_ptr = video_output_file->vbuf;
-
- GF_BitStream *out_bs = gf_bs_new(NULL, 2 * buf_len, GF_BITSTREAM_WRITE);
- nalu_size = gf_media_nalu_next_start_code(buf_ptr, buf_len, &sc_size);
- if (nalu_size != 0) {
- gf_bs_write_u32(out_bs, nalu_size);
- gf_bs_write_data(out_bs, (const char*) buf_ptr, nalu_size);
- }
- if (sc_size) {
- buf_ptr += (nalu_size + sc_size);
- buf_len -= (nalu_size + sc_size);
- }
-
- while (buf_len) {
- nalu_size = gf_media_nalu_next_start_code(buf_ptr, buf_len, &sc_size);
- if (nalu_size != 0) {
- gf_bs_write_u32(out_bs, nalu_size);
- gf_bs_write_data(out_bs, (const char*) buf_ptr, nalu_size);
- }
-
- buf_ptr += nalu_size;
-
- if (!sc_size || (buf_len < nalu_size + sc_size))
- break;
- buf_len -= nalu_size + sc_size;
- buf_ptr += sc_size;
- }
-
- gf_bs_get_content(out_bs, &video_output_file->sample->data, &video_output_file->sample->dataLength);
- //video_output_file->sample->data = //(char *) (video_output_file->vbuf + nalu_size + sc_size);
- //video_output_file->sample->dataLength = //video_output_file->encoded_frame_size - (sc_size + nalu_size);
-
- video_output_file->sample->DTS = video_codec_ctx->coded_frame->pkt_dts;
- video_output_file->sample->CTS_Offset = (s32) (video_codec_ctx->coded_frame->pts - video_output_file->sample->DTS);
- video_output_file->sample->IsRAP = video_codec_ctx->coded_frame->key_frame;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("Isom Write: RAP %d , DTS "LLD" CTS offset %d \n", video_output_file->sample->IsRAP, video_output_file->sample->DTS, video_output_file->sample->CTS_Offset));
-
- ret = gf_isom_fragment_add_sample(video_output_file->isof, video_output_file->trackID, video_output_file->sample, 1, video_output_file->use_source_timing ? (u32) video_output_file->frame_dur : 1, 0, 0, 0);
- if (ret != GF_OK) {
- gf_bs_del(out_bs);
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_fragment_add_sample\n", gf_error_to_string(ret)));
- return -1;
- }
-
- //free data but keep sample structure alive
- gf_free(video_output_file->sample->data);
- video_output_file->sample->data = NULL;
- video_output_file->sample->dataLength = 0;
-
- gf_bs_del(out_bs);
- return 0;
-}
-
-int dc_gpac_video_isom_close_seg(VideoOutputFile *video_output_file)
-{
- u64 seg_size;
- GF_Err ret = gf_isom_close_segment(video_output_file->isof, 0, 0, 0, 0, 0, 0, 0, GF_TRUE, GF_FALSE, video_output_file->seg_marker, NULL, NULL, &seg_size);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_close_segment\n", gf_error_to_string(ret)));
- return -1;
- }
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Rep %s Closing segment %s at UTC "LLU" ms - size "LLU" bytes\n", video_output_file->rep_id, gf_isom_get_segment_name(video_output_file->isof), gf_net_get_utc(), seg_size ));
-
- return 0;
-}
-
-int dc_gpac_video_isom_close(VideoOutputFile *video_output_file)
-{
- GF_Err ret;
- ret = gf_isom_close(video_output_file->isof);
- if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_close\n", gf_error_to_string(ret)));
- return -1;
- }
-
- return 0;
-}
-
-#endif
-
-
-int dc_raw_h264_open(VideoOutputFile *video_output_file, char *filename)
-{
- video_output_file->file = gf_fopen(filename, "w");
- return 0;
-}
-
-int dc_raw_h264_write(VideoOutputFile *video_output_file)
-{
- fwrite(video_output_file->vbuf, video_output_file->encoded_frame_size, 1, video_output_file->file);
- return 0;
-}
-
-int dc_raw_h264_close(VideoOutputFile *video_output_file)
-{
- gf_fclose(video_output_file->file);
- return 0;
-}
-
-int dc_ffmpeg_video_muxer_open(VideoOutputFile *video_output_file, char *filename)
-{
- AVStream *video_stream;
- AVOutputFormat *output_fmt;
- int ret;
-
- AVCodecContext *video_codec_ctx = video_output_file->codec_ctx;
- video_output_file->av_fmt_ctx = NULL;
-
-// video_output_file->vbr = video_data_conf->bitrate;
-// video_output_file->vfr = video_data_conf->framerate;
-// video_output_file->width = video_data_conf->width;
-// video_output_file->height = video_data_conf->height;
-// strcpy(video_output_file->filename, video_data_conf->filename);
-// strcpy(video_output_file->codec, video_data_conf->codec);
-
- /* Find output format */
- output_fmt = av_guess_format(NULL, filename, NULL);
- if (!output_fmt) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot find suitable output format\n"));
- return -1;
- }
-
- video_output_file->av_fmt_ctx = avformat_alloc_context();
- if (!video_output_file->av_fmt_ctx) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot allocate memory for pOutVideoFormatCtx\n"));
- return -1;
- }
-
- video_output_file->av_fmt_ctx->oformat = output_fmt;
- strcpy(video_output_file->av_fmt_ctx->filename, filename);
-
- /* Open the output file */
- if (!(output_fmt->flags & AVFMT_NOFILE)) {
- if (avio_open(&video_output_file->av_fmt_ctx->pb, filename, URL_WRONLY) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot not open '%s'\n", filename));
- return -1;
- }
- }
-
- video_stream = avformat_new_stream(video_output_file->av_fmt_ctx,
- video_output_file->codec);
- if (!video_stream) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot create output video stream\n"));
- return -1;
- }
-
- //video_stream->codec = video_output_file->codec_ctx;
-
- video_stream->codec->codec_id = video_output_file->codec->id;
- video_stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
- video_stream->codec->bit_rate = video_codec_ctx->bit_rate; //video_output_file->video_data_conf->bitrate;
- video_stream->codec->width = video_codec_ctx->width; //video_output_file->video_data_conf->width;
- video_stream->codec->height = video_codec_ctx->height; //video_output_file->video_data_conf->height;
-
- video_stream->codec->time_base = video_codec_ctx->time_base;
-
- video_stream->codec->pix_fmt = PIX_FMT_YUV420P;
- video_stream->codec->gop_size = video_codec_ctx->time_base.den; //video_output_file->video_data_conf->framerate;
-
- av_opt_set(video_stream->codec->priv_data, "preset", "ultrafast", 0);
- av_opt_set(video_stream->codec->priv_data, "tune", "zerolatency", 0);
-
- /* open the video codec */
- if (avcodec_open2(video_stream->codec, video_output_file->codec, NULL) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output video codec\n"));
- return -1;
- }
-
- ret = avformat_write_header(video_output_file->av_fmt_ctx, NULL);
-
- if (!ret) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("avformat_write_header returned %d\n", ret));
- return ret;
- }
-
- video_output_file->timescale = video_codec_ctx->time_base.den;
- return 0;
-}
-
-int dc_ffmpeg_video_muxer_write(VideoOutputFile *video_output_file)
-{
- AVPacket pkt;
- AVStream *video_stream = video_output_file->av_fmt_ctx->streams[video_output_file->vstream_idx];
- AVCodecContext *video_codec_ctx = video_stream->codec;
-
- av_init_packet(&pkt);
- pkt.data = NULL;
- pkt.size = 0;
-
- if (video_codec_ctx->coded_frame->pts != AV_NOPTS_VALUE) {
- pkt.pts = av_rescale_q(video_codec_ctx->coded_frame->pts, video_codec_ctx->time_base, video_stream->time_base);
- }
-
- if (video_codec_ctx->coded_frame->key_frame)
- pkt.flags |= AV_PKT_FLAG_KEY;
-
- pkt.stream_index = video_stream->index;
- pkt.data = video_output_file->vbuf;
- pkt.size = video_output_file->encoded_frame_size;
-
- // write the compressed frame in the media file
- if (av_interleaved_write_frame(video_output_file->av_fmt_ctx, &pkt) != 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Writing frame is not successful\n"));
- return -1;
- }
-
- av_free_packet(&pkt);
-
- return 0;
-}
-
-int dc_ffmpeg_video_muxer_close(VideoOutputFile *video_output_file)
-{
- u32 i;
-
- av_write_trailer(video_output_file->av_fmt_ctx);
-
- avio_close(video_output_file->av_fmt_ctx->pb);
-
- // free the streams
- for (i = 0; i < video_output_file->av_fmt_ctx->nb_streams; i++) {
- avcodec_close(video_output_file->av_fmt_ctx->streams[i]->codec);
- av_freep(&video_output_file->av_fmt_ctx->streams[i]->info);
- }
-
- //video_output_file->av_fmt_ctx->streams[video_output_file->vstream_idx]->codec = NULL;
- avformat_free_context(video_output_file->av_fmt_ctx);
-
- return 0;
-}
-
-int dc_video_muxer_init(VideoOutputFile *video_output_file, VideoDataConf *video_data_conf, VideoMuxerType muxer_type, int frame_per_segment, int frame_per_fragment, u32 seg_marker, int gdr, int seg_dur, int frag_dur, int frame_dur, int gop_size, int video_cb_size)
-{
- char name[GF_MAX_PATH];
- memset(video_output_file, 0, sizeof(VideoOutputFile));
- snprintf(name, sizeof(name), "video encoder %s", video_data_conf->filename);
- dc_consumer_init(&video_output_file->consumer, video_cb_size, name);
-
-#ifndef GPAC_DISABLE_ISOM
- video_output_file->sample = gf_isom_sample_new();
- video_output_file->isof = NULL;
-#endif
-
- video_output_file->muxer_type = muxer_type;
-
- video_output_file->frame_per_segment = frame_per_segment;
- video_output_file->frame_per_fragment = frame_per_fragment;
-
- video_output_file->seg_dur = seg_dur;
- video_output_file->frag_dur = frag_dur;
-
- video_output_file->seg_marker = seg_marker;
- video_output_file->gdr = gdr;
- video_output_file->gop_size = gop_size;
- video_output_file->frame_dur = frame_dur;
-
- return 0;
-}
-
-int dc_video_muxer_free(VideoOutputFile *video_output_file)
-{
-#ifndef GPAC_DISABLE_ISOM
- if (video_output_file->isof != NULL) {
- gf_isom_close(video_output_file->isof);
- }
-
- gf_isom_sample_del(&video_output_file->sample);
-#endif
- return 0;
-}
-
-GF_Err dc_video_muxer_open(VideoOutputFile *video_output_file, char *directory, char *id_name, int seg)
-{
- char name[GF_MAX_PATH];
-
- switch (video_output_file->muxer_type) {
- case FFMPEG_VIDEO_MUXER:
- snprintf(name, sizeof(name), "%s/%s_%d_ffmpeg.mp4", directory, id_name, seg);
- return dc_ffmpeg_video_muxer_open(video_output_file, name);
- case RAW_VIDEO_H264:
- snprintf(name, sizeof(name), "%s/%s_%d.264", directory, id_name, seg);
- return dc_raw_h264_open(video_output_file, name);
-#ifndef GPAC_DISABLE_ISOM
- case GPAC_VIDEO_MUXER:
- snprintf(name, sizeof(name), "%s/%s_%d_gpac.mp4", directory, id_name, seg);
- dc_gpac_video_moov_create(video_output_file, name);
- return dc_gpac_video_isom_open_seg(video_output_file, NULL);
- case GPAC_INIT_VIDEO_MUXER_AVC1:
- if (seg == 1) {
- snprintf(name, sizeof(name), "%s/%s_init_gpac.mp4", directory, id_name);
- dc_gpac_video_moov_create(video_output_file, name);
- video_output_file->first_dts_in_fragment = 0;
- }
- snprintf(name, sizeof(name), "%s/%s_%d_gpac.m4s", directory, id_name, seg);
- return dc_gpac_video_isom_open_seg(video_output_file, name);
- case GPAC_INIT_VIDEO_MUXER_AVC3:
- if (seg == 0) {
- snprintf(name, sizeof(name), "%s/%s_init_gpac.mp4", directory, id_name);
- dc_gpac_video_moov_create(video_output_file, name);
- video_output_file->first_dts_in_fragment = 0;
- }
- snprintf(name, sizeof(name), "%s/%s_%d_gpac.m4s", directory, id_name, seg);
- return dc_gpac_video_isom_open_seg(video_output_file, name);
-#endif
- default:
- return GF_BAD_PARAM;
- };
-
- return -2;
-}
-
-int dc_video_muxer_write(VideoOutputFile *video_output_file, int frame_nb, Bool insert_ntp)
-{
- Bool segment_close = GF_FALSE;
- Bool fragment_close = GF_FALSE;
- switch (video_output_file->muxer_type) {
- case FFMPEG_VIDEO_MUXER:
- return dc_ffmpeg_video_muxer_write(video_output_file);
- case RAW_VIDEO_H264:
- return dc_raw_h264_write(video_output_file);
-#ifndef GPAC_DISABLE_ISOM
- case GPAC_VIDEO_MUXER:
- case GPAC_INIT_VIDEO_MUXER_AVC1:
- case GPAC_INIT_VIDEO_MUXER_AVC3:
- if (video_output_file->use_source_timing) {
- GF_Err ret;
- if (!video_output_file->fragment_started) {
- video_output_file->fragment_started = 1;
- ret = gf_isom_start_fragment(video_output_file->isof, 1);
- if (ret < 0)
- return -1;
-
-
- //insert UTC for each fragment
- if (insert_ntp) {
- gf_isom_set_fragment_reference_time(video_output_file->isof, video_output_file->trackID, video_output_file->frame_ntp, video_output_file->codec_ctx->coded_frame->pts);
- }
-
- video_output_file->first_dts_in_fragment = video_output_file->codec_ctx->coded_frame->pkt_dts;
- if (!video_output_file->segment_started) {
- video_output_file->pts_at_segment_start = video_output_file->codec_ctx->coded_frame->pts;
- video_output_file->segment_started = 1;
- if (!video_output_file->nb_segments) {
- video_output_file->pts_at_first_segment = video_output_file->pts_at_segment_start;
- }
-
-#ifndef GPAC_DISABLE_LOG
- if (insert_ntp && gf_log_tool_level_on(GF_LOG_DASH, GF_LOG_INFO)) {
- if (!video_output_file->ntp_at_first_dts) {
- video_output_file->ntp_at_first_dts = video_output_file->frame_ntp;
- } else {
- s32 ntp_diff = gf_net_get_ntp_diff_ms(video_output_file->ntp_at_first_dts);
- s32 ts_diff = (s32) ( 1000 * (video_output_file->codec_ctx->coded_frame->pts - video_output_file->pts_at_first_segment) / video_output_file->timescale );
-
- s32 diff_ms = ts_diff - ntp_diff;
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Video Segment start NTP diff: %d ms TS diff: %d ms drift: %d ms\n", ntp_diff, ts_diff, diff_ms));
- }
- }
-#endif
- }
- gf_isom_set_traf_base_media_decode_time(video_output_file->isof, video_output_file->trackID, video_output_file->first_dts_in_fragment);
- }
-
- if (dc_gpac_video_isom_write(video_output_file) < 0) {
- return -1;
- }
- video_output_file->last_pts = video_output_file->codec_ctx->coded_frame->pts;
- video_output_file->last_dts = video_output_file->codec_ctx->coded_frame->pkt_dts;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] PTS: "LLU", DTS: "LLU", first DTS in frag: "LLU", timescale: %d, frag dur: %d\n", video_output_file->last_pts, video_output_file->last_dts, video_output_file->first_dts_in_fragment, video_output_file->timescale, video_output_file->frag_dur));
-
- //we may have rounding errors on the input PTS :( add half frame dur safety
- //flush segments based on the cumultated duration , to avoid drift
- /* Check why segment tests work on PTS while fragment tests work on DTS ? */
- /* Check why fragment closing is not tested based on accumulation of fragment duration to avoid drifts */
- segment_close = ((video_output_file->last_pts - video_output_file->pts_at_first_segment + video_output_file->frame_dur) * 1000 >=
- (video_output_file->nb_segments+1)*video_output_file->seg_dur * (u64)video_output_file->timescale);
-#if 0
- segment_close = ((video_output_file->last_pts - video_output_file->pts_at_segment_start + 3*video_output_file->frame_dur/2) * 1000 >=
- (video_output_file->seg_dur * (u64)video_output_file->timescale);
-#endif
- //flush fragment if adding next frame will exceed target duration by half the frame duration
- fragment_close = ((video_output_file->last_dts - video_output_file->first_dts_in_fragment + 3 * video_output_file->frame_dur / 2) * 1000 >=
- (video_output_file->frag_dur * (u64)video_output_file->timescale));
-
- if (segment_close || fragment_close) {
- gf_isom_flush_fragments(video_output_file->isof, 1);
- video_output_file->fragment_started = 0;
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Flushed fragment at UTC "LLU" ms - First DTS "LLU" last PTS "LLU" - First Segment PTS "LLU" timescale %d\n", gf_net_get_utc(), video_output_file->first_dts_in_fragment, video_output_file->codec_ctx->coded_frame->pts, video_output_file->pts_at_segment_start, video_output_file->timescale));
- }
-
- if (segment_close) {
- return 1;
- }
- return 0;
- }
-
- if (frame_nb % video_output_file->frame_per_fragment == 0) {
- gf_isom_start_fragment(video_output_file->isof, 1);
-
- if (!video_output_file->segment_started) {
- video_output_file->pts_at_segment_start = video_output_file->codec_ctx->coded_frame->pts;
- video_output_file->segment_started = 1;
-
- if (insert_ntp) {
- gf_isom_set_fragment_reference_time(video_output_file->isof, video_output_file->trackID, video_output_file->frame_ntp, video_output_file->pts_at_segment_start);
- }
- }
-
-
- gf_isom_set_traf_base_media_decode_time(video_output_file->isof, video_output_file->trackID, video_output_file->first_dts_in_fragment);
- video_output_file->first_dts_in_fragment += video_output_file->frame_per_fragment;
- }
-
- dc_gpac_video_isom_write(video_output_file);
-
- if (frame_nb % video_output_file->frame_per_fragment == video_output_file->frame_per_fragment - 1) {
- gf_isom_flush_fragments(video_output_file->isof, 1);
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Flushed fragment to disk at UTC "LLU" ms - last coded frame PTS "LLU"\n", gf_net_get_utc(), video_output_file->codec_ctx->coded_frame->pts));
- }
-
- if (frame_nb + 1 == video_output_file->frame_per_segment)
- return 1;
-
- return 0;
-#endif
-
- default:
- return -2;
- }
-
- return -2;
-}
-
-int dc_video_muxer_close(VideoOutputFile *video_output_file)
-{
- video_output_file->fragment_started = video_output_file->segment_started = 0;
- video_output_file->nb_segments++;
-
- switch (video_output_file->muxer_type) {
- case FFMPEG_VIDEO_MUXER:
- return dc_ffmpeg_video_muxer_close(video_output_file);
- case RAW_VIDEO_H264:
- return dc_raw_h264_close(video_output_file);
-#ifndef GPAC_DISABLE_ISOM
- case GPAC_VIDEO_MUXER:
- dc_gpac_video_isom_close_seg(video_output_file);
- return dc_gpac_video_isom_close(video_output_file);
- case GPAC_INIT_VIDEO_MUXER_AVC1:
- case GPAC_INIT_VIDEO_MUXER_AVC3:
- return dc_gpac_video_isom_close_seg(video_output_file);
-#endif
- default:
- return -2;
- }
-
- return -2;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef VIDEO_MUXER_H_
-#define VIDEO_MUXER_H_
-
-#include "../../modules/ffmpeg_in/ffmpeg_in.h"
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
-#include "libswscale/swscale.h"
-#include "libavutil/mathematics.h"
-#include <gpac/isomedia.h>
-#include <gpac/internal/media_dev.h>
-
-#include "video_scaler.h"
-
-typedef enum {
- FFMPEG_VIDEO_MUXER,
- RAW_VIDEO_H264,
- GPAC_VIDEO_MUXER,
- GPAC_INIT_VIDEO_MUXER_AVC1,
- GPAC_INIT_VIDEO_MUXER_AVC3
-} VideoMuxerType;
-
-/*
- * VideoOutputFile structure has the data needed to encode video frames and write them on the file.
- * It reads the data from a circular buffer so it needs to keep the index to that circular buffer. This index is
- * available in Consumer data structure.
- */
-typedef struct {
- VideoDataConf *video_data_conf;
- VideoMuxerType muxer_type;
-
- /* file format context structure */
- AVFormatContext *av_fmt_ctx;
- AVCodecContext *codec_ctx;
- AVCodec *codec;
-
- FILE *file;
-
-#ifndef GPAC_DISABLE_ISOM
- GF_ISOFile *isof;
- GF_ISOSample *sample;
-#endif
-
- u32 trackID;
- /* Index of the video stream in the file */
- int vstream_idx;
- /* keeps the index with which encoder access to the circular buffer (as a consumer) */
- Consumer consumer;
-
- /* Variables that encoder needs to encode data */
- uint8_t *vbuf;
- int vbuf_size;
- int encoded_frame_size;
-
- int frame_per_fragment;
- int frame_per_segment;
-
- int seg_dur;
- int frag_dur;
-
- u64 first_dts_in_fragment;
- u64 ntp_at_first_dts;
-
- u32 seg_marker;
-
- int gop_size;
- int gdr;
-
- Bool use_source_timing;
-
- u64 pts_at_segment_start, pts_at_first_segment;
- u64 last_pts, last_dts;
- u64 frame_dur;
- u32 timescale;
- u32 nb_segments;
- Bool fragment_started, segment_started;
- const char *rep_id;
-
- u64 frame_ntp, frame_utc;
-} VideoOutputFile;
-
-int dc_video_muxer_init(VideoOutputFile *video_output_file, VideoDataConf *video_data_conf, VideoMuxerType muxer_type, int frame_per_segment, int frame_per_fragment, u32 seg_marker, int gdr, int seg_dur, int frag_dur, int frame_dur, int gop_size, int video_cb_size);
-
-int dc_video_muxer_free(VideoOutputFile *video_output_file);
-
-int dc_video_muxer_open(VideoOutputFile *video_output_file, char *directory, char *id_name, int seg);
-
-int dc_video_muxer_write(VideoOutputFile *video_output_file, int frame_nb, Bool insert_ntp_timestamp);
-
-int dc_video_muxer_close(VideoOutputFile *video_output_file);
-
-#endif /* VIDEO_MUXER_H_ */
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "video_scaler.h"
-
-
-#ifdef GPAC_USE_LIBAV
-#define av_frame_free av_free
-#endif
-
-VideoScaledDataNode * dc_video_scaler_node_create(int width, int height, int crop_x, int crop_y, int pix_fmt)
-{
- VideoScaledDataNode *video_scaled_data_node = (VideoScaledDataNode*)gf_malloc(sizeof(VideoDataNode));
- if (video_scaled_data_node) {
- video_scaled_data_node->vframe = FF_ALLOC_FRAME();
- if (crop_x || crop_y) {
- video_scaled_data_node->cropped_frame = FF_ALLOC_FRAME();
- } else {
- video_scaled_data_node->cropped_frame = NULL;
- }
- }
- if (!video_scaled_data_node || !video_scaled_data_node->vframe || ((crop_x || crop_y) && !video_scaled_data_node->cropped_frame)) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot allocate VideoNode!\n"));
- av_frame_free(&video_scaled_data_node->vframe);
- av_frame_free(&video_scaled_data_node->cropped_frame);
- gf_free(video_scaled_data_node);
- return NULL;
- }
-
- /* Determine required buffer size and allocate buffer */
- avpicture_alloc((AVPicture*)video_scaled_data_node->vframe, pix_fmt, width, height);
- if (video_scaled_data_node->cropped_frame) {
- avpicture_alloc((AVPicture*)video_scaled_data_node->cropped_frame, pix_fmt, width-crop_x, height-crop_y);
- }
-
- return video_scaled_data_node;
-}
-
-void dc_video_scaler_node_destroy(VideoScaledDataNode *video_scaled_data_node)
-{
-#ifndef GPAC_USE_LIBAV
- av_frame_free(&video_scaled_data_node->vframe);
-#endif
- gf_free(video_scaled_data_node);
-}
-
-void dc_video_scaler_list_init(VideoScaledDataList *video_scaled_data_list, GF_List * video_lst)
-{
- u32 i, j;
- int found;
-
- video_scaled_data_list->size = 0;
- video_scaled_data_list->video_scaled_data = NULL;
-
- for (i=0; i<gf_list_count(video_lst); i++) {
- VideoDataConf *video_data_conf = (VideoDataConf*)gf_list_get(video_lst, i);
- found = 0;
- for (j=0; j<video_scaled_data_list->size; j++) {
- if ( video_scaled_data_list->video_scaled_data[j]->out_height == video_data_conf->height
- && video_scaled_data_list->video_scaled_data[j]->out_width == video_data_conf->width) {
- found = 1;
- video_scaled_data_list->video_scaled_data[j]->num_consumers++;
- break;
- }
- }
- if (!found) {
- VideoScaledData *video_scaled_data;
- GF_SAFEALLOC(video_scaled_data, VideoScaledData);
- if (!video_scaled_data) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_APP, ("Cannot allocate video rescaler\n"));
- return;
- }
- video_scaled_data->out_width = video_data_conf->width;
- video_scaled_data->out_height = video_data_conf->height;
- video_scaled_data->num_consumers = 1;
-
- video_scaled_data_list->video_scaled_data = (VideoScaledData**)gf_realloc(video_scaled_data_list->video_scaled_data, (video_scaled_data_list->size+1)*sizeof(VideoScaledData*));
-
- video_scaled_data_list->video_scaled_data[video_scaled_data_list->size] = video_scaled_data;
- video_scaled_data_list->size++;
- }
- }
-}
-
-void dc_video_scaler_list_destroy(VideoScaledDataList *video_scaled_data_list)
-{
- u32 i;
- for (i=0; i<video_scaled_data_list->size; i++)
- gf_free(video_scaled_data_list->video_scaled_data[i]);
-
- gf_free(video_scaled_data_list->video_scaled_data);
-}
-
-void dc_video_scaler_end_signal(VideoScaledData *video_scaled_data)
-{
- dc_producer_end_signal(&video_scaled_data->producer, &video_scaled_data->circular_buf);
- dc_producer_unlock_previous(&video_scaled_data->producer, &video_scaled_data->circular_buf);
-}
-
-int dc_video_scaler_data_init(VideoInputData *video_input_data, VideoScaledData *video_scaled_data, int max_source, int video_cb_size)
-{
- int i;
- char name[GF_MAX_PATH];
- snprintf(name, sizeof(name), "video scaler %dx%d", video_scaled_data->out_width, video_scaled_data->out_height);
-
- dc_producer_init(&video_scaled_data->producer, video_cb_size, name);
- dc_consumer_init(&video_scaled_data->consumer, video_cb_size, name);
-
- video_scaled_data->num_producers = max_source;
- video_scaled_data->out_pix_fmt = PIX_FMT_YUV420P;
- GF_SAFE_ALLOC_N(video_scaled_data->vsprop, max_source, VideoScaledProp);
- memset(video_scaled_data->vsprop, 0, max_source * sizeof(VideoScaledProp));
-
- dc_circular_buffer_create(&video_scaled_data->circular_buf, video_cb_size, video_input_data->circular_buf.mode, video_scaled_data->num_consumers);
- for (i=0; i<video_cb_size; i++) {
- video_scaled_data->circular_buf.list[i].data = dc_video_scaler_node_create(video_scaled_data->out_width, video_scaled_data->out_height, video_input_data->vprop[i].crop_x, video_input_data->vprop[i].crop_y, video_scaled_data->out_pix_fmt);
- }
-
- video_scaled_data->vsprop->video_input_data = video_input_data;
- return 0;
-}
-
-int dc_video_scaler_data_set_prop(VideoInputData *video_input_data, VideoScaledData *video_scaled_data, int index)
-{
- video_scaled_data->vsprop[index].in_width = video_input_data->vprop[index].width - video_input_data->vprop[index].crop_x;
- video_scaled_data->vsprop[index].in_height = video_input_data->vprop[index].height - video_input_data->vprop[index].crop_y;
- video_scaled_data->vsprop[index].in_pix_fmt = video_input_data->vprop[index].pix_fmt;
-
- video_scaled_data->sar = video_input_data->vprop[index].sar;
-
- video_scaled_data->vsprop[index].sws_ctx = sws_getContext(
- video_scaled_data->vsprop[index].in_width,
- video_scaled_data->vsprop[index].in_height,
- video_scaled_data->vsprop[index].in_pix_fmt,
- video_scaled_data->out_width, video_scaled_data->out_height,
- video_scaled_data->out_pix_fmt, SWS_FAST_BILINEAR, NULL, NULL, NULL);
- if (video_scaled_data->vsprop[index].sws_ctx == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot initialize the conversion context!\n"));
- return -1;
- }
-
- return 0;
-}
-
-int dc_video_scaler_scale(VideoInputData *video_input_data, VideoScaledData *video_scaled_data)
-{
- int ret, index, src_height;
- VideoDataNode *video_data_node;
- VideoScaledDataNode *video_scaled_data_node;
- AVFrame *src_vframe;
-
- //step 1: try to lock output slot. If none available, return ....
- if (video_input_data->circular_buf.size > 1)
- dc_consumer_unlock_previous(&video_scaled_data->consumer, &video_input_data->circular_buf);
-
- ret = dc_producer_lock(&video_scaled_data->producer, &video_scaled_data->circular_buf);
- //not ready
- if (ret<0) {
- return -1;
- }
- dc_producer_unlock_previous(&video_scaled_data->producer, &video_scaled_data->circular_buf);
-
- //step 2: lock input
- ret = dc_consumer_lock(&video_scaled_data->consumer, &video_input_data->circular_buf);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Video scaler got an end of input tbuffer!\n"));
- return -2;
- }
-
- //step 3 - grab source and dest images
- video_data_node = (VideoDataNode*)dc_consumer_consume(&video_scaled_data->consumer, &video_input_data->circular_buf);
- video_scaled_data_node = (VideoScaledDataNode*)dc_producer_produce(&video_scaled_data->producer, &video_scaled_data->circular_buf);
- index = video_data_node->source_number;
-
- //crop if necessary
- if (video_input_data->vprop[index].crop_x || video_input_data->vprop[index].crop_y) {
-#if 0
- av_frame_copy_props(video_scaled_data_node->cropped_frame, video_data_node->vframe);
- video_scaled_data_node->cropped_frame->width = video_input_data->vprop[index].width - video_input_data->vprop[index].crop_x;
- video_scaled_data_node->cropped_frame->height = video_input_data->vprop[index].height - video_input_data->vprop[index].crop_y;
-#endif
- if (av_picture_crop((AVPicture*)video_scaled_data_node->cropped_frame, (AVPicture*)video_data_node->vframe, PIX_FMT_YUV420P, video_input_data->vprop[index].crop_y, video_input_data->vprop[index].crop_x) < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Video scaler: error while cropping picture.\n"));
- return -1;
- }
- src_vframe = video_scaled_data_node->cropped_frame;
- src_height = video_input_data->vprop[index].height - video_input_data->vprop[index].crop_y;
- } else {
- assert(!video_scaled_data_node->cropped_frame);
- src_vframe = video_data_node->vframe;
- src_height = video_input_data->vprop[index].height;
- }
-
-
- //rescale the cropped frame
- ret = sws_scale(video_scaled_data->vsprop[index].sws_ctx,
- (const uint8_t * const *)src_vframe->data, src_vframe->linesize, 0, src_height,
- video_scaled_data_node->vframe->data, video_scaled_data_node->vframe->linesize);
-
- if (!ret) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Video scaler: error while resizing picture.\n"));
- return -1;
- }
- video_scaled_data_node->vframe->pts = video_data_node->vframe->pts;
- video_scaled_data_node->frame_ntp = video_data_node->frame_ntp;
- video_scaled_data_node->frame_utc = video_data_node->frame_utc;
-
-
- if (video_data_node->nb_raw_frames_ref) {
- if (video_data_node->nb_raw_frames_ref==1) {
-#ifndef GPAC_USE_LIBAV
- av_frame_unref(video_data_node->vframe);
-#endif
- av_free_packet(&video_data_node->raw_packet);
- }
- video_data_node->nb_raw_frames_ref--;
- }
-
- dc_consumer_advance(&video_scaled_data->consumer);
- dc_producer_advance(&video_scaled_data->producer, &video_scaled_data->circular_buf);
-
- if (video_input_data->circular_buf.size == 1)
- dc_consumer_unlock_previous(&video_scaled_data->consumer, &video_input_data->circular_buf);
- return 0;
-}
-
-int dc_video_scaler_data_destroy(VideoScaledData *video_scaled_data)
-{
- int i;
- for (i=0; i<(int) video_scaled_data->circular_buf.size; i++) {
- if (video_scaled_data->circular_buf.list) {
- dc_video_scaler_node_destroy(video_scaled_data->circular_buf.list[i].data);
- }
- }
-
- for (i=0 ; i<video_scaled_data->num_producers; i++) {
- if (video_scaled_data->vsprop[i].sws_ctx)
- av_free(video_scaled_data->vsprop[i].sws_ctx);
- }
- gf_free(video_scaled_data->vsprop);
- //av_free(video_scaled_data->sws_ctx);
-
- dc_circular_buffer_destroy(&video_scaled_data->circular_buf);
-
- return 0;
-}
-
-VideoScaledData * dc_video_scaler_get_data(VideoScaledDataList *video_scaled_data_list, int width, int height)
-{
- u32 i;
- for (i=0; i<video_scaled_data_list->size; i++) {
- if (video_scaled_data_list->video_scaled_data[i]->out_width == width && video_scaled_data_list->video_scaled_data[i]->out_height == height)
- return video_scaled_data_list->video_scaled_data[i];
- }
-
- return NULL;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Arash Shafiei
- * Copyright (c) Telecom ParisTech 2000-2013
- * All rights reserved
- *
- * This file is part of GPAC / dashcast
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef VIDEO_SCALER_H_
-#define VIDEO_SCALER_H_
-
-#include <stdlib.h>
-#include <gpac/list.h>
-
-#include "video_data.h"
-
-
-typedef struct {
- /* scaler of the libav */
- struct SwsContext *sws_ctx;
- /* width, height, and the pixel format of the scaled video */
- int in_width;
- int in_height;
- int in_pix_fmt;
-
- VideoInputData *video_input_data;
-} VideoScaledProp;
-
-/*
- * VideoScaledData keeps a circular buffer
- * of video frame with a defined resolution.
- */
-typedef struct {
- VideoScaledProp *vsprop;
-
- int out_width;
- int out_height;
- int out_pix_fmt;
- AVRational sar;
-
- /* scaler of the libav */
- //struct SwsContext * sws_ctx;
- /* width, height, and the pixel format of the scaled video */
- //int width;
- //int height;
- //int pix_fmt;
-
- /* circular buffer containing the scaled video frames */
- CircularBuffer circular_buf;
-
- /* Scaler is a consumer and also producer.
- * It consumes from the video input data and it produces the video scaled data.
- * So it deals with two circular buffer and we need to keep the index for both. */
- Producer producer;
- Consumer consumer;
-
- /* The number of consumers of this circular buffer.
- * (Which are the encoders who are using this resolution) */
- int num_consumers;
- int num_producers;
-} VideoScaledData;
-
-/*
- * Each node in a circular buffer is a pointer.
- * To use the circular buffer for scaled video frame we must define the node. This structure contains the data needed to encode a video frame.
- */
-typedef struct {
- AVFrame *vframe;
- AVFrame *cropped_frame;
- u64 frame_ntp, frame_utc;
-} VideoScaledDataNode;
-
-/*
- * A list of pointers to scaled video data.
- */
-typedef struct {
- VideoScaledData **video_scaled_data;
- u32 size;
-} VideoScaledDataList;
-
-/*
- * Read the configuration file info and fill the video scaled data list with all the resolution available.
- * Each resolution is associated to a circular buffer in a video scaled data.
- *
- * @param cmd_data [in] Command data which contains the configuration file info
- * @param video_scaled_data_list [out] the list to be filled
- */
-void dc_video_scaler_list_init(VideoScaledDataList *video_scaled_data_list, GF_List *video_lst);
-
-/*
- * Destroy a video scaled data list.
- *
- * @param video_scaled_data_list [in] the list to be destroyed.
- */
-void dc_video_scaler_list_destroy(VideoScaledDataList *video_scaled_data_list);
-
-/*
- * Signal to all the users of the circular buffer in the VideoScaledData
- * which the current node is the last node to consume.
- *
- * @param video_scaled_data [in] the structure to be signaled on.
- */
-void dc_video_scaler_end_signal(VideoScaledData *video_scaled_data);
-
-/*
- * Initialize a VideoScaledData.
- *
- * @param video_input_data [in] contains the info of the input video.
- * @param video_scaled_data [out] structure to be initialized.
- *
- * @return 0 on success, -1 on failure.
- *
- * @note Must use dc_video_scaler_data_destroy to free memory.
- */
-int dc_video_scaler_data_init(VideoInputData *video_input_data, VideoScaledData *video_scaled_data, int num_producers, int video_cb_size);
-
-/*
- * Set properties of a VideoScaledData.
- */
-int dc_video_scaler_data_set_prop(VideoInputData *video_input_data, VideoScaledData *video_scaled_data, int index);
-
-/*
- * Get a frame from the circular buffer on the input video,
- * scale it and put the result on the circular buffer of the
- * video scaled data
- *
- * @param video_input_data [in] contains input frames
- * @param video_scaled_data [out] contains scaled frames
- *
- * return 0 on success, -2 if the node is the last node to scale
- */
-int dc_video_scaler_scale(VideoInputData *video_input_data, VideoScaledData *video_scaled_data);
-
-/*
- * Destroy a VideoScaledData
- *
- * @param video_scaled_data [in] structure to be destroyed.
- */
-int dc_video_scaler_data_destroy(VideoScaledData *video_scaled_data);
-
-/*
- * Return the VideoScaledData from the list which has width and height
- *
- * @param video_scaled_data_list [in] video scaled data list
- * @param width [in] frame width
- * @param height [in] frame height
- *
- * @return a VideoScaledData which corresponds to the width and height on success, NULL on failure
- */
-VideoScaledData * dc_video_scaler_get_data(VideoScaledDataList *video_scaled_data_list, int width, int height);
-
-#endif /* VIDEO_SCALER_H_ */
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/mp42avi
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= main.o
-
-
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=MP42Avi$(EXE)
-else
-EXT=
-PROG=MP42Avi
-endif
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../bin/gcc/$@ $(OBJS) -L../../bin/$(TARGET_BIN_DIR) -lgpac -lz $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / command-line mp4 toolbox
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/isomedia.h>
-#include <gpac/compositor.h>
-#include <gpac/scenegraph.h>
-#include <gpac/bifs.h>
-#include <gpac/options.h>
-
-#ifdef WIN32
-#include <windows.h>
-#define GPAC_CFG_FILE "GPAC.cfg"
-#else
-#include <pwd.h>
-typedef struct tagBITMAPFILEHEADER
-{
- u16 bfType;
- u32 bfSize;
- u16 bfReserved1;
- u16 bfReserved2;
- u32 bfOffBits;
-} BITMAPFILEHEADER;
-
-typedef struct tagBITMAPINFOHEADER {
- u32 biSize;
- s32 biWidth;
- s32 biHeight;
- u16 biPlanes;
- u16 biBitCount;
- u32 biCompression;
- u32 biSizeImage;
- s32 biXPelsPerMeter;
- s32 biYPelsPerMeter;
- u32 biClrUsed;
- u32 biClrImportant;
-} BITMAPINFOHEADER;
-
-#define BI_RGB 0L
-
-#define GPAC_CFG_FILE ".gpacrc"
-#endif
-
-#include <gpac/internal/avilib.h>
-#include <gpac/internal/compositor_dev.h>
-
-void PrintVersion()
-{
- printf ("MP42AVI - GPAC version %s\n", GPAC_FULL_VERSION);
-}
-
-void PrintUsage()
-{
- printf ("MP42AVI [option] input\n"
- "Dumps BIFS media frames as AVI, BMP or raw\n\n"
- "Options\n"
- "-fps Framerate: specifies extraction framerate - if not set computed from track length\n"
- "-size WxH: forces output BIFS to the given resolution\n"
- "-raw [frame]: uses raw format for output - only dumps one frame if specified\n"
- "-bmp [frame]: uses BMP format for output - only dumps one frame if specified\n"
- "-outpath path: specifies where to dump frames/movie\n"
- "\n"
- "Note: when dumping a frame, either the frame number can be specified or the frame time\n"
- "in the format hh:mm:ss:xFz where hh, mm, ss are hours, minutes, seconds, x the number\n"
- "of the frame in the seconds and z the frame rate used to express the time\n"
- "\n"
- "-cfg: specifies path to GPAC config file (GPAC.cfg)\n"
- "-v: prints version\n"
- "-h: prints this message\n"
- "\nWritten by Jean Le Feuvre - (c) 2000-2005\n");
-}
-
-
-typedef struct
-{
- GF_Compositor *sr;
- GF_SceneGraph *sg;
- GF_BifsDecoder *bifs;
- GF_ISOFile *file;
-
- u32 track;
- u64 duration, cts;
-} BIFSVID;
-
-void node_init(void *cbk, GF_Node *node)
-{
- BIFSVID *b2v = cbk;
- switch (gf_node_get_tag(node)) {
- case TAG_MPEG4_Conditional:
- case TAG_MPEG4_QuantizationParameter:
- break;
- default:
- if (b2v->sr) gf_sc_on_node_init(b2v->sr, node);
- break;
- }
-}
-
-void node_modif(void *cbk, GF_Node *node)
-{
- BIFSVID *b2v = cbk;
- if (b2v->sr) gf_sc_invalidate(b2v->sr, node);
-}
-
-Double get_scene_time(void *cbk)
-{
- Double res;
- BIFSVID *b2v = cbk;
- res = (Double) (s64) b2v->cts;
- res /= (Double) (s64) b2v->duration;
- return res;
-}
-
-void write_bmp(GF_VideoSurface *fb, char *rad_name, u32 img_num)
-{
- char str[GF_MAX_PATH];
- BITMAPFILEHEADER fh;
- BITMAPINFOHEADER fi;
- FILE *fout;
- u32 j, i;
- char *ptr;
-
- if (img_num<10) {
- sprintf(str, "%s_00%d.bmp", rad_name, img_num);
- } else if (img_num<100) {
- sprintf(str, "%s_0%d.bmp", rad_name, img_num);
- } else {
- sprintf(str, "%s_%d.bmp", rad_name, img_num);
- }
-
- fout = gf_fopen(str, "wb");
- if (!fout) return;
-
- memset(&fh, 0, sizeof(fh));
- fh.bfType = 19778;
- fh.bfOffBits = 14 + 40;
-
- memset(&fi, 0, sizeof(char)*40);
- fi.biSize = sizeof(char)*40;
- fi.biWidth = fb->width;
- fi.biHeight = fb->height;
- fi.biPlanes = 1;
- fi.biBitCount = 24;
- fi.biCompression = BI_RGB;
- fi.biSizeImage = fb->pitch * fb->height;
-
- /*NOT ALIGNED!!*/
- gf_fwrite(&fh.bfType, 2, 1, fout);
- gf_fwrite(&fh.bfSize, 4, 1, fout);
- gf_fwrite(&fh.bfReserved1, 2, 1, fout);
- gf_fwrite(&fh.bfReserved2, 2, 1, fout);
- gf_fwrite(&fh.bfOffBits, 4, 1, fout);
-
- gf_fwrite(&fi, 1, 40, fout);
-
- for (j=fb->height; j>0; j--) {
- ptr = fb->video_buffer + (j-1)*fb->pitch;
- //gf_fwrite(ptr, 1, fb->width * 3, fout);
- for (i=0; i<fb->width; i++) {
- fputc(ptr[2], fout);
- fputc(ptr[1], fout);
- fputc(ptr[0], fout);
- ptr+=3;
- }
- }
-
- gf_fclose(fout);
-}
-
-
-void write_raw(GF_VideoSurface *fb, char *rad_name, u32 img_num)
-{
- char str[GF_MAX_PATH];
- FILE *fout;
- if (img_num<10) {
- sprintf(str, "%s_00%d.raw", rad_name, img_num);
- } else if (img_num<100) {
- sprintf(str, "%s_0%d.raw", rad_name, img_num);
- } else {
- sprintf(str, "%s_%d.raw", rad_name, img_num);
- }
-
- fout = gf_fopen(str, "wb");
- if (!fout) return;
- gf_fwrite(fb->video_buffer , fb->height*fb->pitch, 1, fout);
- gf_fclose(fout);
-}
-
-void dump_frame(BIFSVID b2v, char *conv_buf, char *out_path, u32 dump_type, avi_t *avi_out, u32 frameNum)
-{
- u32 k;
- GF_VideoSurface fb;
-
- /*lock it*/
- gf_sc_get_screen_buffer(b2v.sr, &fb);
- /*export frame*/
- switch (dump_type) {
- case 0:
- /*reverse frame*/
- for (k=0; k<fb.height; k++) {
- memcpy(conv_buf + k*fb.width*3, fb.video_buffer + (fb.height-k-1) * fb.pitch, sizeof(char) * fb.width * 3);
- }
- if (AVI_write_frame(avi_out, conv_buf, fb.height*fb.width*3, 1) <0)
- printf("Error writing frame\n");
- break;
- case 2:
- write_raw(&fb, out_path, frameNum);
- break;
- case 1:
- write_bmp(&fb, out_path, frameNum);
- break;
- }
- /*unlock it*/
- gf_sc_release_screen_buffer(b2v.sr, &fb);
-}
-
-/*generates an intertwined bmp from a scene file with 5 different viewpoints*/
-void bifs3d_viewpoints_merger(GF_ISOFile *file, char *szConfigFile, u32 width, u32 height, char *rad_name, u32 dump_type, char *out_dir, Double fps, s32 frameID, s32 dump_time)
-{
- GF_User user;
- char out_path[GF_MAX_PATH];
- char old_driv[1024];
- BIFSVID b2v;
- Bool needs_raw;
- GF_Err e;
- GF_VideoSurface fb;
- unsigned char **rendered_frames;
- u32 nb_viewpoints = 5;
- u32 viewpoint_index;
-
-
- /* Configuration of the Rendering Capabilities */
- {
- const char *test;
- char config_path[GF_MAX_PATH];
- memset(&user, 0, sizeof(GF_User));
- user.config = gf_cfg_init(szConfigFile, NULL);
-
- if (!user.config) {
- fprintf(stdout, "Error: Configuration File \"%s\" not found in %s\n", GPAC_CFG_FILE, config_path);
- return;
- }
-
- test = gf_cfg_get_key(user.config, "Core", "ModulesDirectory");
- user.modules = gf_modules_new((const unsigned char *) test, user.config);
- strcpy(old_driv, "raw_out");
- if (!gf_modules_get_count(user.modules)) {
- printf("Error: no modules found\n");
- goto err_exit;
- }
-
- /*switch driver to raw_driver*/
- test = gf_cfg_get_key(user.config, "core", "video-output");
- if (test) strcpy(old_driv, test);
-
- needs_raw = 0;
- test = gf_cfg_get_key(user.config, "Compositor", "RendererName");
- /*since we only support RGB24 for MP42AVI force using RAW out with 2D driver*/
- if (test && strstr(test, "2D")) {
- needs_raw = 1;
- }
- }
-
- memset(&b2v, 0, sizeof(BIFSVID));
- user.init_flags = GF_TERM_NO_AUDIO;
- /* Initialization of the compositor */
- b2v.sr = gf_sc_new(&user, 0, NULL);
- gf_sc_set_option(b2v.sr, GF_OPT_VISIBLE, 0);
-
- /* Initialization of the scene graph */
- b2v.sg = gf_sg_new();
- gf_sg_set_scene_time_callback(b2v.sg, get_scene_time, &b2v);
- gf_sg_set_init_callback(b2v.sg, node_init, &b2v);
- gf_sg_set_modified_callback(b2v.sg, node_modif, &b2v);
-
- /*load config*/
- gf_sc_set_option(b2v.sr, GF_OPT_RELOAD_CONFIG, 1);
-
- {
- u32 di;
- u32 track_number;
- GF_ESD *esd;
- u16 es_id;
- b2v.bifs = gf_bifs_decoder_new(b2v.sg, 0);
-
- for (track_number=0; track_number<gf_isom_get_track_count(file); track_number++) {
- esd = gf_isom_get_esd(file, track_number+1, 1);
- if (!esd) continue;
- if (!esd->dependsOnESID && (esd->decoderConfig->streamType == GF_STREAM_SCENE)) break;
- gf_odf_desc_del((GF_Descriptor *) esd);
- esd = NULL;
- }
- if (!esd) {
- printf("no bifs track found\n");
- goto err_exit;
- }
-
- es_id = (u16) gf_isom_get_track_id(file, track_number+1);
- e = gf_bifs_decoder_configure_stream(b2v.bifs, es_id, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, esd->decoderConfig->objectTypeIndication);
- if (e) {
- printf("BIFS init error %s\n", gf_error_to_string(e));
- gf_odf_desc_del((GF_Descriptor *) esd);
- esd = NULL;
- goto err_exit;
- }
-
- {
- GF_ISOSample *samp = gf_isom_get_sample(file, track_number+1, 1, &di);
- b2v.cts = samp->DTS + samp->CTS_Offset;
- /*apply command*/
- gf_bifs_decode_au(b2v.bifs, es_id, samp->data, samp->dataLength, ((Double)(s64)b2v.cts)/1000.0);
- gf_isom_sample_del(&samp);
- }
-
- b2v.duration = gf_isom_get_media_duration(file, track_number+1);
-
- gf_odf_desc_del((GF_Descriptor *) esd);
-
- }
- gf_sc_set_scene(b2v.sr, b2v.sg);
-
- if (!width || !height) {
- gf_sg_get_scene_size_info(b2v.sg, &width, &height);
- }
- /*we work in RGB24, and we must make sure the pitch is %4*/
- if ((width*3)%4) {
- printf("Adjusting width (%d) to have a stride multiple of 4\n", width);
- while ((width*3)%4) width--;
- }
- gf_sc_set_size(b2v.sr, width, height);
- gf_sc_get_screen_buffer(b2v.sr, &fb);
- width = fb.width;
- height = fb.height;
- gf_sc_release_screen_buffer(b2v.sr, &fb);
-
- GF_SAFEALLOC(rendered_frames, nb_viewpoints*sizeof(char *));
- for (viewpoint_index = 1; viewpoint_index <= nb_viewpoints; viewpoint_index++) {
- GF_SAFEALLOC(rendered_frames[viewpoint_index-1], fb.width*fb.height*3);
- gf_sc_set_viewpoint(b2v.sr, viewpoint_index, NULL);
- gf_sc_draw_frame(b2v.sr, 0, NULL);
- /*needed for background2D !!*/
- gf_sc_draw_frame(b2v.sr, 0, NULL);
- strcpy(out_path, "");
- if (out_dir) {
- strcat(out_path, out_dir);
- if (out_path[strlen(out_path)-1] != '\\') strcat(out_path, "\\");
- }
- strcat(out_path, rad_name);
- strcat(out_path, "_view");
- gf_sc_get_screen_buffer(b2v.sr, &fb);
- write_bmp(&fb, out_path, viewpoint_index);
- memcpy(rendered_frames[viewpoint_index-1], fb.video_buffer, fb.width*fb.height*3);
- gf_sc_release_screen_buffer(b2v.sr, &fb);
- }
-
- if (width != 800 || height != 480) {
- printf("Wrong scene dimension, cannot produce output\n");
- goto err_exit;
- } else {
- u32 x, y;
- GF_VideoSurface out_fb;
- u32 bpp = 3;
- out_fb.width = 800;
- out_fb.height = 480;
- out_fb.pitch = 800*bpp;
- out_fb.pixel_format = GF_PIXEL_RGB_24;
- out_fb.is_hardware_memory = 0;
- GF_SAFEALLOC(out_fb.video_buffer, out_fb.pitch*out_fb.height)
-#if 1
- for (y=0; y<out_fb.height; y++) {
- /*starting red pixel is R1, R5, R4, R3, R2, R1, R5, ... when increasing line num*/
- u32 line_shift = (5-y) % 5;
- for (x=0; x<out_fb.width; x++) {
- u32 view_shift = (line_shift+bpp*x)%5;
- u32 offset = out_fb.pitch*y + x*bpp;
- /* red */
- out_fb.video_buffer[offset] = rendered_frames[view_shift][offset];
- /* green */
- out_fb.video_buffer[offset+1] = rendered_frames[(view_shift+1)%5][offset+1];
- /* blue */
- out_fb.video_buffer[offset+2] = rendered_frames[(view_shift+2)%5][offset+2];
- }
- }
-#else
- /*calibration*/
- for (y=0; y<out_fb.height; y++) {
- u32 line_shift = (5- y%5) % 5;
- for (x=0; x<out_fb.width; x++) {
- u32 view_shift = (line_shift+bpp*x)%5;
- u32 offset = out_fb.pitch*y + x*bpp;
- out_fb.video_buffer[offset] = ((view_shift)%5 == 2) ? 0xFF : 0;
- out_fb.video_buffer[offset+1] = ((view_shift+1)%5 == 2) ? 0xFF : 0;
- out_fb.video_buffer[offset+2] = ((view_shift+2)%5 == 2) ? 0xFF : 0;
- }
- }
-#endif
- write_bmp(&out_fb, "output", 0);
- }
-
- /*destroy everything*/
- gf_bifs_decoder_del(b2v.bifs);
- gf_sg_del(b2v.sg);
- gf_sc_set_scene(b2v.sr, NULL);
- gf_sc_del(b2v.sr);
-
-
-
-err_exit:
- /* if (rendered_frames) {
- for (viewpoint_index = 1; viewpoint_index <= nb_viewpoints; viewpoint_index++) {
- if (rendered_frames[viewpoint_index-1]) gf_free(rendered_frames[viewpoint_index-1]);
- }
- gf_free(rendered_frames);
- }
- if (output_merged_frame) gf_free(output_merged_frame);
- */
- if (user.modules) gf_modules_del(user.modules);
- if (needs_raw) gf_cfg_set_key(user.config, "core", "video-output", old_driv);
- gf_cfg_del(user.config);
-}
-
-void bifs_to_vid(GF_ISOFile *file, char *szConfigFile, u32 width, u32 height, char *rad_name, u32 dump_type, char *out_dir, Double fps, s32 frameID, s32 dump_time)
-{
- GF_User user;
- BIFSVID b2v;
- u16 es_id;
- Bool first_dump, needs_raw;
- u32 i, j, di, count, timescale, frameNum;
- u32 duration, cur_time;
- GF_VideoSurface fb;
- GF_Err e;
- char old_driv[1024];
- const char *test;
- char config_path[GF_MAX_PATH];
- avi_t *avi_out;
- Bool reset_fps;
- GF_ESD *esd;
- char comp[5];
- char *conv_buf;
-
- memset(&user, 0, sizeof(GF_User));
- if (szConfigFile && strlen(szConfigFile)) {
- user.config = gf_cfg_init(config_path, NULL);
- } else {
- user.config = gf_cfg_init(NULL, NULL);
- }
-
- if (!user.config) {
- fprintf(stdout, "Error: Configuration File \"%s\" not found in %s\n", GPAC_CFG_FILE, config_path);
- return;
- }
- avi_out = NULL;
- conv_buf = NULL;
- esd = NULL;
- needs_raw = 0;
- test = gf_cfg_get_key(user.config, "Core", "ModulesDirectory");
- user.modules = gf_modules_new((const unsigned char *) test, user.config);
- strcpy(old_driv, "raw_out");
- if (!gf_modules_get_count(user.modules)) {
- printf("Error: no modules found\n");
- goto err_exit;
- }
-
- /*switch driver to raw_driver*/
- test = gf_cfg_get_key(user.config, "core", "video-output");
- if (test) strcpy(old_driv, test);
-
- test = gf_cfg_get_key(user.config, "Compositor", "RendererName");
- /*since we only support RGB24 for MP42AVI force using RAW out with 2D driver*/
- if (test && strstr(test, "2D")) {
- needs_raw = 1;
- }
-
- needs_raw = 0;
- user.init_flags = GF_TERM_NO_AUDIO | GF_TERM_FORCE_3D;
- b2v.sr = gf_sc_new(&user, 0, NULL);
- gf_sc_set_option(b2v.sr, GF_OPT_VISIBLE, 0);
-
- b2v.sg = gf_sg_new();
- gf_sg_set_scene_time_callback(b2v.sg, get_scene_time, &b2v);
- gf_sg_set_init_callback(b2v.sg, node_init, &b2v);
- gf_sg_set_modified_callback(b2v.sg, node_modif, &b2v);
-
- /*load config*/
- gf_sc_set_option(b2v.sr, GF_OPT_RELOAD_CONFIG, 1);
-
- b2v.bifs = gf_bifs_decoder_new(b2v.sg, 0);
-
- strcpy(config_path, "");
- if (out_dir) {
- strcat(config_path, out_dir);
- if (config_path[strlen(config_path)-1] != '\\') strcat(config_path, "\\");
- }
- strcat(config_path, rad_name);
- strcat(config_path, "_bifs");
- if (!dump_type) {
- strcat(config_path, ".avi");
- avi_out = AVI_open_output_file(config_path);
- comp[0] = comp[1] = comp[2] = comp[3] = comp[4] = 0;
- if (!avi_out) goto err_exit;
- }
-
-
- for (i=0; i<gf_isom_get_track_count(file); i++) {
- esd = gf_isom_get_esd(file, i+1, 1);
- if (!esd) continue;
- if (!esd->dependsOnESID && (esd->decoderConfig->streamType == GF_STREAM_SCENE)) break;
- gf_odf_desc_del((GF_Descriptor *) esd);
- esd = NULL;
- }
- if (!esd) {
- printf("no bifs track found\n");
- goto err_exit;
- }
-
- b2v.duration = gf_isom_get_media_duration(file, i+1);
- timescale = gf_isom_get_media_timescale(file, i+1);
- es_id = (u16) gf_isom_get_track_id(file, i+1);
- e = gf_bifs_decoder_configure_stream(b2v.bifs, es_id, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, esd->decoderConfig->objectTypeIndication);
- if (e) {
- printf("BIFS init error %s\n", gf_error_to_string(e));
- gf_odf_desc_del((GF_Descriptor *) esd);
- esd = NULL;
- goto err_exit;
- }
- if (dump_time>=0) dump_time = dump_time *1000 / timescale;
-
- gf_sc_set_scene(b2v.sr, b2v.sg);
- count = gf_isom_get_sample_count(file, i+1);
-
- reset_fps = 0;
- if (!fps) {
- fps = (Float) (count * timescale);
- fps /= (Double) (s64) b2v.duration;
- printf("Estimated BIFS FrameRate %g\n", fps);
- reset_fps = 1;
- }
-
- if (!width || !height) {
- gf_sg_get_scene_size_info(b2v.sg, &width, &height);
- }
- /*we work in RGB24, and we must make sure the pitch is %4*/
- if ((width*3)%4) {
- printf("Adjusting width (%d) to have a stride multiple of 4\n", width);
- while ((width*3)%4) width--;
- }
-
- gf_sc_set_size(b2v.sr, width, height);
- gf_sc_draw_frame(b2v.sr, 0, NULL);
-
- gf_sc_get_screen_buffer(b2v.sr, &fb);
- width = fb.width;
- height = fb.height;
- if (avi_out) {
- AVI_set_video(avi_out, width, height, fps, comp);
- conv_buf = gf_malloc(sizeof(char) * width * height * 3);
- }
- printf("Dumping at BIFS resolution %d x %d\n\n", width, height);
- gf_sc_release_screen_buffer(b2v.sr, &fb);
-
- cur_time = 0;
-
- duration = (u32)(timescale / fps);
- if (reset_fps) fps = 0;
-
- frameNum = 1;
- first_dump = 1;
- for (j=0; j<count; j++) {
- GF_ISOSample *samp = gf_isom_get_sample(file, i+1, j+1, &di);
-
- b2v.cts = samp->DTS + samp->CTS_Offset;
- /*apply command*/
- gf_bifs_decode_au(b2v.bifs, es_id, samp->data, samp->dataLength, ((Double)(s64)b2v.cts)/1000.0);
- gf_isom_sample_del(&samp);
-
- if ((frameID>=0) && (j<(u32)frameID)) continue;
- if ((dump_time>=0) && ((u32) dump_time>b2v.cts)) continue;
- /*render frame*/
- gf_sc_draw_frame(b2v.sr, 0, NULL);
- /*needed for background2D !!*/
- if (first_dump) {
- gf_sc_draw_frame(b2v.sr, 0, NULL);
- first_dump = 0;
- }
-
- if (fps) {
- if (cur_time > b2v.cts) continue;
-
- while (1) {
- printf("dumped frame time %f (frame %d - sample %d)\r", ((Float)cur_time)/timescale, frameNum, j+1);
- dump_frame(b2v, conv_buf, config_path, dump_type, avi_out, frameNum);
- frameNum++;
- cur_time += duration;
- if (cur_time > b2v.cts) break;
- }
- } else {
- dump_frame(b2v, conv_buf, config_path, dump_type, avi_out, (frameID>=0) ? frameID : frameNum);
- if (frameID>=0 || dump_time>=0) break;
- frameNum++;
- printf("dumped frame %d / %d\r", j+1, count);
- }
-
- }
- gf_odf_desc_del((GF_Descriptor *) esd);
-
- /*destroy everything*/
- gf_bifs_decoder_del(b2v.bifs);
- gf_sg_del(b2v.sg);
- gf_sc_set_scene(b2v.sr, NULL);
- gf_sc_del(b2v.sr);
-
-err_exit:
- if (avi_out) AVI_close(avi_out);
- if (conv_buf) gf_free(conv_buf);
- if (user.modules) gf_modules_del(user.modules);
- if (needs_raw) gf_cfg_set_key(user.config, "core", "video-output", old_driv);
- gf_cfg_del(user.config);
-}
-
-int main (int argc, char **argv)
-{
- Double fps_dump;
- u32 i;
- char rad[500];
- s32 frameID, h, m, s, f;
- Float fps;
- u32 dump_type;
- s32 dump_time;
- u32 dump_w, dump_h;
- Bool copy;
- char szConfigFile[4096];
- char *dump_out;
- char *inName, *arg;
- GF_ISOFile *file;
-
- if (argc < 2) {
- PrintUsage();
- return 0;
- }
-
- dump_type = 0;
- fps_dump = 0.0f;
- dump_w = dump_h = 0;
- dump_out = NULL;
- inName = NULL;
- frameID = -1;
- dump_time = -1;
- szConfigFile[0] = 0;
-
- for (i = 1; i < (u32) argc ; i++) {
- arg = argv[i];
- if (arg[0] != '-') {
- inName = arg;
- break;
- }
- if (!stricmp(arg, "-h")) {
- PrintUsage();
- return 0;
- } else if (!stricmp(arg, "-version")) {
- PrintVersion();
- return 0;
- } else if (!stricmp(arg, "-size")) {
- sscanf(argv[i+1], "%dx%d", &dump_w, &dump_h);
- i++;
- } else if (!stricmp(arg, "-raw")) {
- dump_type = 2;
- if ((i+1<(u32)argc) && (argv[i+1][0]!='-')) {
- if (strstr(argv[i+1], "T")) {
- if (strstr(argv[i+1], "F")) {
- sscanf(argv[i+1], "T%d:%d:%d:%dF%f", &h, &m, &s, &f, &fps);
- dump_time = (s32) ((3600*h + 60*m + s)*1000 + 1000*f/fps);
- } else {
- sscanf(argv[i+1], "T%d:%d:%d", &h, &m, &s);
- dump_time = (s32) ((3600*h + 60*m + s)*1000);
- }
- } else {
- frameID = atoi(argv[i+1]);
- }
- i++;
- }
- } else if (!stricmp(arg, "-bmp")) {
- dump_type = 1;
- if ((i+1<(u32)argc) && (argv[i+1][0]!='-')) {
- if (strstr(argv[i+1], "T")) {
- if (strstr(argv[i+1], "F")) {
- sscanf(argv[i+1], "T%d:%d:%d:%dF%f", &h, &m, &s, &f, &fps);
- dump_time = (s32) ((3600*h + 60*m + s)*1000 + 1000*f/fps);
- } else {
- sscanf(argv[i+1], "T%d:%d:%d", &h, &m, &s);
- dump_time = (s32) ((3600*h + 60*m + s)*1000);
- }
- } else {
- frameID = atoi(argv[i+1]);
- }
- i++;
- }
- } else if (!stricmp(arg, "-3d")) {
- dump_type = 3;
- } else if (!stricmp(arg, "-outpath")) {
- dump_out = argv[i+1];
- i++;
- } else if (!stricmp(arg, "-fps")) {
- fps_dump = atof(argv[i+1]);
- i++;
- } else if (!stricmp(arg, "-copy")) {
- copy = 1;
- } else if (!stricmp(arg, "-cfg")) {
- strcpy(szConfigFile, argv[i+1]);
- i += 1;
- } else {
- PrintUsage();
- return (0);
- }
- }
- if (!inName) {
- PrintUsage();
- return 0;
- }
- gf_sys_init(GF_MemTrackerNone);
-
- file = gf_isom_open(inName, GF_ISOM_OPEN_READ, NULL);
- if (!file) {
- printf("Error opening file: %s\n", gf_error_to_string(gf_isom_last_error(NULL)));
- return 0;
- }
-
- if (dump_out) {
- arg = strrchr(inName, GF_PATH_SEPARATOR);
- if (arg) {
- strcpy(rad, arg + 1);
- } else {
- strcpy(rad, inName);
- }
- } else {
- strcpy(rad, inName);
- }
- while (rad[strlen(rad)-1] != '.') rad[strlen(rad)-1] = 0;
- rad[strlen(rad)-1] = 0;
- if (dump_type == 3) {
- bifs3d_viewpoints_merger(file, szConfigFile, dump_w, dump_h, rad, dump_type, dump_out, fps_dump, frameID, dump_time);
- }
- else bifs_to_vid(file, szConfigFile, dump_w, dump_h, rad, dump_type, dump_out, fps_dump, frameID, dump_time);
- printf("\ndone\n");
- gf_isom_delete(file);
- return 0;
-
-}
-
+++ /dev/null
-/* Copyright (c) 2004, Nokia. All rights reserved */
-
-#include <aiftool.rh>
-
-RESOURCE AIF_DATA
- {
-
- app_uid = 0x1000AC00;
- num_icons = 2;
- embeddability = KAppNotEmbeddable;
- newfile = KAppDoesNotSupportNewFile;
- }
-
-// End of File
+++ /dev/null
-#include "osmo4.h"
-#include "osmo4_ui.h"
-
-
-EXPORT_C CApaApplication* NewApplication()
-{
- return new COsmo4Application;
-}
-
-
-#ifdef EKA2
-
-#include <eikstart.h>
-
-GLDEF_C TInt E32Main()
-{
- return EikStart::RunApplication( NewApplication );
-}
-
-#else
-
-
-GLDEF_C TInt E32Dll( TDllReason /*aReason*/ )
-{
- return KErrNone;
-}
-
-#endif
-
-
-#if defined(__SERIES60_3X__)
-const TUid KUidOsmo4App = { 0xf01f9075 };
-#else
-const TUid KUidOsmo4App = { 0x1000AC00 };
-#endif
-
-
-CApaDocument* COsmo4Application::CreateDocumentL()
-{
- return (static_cast<CApaDocument*> ( COsmo4Document::NewL( *this ) ) );
-}
-
-TUid COsmo4Application::AppDllUid() const
-{
- return KUidOsmo4App;
-}
-
-
-COsmo4Document* COsmo4Document::NewL( CEikApplication& aApp )
-{
- COsmo4Document* self = NewLC( aApp );
- CleanupStack::Pop( self );
- return self;
-}
-
-COsmo4Document* COsmo4Document::NewLC( CEikApplication& aApp )
-{
- COsmo4Document* self =
- new ( ELeave ) COsmo4Document( aApp );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
-}
-void COsmo4Document::ConstructL()
-{
-}
-
-COsmo4Document::COsmo4Document( CEikApplication& aApp )
- : CAknDocument( aApp )
-{
-}
-
-COsmo4Document::~COsmo4Document()
-{
-}
-
-CEikAppUi* COsmo4Document::CreateAppUiL()
-{
- return ( static_cast <CEikAppUi*> ( new ( ELeave ) COsmo4AppUi ) );
-}
-
+++ /dev/null
-/* Copyright (c) 2004, Nokia. All rights reserved */
-
-
-#ifndef __OSMO4_H__
-#define __OSMO4_H__
-
-// INCLUDES
-#include <aknapp.h>
-#include <akndoc.h>
-
-class COsmo4Application : public CAknApplication
-{
-public:
- TUid AppDllUid() const;
-
-protected:
- CApaDocument* CreateDocumentL();
-};
-
-
-class COsmo4Document : public CAknDocument
-{
-public:
- static COsmo4Document* NewL( CEikApplication& aApp );
- static COsmo4Document* NewLC( CEikApplication& aApp );
- virtual ~COsmo4Document();
-
-public:
- CEikAppUi* CreateAppUiL();
-
-private:
- void ConstructL();
- COsmo4Document( CEikApplication& aApp );
-
-};
-
-#endif // __OSMO4_H__
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / Symbian GUI player
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-// INCLUDE FILES
-#include <avkon.hrh>
-#include <eikmenup.h>
-#include <akntitle.h>
-
-#include <stringloader.h>
-#include <osmo4.rsg>
-#include <f32file.h>
-#include <s32file.h>
-#include <bacline.h>
-#include <eikbtgps.h>
-#include <aknquerydialog.h>
-
-
-#include "osmo4_ui.h"
-#include "osmo4_view.h"
-#include "playlist.h"
-
-#include <gpac/utf.h>
-#include <gpac/options.h>
-
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-
-// -----------------------------------------------------------------------------
-// Cosmo4AppUi::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppUi::ConstructL()
-{
- // Initialise app UI with standard value.
- BaseConstructL(CAknAppUi::EAknEnableSkin);
-
- /*Create display*/
- iAppView = COsmo4AppView::NewL( ClientRect() );
- AddToStackL(iAppView);
-
- /*create playlist*/
-#ifndef GPAC_GUI_ONLY
- iPlaylist = CPlaylist::NewL( ClientRect(), iAppView->GetUser() );
-
- iPlaylist->MakeVisible(EFalse);
-#endif
-
- iAppView->MakeVisible(ETrue);
- view_mode = 0;
-
- m_title = NULL;
-
- //StatusPane ()->SwitchLayoutL ( R_AVKON_STATUS_PANE_LAYOUT_SMALL );
-
- nb_keys = 0;
- CaptureKeys(1);
-
-
-
- CCommandLineArguments *args = CCommandLineArguments::NewL();
-#ifndef GPAC_GUI_ONLY
- if (args->Count() > 1) {
- TPtrC url = args->Arg(1);
-#if defined(_UNICODE)
- char szURL[1024];
- u16 szURLUTF16[1024];
- size_t len;
- len = url.Size();
- memcpy(szURLUTF16, url.Ptr(), sizeof(u8)*len);
- szURLUTF16[len/2] = 0;
- const u16 *sptr = szURLUTF16;
- len = gf_utf8_wcstombs(szURL, 512, &sptr);
- if (len != (size_t) -1) {
- szURL[len] = 0;
- iAppView->Connect((const char *)szURL);
- }
-#else
- iAppView->Connect((const char *)url.Ptr());
-#endif
- }
-#endif
- delete args;
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppUi::COsmo4AppUi()
-// C++ default constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppUi::COsmo4AppUi()
-{
- // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppUi::~COsmo4AppUi()
-// Destructor.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppUi::~COsmo4AppUi()
-{
- CaptureKeys(0);
-
- switch (view_mode) {
- case 0:
- if (iAppView) RemoveFromStack(iAppView);
- break;
- case 1:
- if (iPlaylist) RemoveFromStack(iPlaylist);
- break;
- }
- if (iAppView) delete iAppView;
- if (iPlaylist) delete iPlaylist;
- if (m_title) gf_free(m_title);
- m_title = NULL;
-}
-
-
-void COsmo4AppUi::CaptureKey(TInt32 code, TInt32 scancode)
-{
- RWindowGroup iWG = CCoeEnv::Static()->RootWin();
- if (nb_keys>=MAX_KEY_CAP) return;
- keys[nb_keys].key_cap = iWG.CaptureKey(code, 0, 0);
- keys[nb_keys].key_cap_ud = iWG.CaptureKeyUpAndDowns(scancode, 0, 0);
- nb_keys++;
-}
-/*
-possible meaning for key codes:
-EStdKeyYes -Call
-EStdKeyNo -End
-EStdKeyApplication0 -Apps key
-EStdKeyDevice0 -Left softkey
-EStdKeyDevice1 -Right softkey
-EStdKeyDevice2 -Power
-EStdKeyDevice3 -Button press
-EStdKeyDevice4 -Flip - Open
-EStdKeyDevice5 -Flip - Close
-EStdKeyDevice6 -Side key
-
-EStdKeyDeviceD -Jog Dial forward
-EStdKeyDeviceE -Jog Dial back
-*/
-void COsmo4AppUi::CaptureKeys(int do_capture)
-{
- if (do_capture) {
- CaptureKey(EKeyIncVolume, EStdKeyIncVolume);
- CaptureKey(EKeyDecVolume, EStdKeyDecVolume);
- } else {
- RWindowGroup iWG = CCoeEnv::Static()->RootWin();
- for (int i=0; i<nb_keys; i++) {
- iWG.CancelCaptureKey(keys[i].key_cap);
- iWG.CancelCaptureKeyUpAndDowns(keys[i].key_cap_ud);
- }
- nb_keys = 0;
- }
-}
-
-
-void COsmo4AppUi::HandleForegroundEventL(TBool aForeground)
-{
- CaptureKeys(aForeground ? 1 : 0);
- CAknAppUi::HandleForegroundEventL(aForeground);
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppUi::HandleCommandL()
-// Takes care of command handling.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppUi::HandleCommandL( TInt aCommand )
-{
- GF_Err e;
-#ifndef GPAC_GUI_ONLY
- switch( aCommand ) {
- case EAknSoftkeyBack:
- if (view_mode==1) TogglePlaylist();
- break;
- case EEikCmdExit:
- case EAknSoftkeyExit:
- iAppView->Shutdown();
- Exit();
- break;
- /*PLAYLIST commands*/
- case EOsmo4PlayListAdd:
- iPlaylist->PlaylistAct(Osmo4PLAdd);
- break;
- case EOsmo4PlayListRem:
- iPlaylist->PlaylistAct(Osmo4PLRem);
- break;
- case EOsmo4PlayListMoveUp:
- iPlaylist->PlaylistAct(Osmo4PLMoveUp);
- break;
- case EOsmo4PlayListMoveDown:
- iPlaylist->PlaylistAct(Osmo4PLMoveDown);
- break;
- case EOsmo4PlayListClear:
- iPlaylist->PlaylistAct(Osmo4PLClear);
- break;
- case EOsmo4PlayListMode:
- iPlaylist->PlaylistAct(Osmo4PLToggleMode);
- break;
- case EOsmo4PlayListAllFiles:
- iPlaylist->PlaylistAct(Osmo4PLToggleAllFiles);
- break;
-
- /*FILE menu command*/
- case EOsmo4PlayListView:
- TogglePlaylist();
- break;
- case EOsmo4OpenURL:
- break;
- case EOsmo4Fullscreen:
- break;
- case EOsmo4ViewMaxSize:
- {
- CEikStatusPane* statusPane = StatusPane();
- if (statusPane->IsVisible()) statusPane->MakeVisible(EFalse);
- else statusPane->MakeVisible(ETrue);
- }
- break;
- case EOsmo4AROriginal:
- gf_term_set_option(iAppView->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
- break;
- case EOsmo4ARFillScreen:
- gf_term_set_option(iAppView->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN);
- break;
- case EOsmo4AR4_3:
- gf_term_set_option(iAppView->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3);
- break;
- case EOsmo4AR16_9:
- gf_term_set_option(iAppView->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);
- break;
-
- case EOsmo4NavReset:
- gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION_TYPE, 0);
- break;
- case EOsmo4NavNone:
- gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE);
- break;
- case EOsmo4NavSlide:
- e = gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE);
- if (e) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("Cannot set navigation: %s", gf_error_to_string(e) ));
- }
- break;
- case EOsmo4NavWalk:
- gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_WALK);
- break;
- case EOsmo4NavFly:
- gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_FLY);
- break;
- case EOsmo4NavExamine:
- gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_EXAMINE);
- break;
- case EOsmo4NavHeadlight:
- gf_term_set_option(iAppView->m_term, GF_OPT_HEADLIGHT, !gf_term_get_option(iAppView->m_term, GF_OPT_HEADLIGHT) );
- break;
- case EOsmo4CollideNone:
- gf_term_set_option(iAppView->m_term, GF_OPT_COLLISION, GF_COLLISION_NONE);
- break;
- case EOsmo4CollideSimple:
- gf_term_set_option(iAppView->m_term, GF_OPT_COLLISION, GF_COLLISION_NORMAL);
- break;
- case EOsmo4CollideDisp:
- gf_term_set_option(iAppView->m_term, GF_OPT_COLLISION, GF_COLLISION_DISPLACEMENT);
- break;
- case EOsmo4NavGravity:
- gf_term_set_option(iAppView->m_term, GF_OPT_GRAVITY, !gf_term_get_option(iAppView->m_term, GF_OPT_GRAVITY));
- break;
- case EOsmo4ViewRTI:
- iAppView->show_rti = !iAppView->show_rti;
- break;
-
- case EOsmo4OptEnableLogs:
- {
- const char *opt = gf_cfg_get_key(iAppView->m_user.config, "General", "Logs");
- if (opt && !stricmp(opt, "@debug")) {
- gf_cfg_set_key(iAppView->m_user.config, "General", "Logs", "all@error");
- } else {
- gf_cfg_set_key(iAppView->m_user.config, "General", "Logs", "all@debug");
- }
- iAppView->SetupLogs();
- }
- break;
- case EOsmo4OptOpenGL:
- {
- const char *opt = gf_cfg_get_key(iAppView->m_user.config, "Compositor", "ForceOpenGL");
- Bool use_gl = (opt && !strcmp(opt, "yes")) ? 1 : 0;
- gf_cfg_set_key(iAppView->m_user.config, "Compositor", "ForceOpenGL", use_gl ? "no" : "yes");
- gf_term_set_option(iAppView->m_term, GF_OPT_USE_OPENGL, !use_gl);
- }
- break;
- case EOsmo4OptDirectDraw:
- {
- const char *opt = gf_cfg_get_key(iAppView->m_user.config, "Compositor", "DirectDraw");
- Bool use_dd = (opt && !strcmp(opt, "yes")) ? 1 : 0;
- gf_cfg_set_key(iAppView->m_user.config, "Compositor", "DirectDraw", use_dd ? "no" : "yes");
- gf_term_set_option(iAppView->m_term, GF_OPT_DIRECT_DRAW, !use_dd);
- }
- break;
- case EOsmo4OptXMLProgressive:
- {
- const char *opt = gf_cfg_get_key(iAppView->m_user.config, "SAXLoader", "Progressive");
- Bool use_prog = (opt && !strcmp(opt, "yes")) ? 1 : 0;
- gf_cfg_set_key(iAppView->m_user.config, "SAXLoader", "Progressive", use_prog ? "no" : "yes");
- gf_cfg_set_key(iAppView->m_user.config, "SAXLoader", "MaxDuration", "100");
- }
- break;
-
- default:
- if ((aCommand>=EOsmo4OpenRecentFirst) && (aCommand<=EOsmo4OpenRecentLast)) {
- const char *sOpt = gf_cfg_get_key_name(iAppView->m_user.config, "RecentFiles", aCommand - EOsmo4OpenRecentFirst);
- if (sOpt) iAppView->Connect(sOpt);
- } else {
- iAppView->MessageBox("Unandled command - panic", "Osmo4");
- Panic( EOsmo4Ui );
- }
- break;
- }
-#endif
-}
-
-
-// -----------------------------------------------------------------------------
-// Called by the framework when the application status pane
-// size is changed. Passes the new client rectangle to the
-// AppView
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppUi::HandleStatusPaneSizeChange()
-{
- iAppView->SetRect( ClientRect() );
-#ifndef GPAC_GUI_ONLY
- iPlaylist->SetRect( ClientRect() );
-#endif
-}
-
-void COsmo4AppUi::TogglePlaylist()
-{
- CEikButtonGroupContainer* cba= CEikButtonGroupContainer::Current();
-
-#ifndef GPAC_GUI_ONLY
- switch (view_mode) {
- case 0:
- RemoveFromStack(iAppView);
- iAppView->ShowHide(0);
- AddToStackL(iPlaylist);
- if (cba) {
- cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_BACK);
- cba->DrawDeferred();
- }
- view_was_max = StatusPane()->IsVisible() ? 0 : 1;
- if (view_was_max) StatusPane()->MakeVisible(ETrue);
- iPlaylist->ShowHide(1);
- view_mode = 1;
- break;
- case 1:
- RemoveFromStack(iPlaylist);
- iPlaylist->ShowHide(0);
- AddToStackL(iAppView);
- if (cba) {
- cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT);
- cba->DrawDeferred();
- }
- iAppView->ShowHide(1);
- if (view_was_max) StatusPane()->MakeVisible(EFalse);
- view_was_max = 0;
- view_mode = 0;
- break;
- }
-#endif
-}
-
-void COsmo4AppUi::PlayURL(const char *url)
-{
- if (view_mode) {
- TogglePlaylist();
- }
- if (url) {
- char *sep;
- iAppView->Connect(url);
- sep = strrchr(url, '\\');
- SetTitle(sep ? sep+1 : url);
- }
-}
-
-void COsmo4AppUi::SetTitleInfo(const char *title)
-{
-#if 1
- CEikStatusPane* statusPane = StatusPane();
- CAknTitlePane *iTitlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
-
- if (!title) title = "Osmo4";
-
- HBufC *htitle = HBufC::NewL( strlen(title)+1);
- htitle->Des().Copy( TPtrC8(( TText8* ) title) );
- iTitlePane->SetText(htitle);
-#endif
-}
-
-void COsmo4AppUi::SetTitle(const char *title, int store_it)
-{
- if (store_it) {
- if (m_title) gf_free(m_title);
- m_title = NULL;
- if (title) m_title = gf_strdup(title);
- }
- SetTitleInfo(title ? title : m_title);
-}
-
-void COsmo4AppUi::SetInfo(const char *info)
-{
- if (view_mode) return;
- if (info) {
- char szTitle[200];
- sprintf(szTitle, "%s\n%s", info, m_title ? m_title : "Osmo4");
- SetTitleInfo(szTitle);
- } else {
- SetTitleInfo(m_title);
- }
-}
-
-
-#define DECLARE_MENU_ITEM(__text, __com, __check, __res, has_sep) \
- item.iText = __text; \
- item.iCommandId = __com; \
- item.iFlags = has_sep ? EEikMenuItemSeparatorAfter : 0; \
- if (__check) item.iFlags |= EEikMenuItemCheckBox | EEikMenuItemSymbolOn; \
- item.iCascadeId = __res; \
- aMenuPane->AddMenuItemL(item);
-
-
-void COsmo4AppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-{
- CEikMenuPaneItem::SData item;
-
- if (aResourceId==R_OSMO4_MENU) {
-
- aMenuPane->Reset();
-
- if (view_mode==1) {
-#ifndef GPAC_GUI_ONLY
- Bool is_file = iPlaylist->SelectionIsFile();
- Bool in_pl = (is_file && iPlaylist->IsInPlaylist()) ? 1 : 0;
-
- if (iPlaylist->PlaylistMode()) {
- DECLARE_MENU_ITEM(_L("Up"), EOsmo4PlayListMoveUp, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Down"), EOsmo4PlayListMoveDown, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Remove"), EOsmo4PlayListRem, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Clear"), EOsmo4PlayListClear, 0, 0, 1);
- } else if (!in_pl) {
- DECLARE_MENU_ITEM(_L("Add to PlayList"), EOsmo4PlayListAdd, 0, 0, 1);
- } else if (is_file) {
- DECLARE_MENU_ITEM(_L("Remove from Playlist"), EOsmo4PlayListRem, 0, 0, 1);
- }
-
- if (! iPlaylist->PlaylistMode()) {
- DECLARE_MENU_ITEM(iPlaylist->ViewAllFiles() ? _L("View known files") : _L("View all files"), EOsmo4PlayListAllFiles, 0, 0, 1);
- } else {
- DECLARE_MENU_ITEM(_L("Sort"), 0, 0, R_OSMO4_SM1, 1);
- }
- DECLARE_MENU_ITEM(iPlaylist->PlaylistMode() ? _L("Browse") : _L("Playlist"), EOsmo4PlayListMode, 0, 0, 0);
-#endif
- } else {
- /*open*/
- DECLARE_MENU_ITEM(_L("File"), 0, 0, R_OSMO4_SM1, 0);
- DECLARE_MENU_ITEM(_L("View"), 0, 0, R_OSMO4_SM2, 0);
- DECLARE_MENU_ITEM(_L("Options"), 0, 0, R_OSMO4_SM3, 0);
- //DECLARE_MENU_ITEM(_L("Exit"), EEikCmdExit, 0, 0, 0);
- }
- smenu_id = 0;
- return;
- }
- else if (aResourceId==R_OSMO4_SM1) {
- aMenuPane->Reset();
- /*sort menu*/
- if (view_mode==1) {
- }
- /*file menu*/
- else {
- DECLARE_MENU_ITEM(_L("Open local"), EOsmo4PlayListView, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Open URL"), EOsmo4OpenURL, 0, 0, 1);
-#ifndef GPAC_GUI_ONLY
- if (gf_cfg_get_key_name(iAppView->m_user.config, "RecentFiles", 0) != NULL) {
- DECLARE_MENU_ITEM(_L("Recent"), 0, 0, R_OSMO4_SSM1, 0);
- }
-#endif
- }
- smenu_id = 1;
- return;
- }
- /*not used*/
- if (view_mode==1) return;
-
- /*View menu*/
- if (aResourceId==R_OSMO4_SM2) {
- aMenuPane->Reset();
-#ifndef GPAC_GUI_ONLY
- /*content view menu*/
- if (gf_term_get_option(iAppView->m_term, GF_OPT_NAVIGATION_TYPE) != GF_NAVIGATE_TYPE_NONE) {
- DECLARE_MENU_ITEM(_L("Navigate"), 0, 0, R_OSMO4_SSM1, 1);
- }
-#endif
- DECLARE_MENU_ITEM(_L("Fullscreen"), EOsmo4Fullscreen, 0, 0, 0);
- /*don't allow content AR modification by user*/
- //DECLARE_MENU_ITEM(_L("Aspect Ratio"), 0, 0, R_OSMO4_SSM2, 1);
- DECLARE_MENU_ITEM(_L("Maximize size"), EOsmo4ViewMaxSize, (StatusPane()->IsVisible() ? 0 : 1), 0, 1);
- DECLARE_MENU_ITEM(_L("CPU Usage"), EOsmo4ViewRTI, iAppView->show_rti, 0, 0);
- smenu_id = 2;
- return;
- }
- /*Option menu*/
- if (aResourceId==R_OSMO4_SM3) {
-#ifndef GPAC_GUI_ONLY
- const char *opt = gf_cfg_get_key(iAppView->m_user.config, "Compositor", "ForceOpenGL");
- DECLARE_MENU_ITEM(_L("Use 2D OpenGL"), EOsmo4OptOpenGL, (opt && !strcmp(opt, "yes")) ? 1 : 0, 0, 0);
- opt = gf_cfg_get_key(iAppView->m_user.config, "Compositor", "DirectDraw");
- DECLARE_MENU_ITEM(_L("Direct Draw"), EOsmo4OptDirectDraw, (opt && !strcmp(opt, "yes")) ? 1 : 0, 0, 0);
- opt = gf_cfg_get_key(iAppView->m_user.config, "SAXLoader", "Progressive");
- DECLARE_MENU_ITEM(_L("Progressive XML"), EOsmo4OptXMLProgressive, (opt && !strcmp(opt, "yes")) ? 1 : 0, 0, 0);
-
-#endif
-
- DECLARE_MENU_ITEM(_L("Enable Logs"), EOsmo4OptEnableLogs, iAppView->do_log, 0, 0);
- return;
- }
-
- if (aResourceId==R_OSMO4_SSM1) {
- aMenuPane->Reset();
- if (smenu_id == 1) {
- u32 i = 0;
-#ifndef GPAC_GUI_ONLY
- while (1) {
- const char *opt = gf_cfg_get_key_name(iAppView->m_user.config, "RecentFiles", i);
- if (!opt) break;
- const char *sep = strrchr(opt, '\\');
- if (!sep) sep = strrchr(opt, '/');
- if (!sep) sep = opt;
- else sep += 1;
- item.iText.Copy( TPtrC8(( TText8* ) sep) );
- item.iCommandId = EOsmo4OpenRecentFirst + i;
- item.iFlags = 0;
- item.iCascadeId = 0;
- aMenuPane->AddMenuItemL(item);
- i++;
- if (i>=10) break;
- }
- if (!i) {
- DECLARE_MENU_ITEM(_L("_"), 0, 0, 0, 0);
- }
-#endif
- } else if (smenu_id == 2) {
- DECLARE_MENU_ITEM(_L("Reset"), EOsmo4NavReset, 0, 0, 1);
- DECLARE_MENU_ITEM(_L("None"), EOsmo4NavNone, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Slide"), EOsmo4NavSlide, 0, 0, 0);
-
-#ifndef GPAC_GUI_ONLY
- if (gf_term_get_option(iAppView->m_term, GF_OPT_NAVIGATION_TYPE) == GF_NAVIGATE_TYPE_3D) {
- DECLARE_MENU_ITEM(_L("Walk"), EOsmo4NavWalk, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Fly"), EOsmo4NavFly, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Examine"), EOsmo4NavExamine, 0, 0, 1);
- DECLARE_MENU_ITEM(_L("Headlight"), EOsmo4NavHeadlight, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Gravity"), EOsmo4NavGravity, 0, 0, 0);
- }
-#endif
- }
- return;
- }
-
- if (aResourceId==R_OSMO4_SSM2) {
- aMenuPane->Reset();
- DECLARE_MENU_ITEM(_L("Keep Original"), EOsmo4AROriginal, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Fill Screen"), EOsmo4ARFillScreen, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Ratio 4-3"), EOsmo4AR4_3, 0, 0, 0);
- DECLARE_MENU_ITEM(_L("Ratio 16-9"), EOsmo4AR16_9, 0, 0, 0);
- return;
- }
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / Symbian GUI player
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef __OSMO4_UI_H__
-#define __OSMO4_UI_H__
-
-// INCLUDES
-#include <aknappui.h>
-
-
-// FORWARD DECLARATIONS
-class COsmo4AppView;
-class CPlaylist;
-
-
-// osmo4 enumerate command codes
-enum TOsmo4Ids
-{
- /*Playlist commands*/
- EOsmo4PlayListView = 0x6001,
- EOsmo4PlayListAdd,
- EOsmo4PlayListRem,
- EOsmo4PlayListMode,
- EOsmo4PlayListMoveUp,
- EOsmo4PlayListMoveDown,
- EOsmo4PlayListClear,
- EOsmo4PlayListAllFiles,
- /*file commands*/
- EOsmo4OpenURL,
- EOsmo4OpenRecentFirst,
- EOsmo4OpenRecentLast = EOsmo4OpenRecentFirst + 10,
- /*view commands*/
- EOsmo4Fullscreen,
- EOsmo4ViewMaxSize,
- EOsmo4AROriginal,
- EOsmo4ARFillScreen,
- EOsmo4AR4_3,
- EOsmo4AR16_9,
- EOsmo4NavReset,
- EOsmo4NavNone,
- EOsmo4NavSlide,
- EOsmo4NavWalk,
- EOsmo4NavFly,
- EOsmo4NavExamine,
- EOsmo4NavHeadlight,
- EOsmo4NavGravity,
- EOsmo4CollideNone,
- EOsmo4CollideSimple,
- EOsmo4CollideDisp,
- EOsmo4ViewRTI,
-
- /*option commands*/
- EOsmo4OptEnableLogs,
- EOsmo4OptOpenGL,
- EOsmo4OptDirectDraw,
- EOsmo4OptXMLProgressive,
-
-
-};
-
-
-/** osmo4 application panic codes */
-enum TOsmo4Panics
-{
- EOsmo4Ui = 1
- // add further panics here
-};
-
-inline void Panic(TOsmo4Panics aReason)
-{
- _LIT(applicationName,"Osmo4");
- User::Panic(applicationName, aReason);
-}
-
-
-#define MAX_KEY_CAP 10
-typedef struct
-{
- TInt32 key_cap;
- TInt32 key_cap_ud;
-} KeyCapInfo;
-
-// CLASS DECLARATION
-/**
-* COsmo4AppUi application UI class.
-* Interacts with the user through the UI and request message processing
-* from the handler class
-*/
-class COsmo4AppUi : public CAknAppUi
-{
-public: // Constructors and destructor
-
- /**
- * ConstructL.
- * 2nd phase constructor.
- */
- void ConstructL();
-
- /**
- * COsmo4AppUi.
- * C++ default constructor. This needs to be public due to
- * the way the framework constructs the AppUi
- */
- COsmo4AppUi();
-
- /**
- * ~COsmo4AppUi.
- * Virtual Destructor.
- */
- virtual ~COsmo4AppUi();
-
-private: // Functions from base classes
-
- /**
- * From CEikAppUi, HandleCommandL.
- * Takes care of command handling.
- * @param aCommand Command to be handled.
- */
- void HandleCommandL( TInt aCommand );
-
-
- /**
- * HandleStatusPaneSizeChange.
- * Called by the framework when the application status pane
- * size is changed.
- */
-
- void HandleStatusPaneSizeChange();
- virtual void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-
-public:
- void PlayURL(const char *);
- void SetTitle(const char *title, TBool store_it = ETrue);
- void SetInfo(const char *);
-
-private:
- void TogglePlaylist();
- void SetTitleInfo(const char *);
- void HandleForegroundEventL(TBool aForeground);
- void CaptureKeys(int do_capture);
- void CaptureKey(TInt32 code, TInt32 scancode);
-
-private:
- COsmo4AppView* iAppView;
- CPlaylist *iPlaylist;
- int view_was_max;
- int smenu_id;
- char *m_title;
- /*current view mode*/
- int view_mode;
-
- KeyCapInfo keys[MAX_KEY_CAP];
- int nb_keys;
-};
-
-#endif // __OSMO4_UI_H__
-
-// End of File
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / Symbian GUI player
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-// INCLUDE FILES
-#include <coemain.h>
-#include <eikenv.h>
-
-#include "osmo4_view.h"
-#include "osmo4_ui.h"
-
-#include <gpac/options.h>
-/*for initial setup*/
-#include <gpac/modules/service.h>
-
-
-#if defined(__SERIES60_3X__)
-#define GPAC_CFG_DIR "\\private\\F01F9075\\"
-#define GPAC_MODULES_DIR "\\sys\\bin\\"
-#else
-#define GPAC_CFG_DIR "\\system\\apps\\Osmo4\\"
-#define GPAC_MODULES_DIR GPAC_CFG_DIR
-#endif
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// Cosmo4AppView::NewL()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppView* COsmo4AppView::NewL( const TRect& aRect )
-{
- COsmo4AppView* self = COsmo4AppView::NewLC( aRect );
- CleanupStack::Pop( self );
- return self;
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::NewLC()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppView* COsmo4AppView::NewLC( const TRect& aRect )
-{
- COsmo4AppView* self = new ( ELeave ) COsmo4AppView;
- CleanupStack::PushL( self );
- self->ConstructL( aRect );
- return self;
-}
-
-
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::COsmo4AppView()
-// C++ default constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppView::COsmo4AppView()
-{
- // No implementation required
- m_pTimer = NULL;
-#ifndef GPAC_GUI_ONLY
- memset(&m_user, 0, sizeof(GF_User));
- m_term = NULL;
- m_mx = NULL;
- memset(&m_rti, 0, sizeof(GF_SystemRTInfo));
-#endif
- last_title_update = 0;
- show_rti = 0;
-#if defined(__SERIES60_3X__)
- selector = NULL;
- target = NULL;
-#endif
-}
-
-
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::~COsmo4AppView()
-// Destructor.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppView::~COsmo4AppView()
-{
- Shutdown();
-#ifndef GPAC_GUI_ONLY
- if (m_mx) gf_mx_del(m_mx);
-#endif
-
-#if defined(__SERIES60_3X__)
- if (selector) delete selector;
- //if (target) delete target;
-#endif
-}
-
-void COsmo4AppView::Shutdown()
-{
-// MessageBox("Osmo4 shutdown request", "");
- if (m_pTimer) {
- m_pTimer->Cancel();
- delete m_pTimer;
- m_pTimer = NULL;
- }
-#ifndef GPAC_GUI_ONLY
- if (m_term) {
- GF_Terminal *t = m_term;
- m_term = NULL;
- gf_term_del(t);
- }
- if (m_Logs) {
- gf_fclose(m_Logs);
- m_Logs = NULL;
- }
- if (m_user.config) {
- gf_cfg_del(m_user.config);
- m_user.config = NULL;
- }
- if (m_user.modules) {
- gf_modules_del(m_user.modules);
- m_user.modules = NULL;
- }
-#endif
-// MessageBox("Osmo4 shutdown OK", "");
-}
-
-void COsmo4AppView::MessageBox(const char *text, const char *title)
-{
- HBufC *msg1, *msg2;
- TInt length = User::StringLength( ( TUint8* ) text) + 1;
- msg1 = HBufC::NewL( length );
- msg1->Des().Copy( TPtrC8(( TText8* ) text) );
-
- length = User::StringLength( ( TUint8* ) title) + 1;
- msg2 = HBufC::NewL( length );
- msg2->Des().Copy( TPtrC8(( TText8* ) title) );
-
- CEikonEnv::Static()->InfoWinL(*msg2, *msg1);
- delete msg1;
- delete msg2;
-}
-
-TInt myTick(TAny* aObject)
-{
- return ((COsmo4AppView*)aObject)->OnTick();
-}
-
-TInt COsmo4AppView::OnTick()
-{
-#ifndef GPAC_GUI_ONLY
- if (m_term) gf_term_process_step(m_term);
-
- /*check RTI display*/
- if (show_rti && gf_sys_get_rti(500, &m_rti, 0)) DisplayRTI();
-#endif
- /*never stop...*/
- return 1;
-}
-
-void COsmo4AppView::DisplayRTI()
-{
-#ifndef GPAC_GUI_ONLY
- COsmo4AppUi *app = (COsmo4AppUi *) CEikonEnv::Static()->AppUi();
- char szInfo[20];
- sprintf(szInfo, "CPU %02d FPS %02.2f", m_rti.process_cpu_usage, gf_term_get_framerate(m_term, 0));
- app->SetInfo(szInfo);
-#endif
-}
-
-
-//GPAC log function
-static void on_gpac_log(void *cbk, GF_LOG_Level ll, GF_LOG_Tool lm, const char *fmt, va_list list)
-{
- char szMsg[2048];
- COsmo4AppView *app = (COsmo4AppView *)cbk;
-
-#ifndef GPAC_GUI_ONLY
- gf_mx_p(app->m_mx);
- if (app->m_Logs) {
- vfprintf(app->m_Logs, fmt, list);
- } else {
- vsnprintf(szMsg, 2048, fmt, list);
- app->MessageBox(szMsg, "Error:");
- }
- gf_mx_v(app->m_mx);
-#endif
-}
-
-static Bool GPAC_EventProc(void *ptr, GF_Event *evt)
-{
- COsmo4AppView *app = (COsmo4AppView *)ptr;
- return app->EventProc(evt);
-}
-
-Bool COsmo4AppView::EventProc(GF_Event *evt)
-{
- TRect r;
-
-#ifndef GPAC_GUI_ONLY
- switch (evt->type) {
- case GF_EVENT_MESSAGE:
- if (!evt->message.message) return 0;
- if (evt->message.error) {
- char err[1024];
- sprintf(err, "Error: %s", gf_error_to_string(evt->message.error));
- MessageBox(evt->message.message, err);
- } else {
- MessageBox(evt->message.message, "Info");
- }
- break;
- case GF_EVENT_SCENE_SIZE:
- r = Rect();
- gf_term_set_size(m_term, r.Width(), r.Height());
- break;
- }
-#endif
- return 0;
-}
-
-void COsmo4AppView::SetupLogs()
-{
- const char *opt;
-
-#ifndef GPAC_GUI_ONLY
- gf_mx_p(m_mx);
- if (do_log) {
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_NONE);
- do_log = 0;
- }
- /*setup GPAC logs: log all errors*/
- opt = gf_cfg_get_key(m_user.config, "General", "Logs");
- if (opt && !strstr(opt, "none")) {
- const char *filename = gf_cfg_get_key(m_user.config, "General", "LogFile");
- if (!filename) {
- gf_cfg_set_key(m_user.config, "General", "LogFile", "\\data\\gpac_logs.txt");
- filename = "\\data\\gpac_logs.txt";
- }
- m_Logs = gf_fopen(filename, "wt");
- if (!m_Logs) {
- MessageBox("Cannot open log file - disabling logs", "Warning !");
- } else {
- MessageBox("Debug logs enabled!", filename);
- do_log = 1;
- gf_log_set_tools_levels( opt );
- }
- }
- if (!do_log) {
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_ERROR);
- if (m_Logs) gf_fclose(m_Logs);
- }
-
- gf_log_set_callback(this, on_gpac_log);
- gf_mx_v(m_mx);
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_CORE, ("Osmo4 logs initialized\n"));
-#endif
-}
-
-
-static void Osmo4_progress_cbk(void *usr, char *title, u32 done, u32 total)
-{
-#ifndef GPAC_GUI_ONLY
- COsmo4AppView *view = (COsmo4AppView *) usr;
- COsmo4AppUi *app = (COsmo4AppUi *) CEikonEnv::Static()->AppUi();
-
- if (done==total) {
- app->SetInfo(NULL);
- } else if (view->last_title_update + 500 < gf_sys_clock()) {
- char szName[1024];
- view->last_title_update = gf_sys_clock();
- sprintf(szName, "%s %02d %%", title, (done*100 / total) );
- app->SetInfo(szName);
- }
-#endif
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppView::ConstructL( const TRect& aRect )
-{
- const char *opt;
- Bool first_launch = 0;
-
-#if defined(__SERIES60_3X__)
- selector = CRemConInterfaceSelector::NewL();
- target = CRemConCoreApiTarget::NewL(*selector, *this);
- selector->OpenTargetL();
-#endif
-
- // Create a window for this application view
- CreateWindowL();
- // Set the windows size
- SetRect( aRect );
- //draw
- ActivateL();
-
-#ifndef GPAC_GUI_ONLY
- m_window = Window();
- m_session = CEikonEnv::Static()->WsSession();
-
- m_mx = gf_mx_new("Osmo4");
-
- //load config file
- m_user.config = gf_cfg_init(NULL, &first_launch);
- if (!m_user.config) {
- MessageBox("Cannot create GPAC Config file", "Fatal Error");
- User::Leave(KErrGeneral);
- }
- if (first_launch) {
- MessageBox("Osmo4", "Thank you for Installing");
- }
-
- /*load modules*/
- opt = gf_cfg_get_key(m_user.config, "Core", "ModulesDirectory");
- m_user.modules = gf_modules_new(opt, m_user.config);
- if (!m_user.modules || !gf_modules_get_count(m_user.modules)) {
- MessageBox(m_user.modules ? "No modules available" : "Cannot create module manager", "Fatal Error");
- if (m_user.modules) gf_modules_del(m_user.modules);
- gf_cfg_del(m_user.config);
- User::Leave(KErrGeneral);
- }
-
- if (first_launch) {
- /*first launch, register all files ext*/
- for (u32 i=0; i<gf_modules_get_count(m_user.modules); i++) {
- GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(m_user.modules, i, GF_NET_CLIENT_INTERFACE);
- if (!ifce) continue;
- if (ifce) {
- ifce->CanHandleURL(ifce, "test.test");
- gf_modules_close_interface((GF_BaseInterface *)ifce);
- }
- }
- }
-
- /*we don't thread the terminal, ie appart from the audio renderer, media decoding and visual rendering is
- handled by the app process*/
- m_user.init_flags = GF_TERM_NO_REGULATION;
- m_user.EventProc = GPAC_EventProc;
- m_user.opaque = this;
- m_user.os_window_handler = (void *) &m_window;
- m_user.os_display = (void *) &m_session;
-
- m_term = gf_term_new(&m_user);
- if (!m_term) {
- MessageBox("Cannot load GPAC terminal", "Fatal Error");
- gf_modules_del(m_user.modules);
- gf_cfg_del(m_user.config);
- User::Leave(KErrGeneral);
- }
- //MessageBox("GPAC terminal loaded", "Success !");
-
- /*ok set output size*/
- TSize s = m_window.Size();
- gf_term_set_size(m_term, s.iWidth, s.iHeight);
-
-
- /*start our callback (every ms)*/
- const TInt KTickInterval = 33000;
- m_pTimer = CPeriodic::NewL(CActive::EPriorityStandard);
- m_pTimer->Start(KTickInterval, KTickInterval, TCallBack(myTick, this));
-
- opt = gf_cfg_get_key(m_user.config, "General", "StartupFile");
- if (opt) gf_term_connect(m_term, opt);
-
-#endif
-
-}
-
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::Draw()
-// Draws the display.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppView::Draw( const TRect& /*aRect*/ ) const
-{
-#ifndef GPAC_GUI_ONLY
- if (!m_term) {
- CWindowGc& gc = SystemGc();
- TRgb black(0,0,0);
- gc.SetBrushColor(black);
- gc.Clear();
- } else {
- /*FIXME - this is just to force a screen flush, needs rework*/
- gf_term_set_option(m_term, GF_OPT_FREEZE_DISPLAY, 0);
- }
-#else
- CWindowGc& gc = SystemGc();
- TRgb black(0,0,0);
- TRect rect = Rect();
- gc.SetBrushColor(black);
- gc.Clear(rect);
-#endif
-}
-
-void COsmo4AppView::ShowHide(Bool show)
-{
-#ifndef GPAC_GUI_ONLY
- if (show) {
- MakeVisible(ETrue);
- if (m_term) {
- gf_term_set_option(m_term, GF_OPT_VISIBLE, 1);
- DrawDeferred();
- }
- } else {
- MakeVisible(EFalse);
- if (m_term) gf_term_set_option(m_term, GF_OPT_VISIBLE, 0);
- }
-#else
- MakeVisible(ETrue);
-#endif
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::SizeChanged()
-// Called by framework when the view size is changed.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppView::SizeChanged()
-{
-#ifndef GPAC_GUI_ONLY
- if (m_term) {
- TSize s = m_window.Size();
- gf_term_set_size(m_term, s.iWidth, s.iHeight);
- }
-#endif
- DrawNow();
-}
-
-void COsmo4AppView::Connect(const char *url)
-{
-#ifndef GPAC_GUI_ONLY
- char the_url[1024];
- /*copy before removing from recent files*/
- strcpy(the_url, url);
- gf_cfg_set_key(m_user.config, "RecentFiles", the_url, NULL);
- gf_cfg_insert_key(m_user.config, "RecentFiles", the_url, "", 0);
- u32 count = gf_cfg_get_key_count(m_user.config, "RecentFiles");
- if (count > 10) gf_cfg_set_key(m_user.config, "RecentFiles", gf_cfg_get_key_name(m_user.config, "RecentFiles", count-1), NULL);
-
- if (m_term) gf_term_connect(m_term, the_url);
-#endif
-}
-
-
-TKeyResponse COsmo4AppView::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-{
- GF_Event evt;
- u32 ret;
-
- evt.key.hw_code = aKeyEvent.iScanCode;
- evt.key.flags = 0;
- switch (aType) {
- case EEventKeyUp:
- evt.type = GF_EVENT_KEYUP;
- break;
- case EEventKeyDown:
- case EEventKey:
- evt.type = GF_EVENT_KEYDOWN;
- break;
- default:
- return EKeyWasNotConsumed;
- }
-
- switch (aKeyEvent.iCode) {
- case EKeyLeftArrow:
- evt.key.key_code = GF_KEY_LEFT;
- break;
- case EKeyRightArrow:
- evt.key.key_code = GF_KEY_RIGHT;
- break;
- case EKeyUpArrow:
- evt.key.key_code = GF_KEY_UP;
- break;
- case EKeyDownArrow:
- evt.key.key_code = GF_KEY_DOWN;
- break;
- case EKeyIncVolume:
- evt.key.key_code = GF_KEY_VOLUMEUP;
- break;
- case EKeyDecVolume:
- evt.key.key_code = GF_KEY_VOLUMEDOWN;
- break;
- default:
- switch (aKeyEvent.iScanCode) {
- case EStdKeyIncVolume:
- evt.key.key_code = GF_KEY_VOLUMEUP;
- break;
- case EStdKeyDecVolume:
- evt.key.key_code = GF_KEY_VOLUMEDOWN;
- break;
- default:
- return EKeyWasNotConsumed;
- }
- }
-#ifndef GPAC_GUI_ONLY
- ret = gf_term_user_event(m_term, &evt);
- /*generate a key up*/
- if (aType==EEventKey) {
- evt.type = GF_EVENT_KEYUP;
- ret += gf_term_user_event(m_term, &evt);
- }
-#else
- ret = 0;
-#endif
- return ret ? EKeyWasConsumed : EKeyWasNotConsumed;
-}
-
-#if defined(__SERIES60_3X__)
-void COsmo4AppView::MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct)
-{
- GF_Event e;
- switch (aOperationId) {
- /*
- TRequestStatus status;
- case ERemConCoreApiPausePlayFunction:
- case ERemConCoreApiStop:
- case ERemConCoreApiRewind:
- case ERemConCoreApiForward:
- case ERemConCoreApiFastForward:
- case ERemConCoreApiBackward:
- switch (aButtonAct) {
- case ERemConCoreApiButtonPress:
- break;
- case ERemConCoreApiButtonRelease:
- break;
- case ERemConCoreApiButtonClick:
- break;
- default:
- break;
- }
- */
- case ERemConCoreApiVolumeUp:
- case ERemConCoreApiVolumeDown:
-#ifndef GPAC_GUI_ONLY
- e.key.hw_code = 0;
- e.key.flags = 0;
- e.key.key_code = (aOperationId==ERemConCoreApiVolumeUp) ? GF_KEY_VOLUMEUP : GF_KEY_VOLUMEDOWN;
- switch (aButtonAct) {
- case ERemConCoreApiButtonPress:
- e.type = GF_EVENT_KEYDOWN;
- gf_term_user_event(m_term, &e);
- break;
- case ERemConCoreApiButtonRelease:
- e.type = GF_EVENT_KEYUP;
- gf_term_user_event(m_term, &e);
- break;
- default:
- e.type = GF_EVENT_KEYDOWN;
- gf_term_user_event(m_term, &e);
- e.type = GF_EVENT_KEYUP;
- gf_term_user_event(m_term, &e);
- break;
- }
-#endif
- break;
- default:
- break;
- }
-}
-
-#endif
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / Symbian GUI player
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#ifndef __OSMO4_VIEW_H__
-#define __OSMO4_VIEW_H__
-
-// INCLUDES
-#include <coecntrl.h>
-
-#if defined(__SERIES60_3X__)
-#include <remconcoreapitargetobserver.h>
-#include <remconcoreapitarget.h>
-#include <remconinterfaceselector.h>
-#endif
-
-
-#include <gpac/terminal.h>
-#include <gpac/thread.h>
-
-
-// CLASS DECLARATION
-class COsmo4AppView : public CCoeControl
-#if defined(__SERIES60_3X__)
- ,MRemConCoreApiTargetObserver
-#endif
-
-{
-public: // New methods
-
- /**
- * NewL.
- * Two-phased constructor.
- * Create a COsmo4AppView object, which will draw itself to aRect.
- * @param aRect The rectangle this view will be drawn to.
- * @return a pointer to the created instance of COsmo4AppView.
- */
- static COsmo4AppView* NewL( const TRect& aRect );
-
- /**
- * NewLC.
- * Two-phased constructor.
- * Create a COsmo4AppView object, which will draw itself
- * to aRect.
- * @param aRect Rectangle this view will be drawn to.
- * @return A pointer to the created instance of COsmo4AppView.
- */
- static COsmo4AppView* NewLC( const TRect& aRect );
-
- /**
- * ~COsmo4AppView
- * Virtual Destructor.
- */
- virtual ~COsmo4AppView();
-
-public: // Functions from base classes
-
- /**
- * From CCoeControl, Draw
- * Draw this COsmo4AppView to the screen.
- * @param aRect the rectangle of this view that needs updating
- */
- void Draw( const TRect& aRect ) const;
-
- /**
- * From CoeControl, SizeChanged.
- * Called by framework when the view size is changed.
- */
- virtual void SizeChanged();
-
-#ifndef GPAC_GUI_ONLY
- GF_User *GetUser() {
- return &m_user;
- }
-#else
- GF_User *GetUser() {
- return NULL;
- }
-#endif
- void SetupLogs();
- void MessageBox(const char *text, const char *title);
-
- virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-
-#if defined(__SERIES60_3X__)
- void MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct);
-#endif
-
- TInt OnTick();
-
- void Shutdown();
-
- void Connect(const char *url);
- void ShowHide(Bool show);
- Bool EventProc(GF_Event *evt);
-
-#ifndef GPAC_GUI_ONLY
- GF_Terminal *m_term;
-#endif
-
-private: // Constructors
-
- /**
- * ConstructL
- * 2nd phase constructor.
- * Perform the second phase construction of a
- * COsmo4AppView object.
- * @param aRect The rectangle this view will be drawn to.
- */
- void ConstructL(const TRect& aRect);
-
- void DisplayRTI();
-
- /**
- * COsmo4AppView.
- * C++ default constructor.
- */
- COsmo4AppView();
-
- CPeriodic *m_pTimer;
-
- RWindow m_window;
- RWsSession m_session;
-#ifndef GPAC_GUI_ONLY
- GF_SystemRTInfo m_rti;
-#endif
-
-#if defined(__SERIES60_3X__)
- CRemConInterfaceSelector *selector;
- CRemConCoreApiTarget *target;
-#endif
-
-
-public:
- u32 last_title_update;
- FILE *m_Logs;
- Bool do_log;
- Bool show_rti;
-#ifndef GPAC_GUI_ONLY
- GF_Mutex *m_mx;
- GF_User m_user;
-#endif
-};
-
-
-#endif // __OSMO4_VIEW_H__
-
-// End of File
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / Symbian GUI player
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <eiktxlbx.h>
-#include <eiktxlbm.h>
-
-
-#include <gpac/utf.h>
-
-// INCLUDE FILES
-#include "osmo4_ui.h"
-#include "playlist.h"
-
-#ifdef USE_SKIN
-#include <aknlists.h>
-#include <akntabgrp.h>
-#include <AknsDrawUtils.h>// skin
-#include <AknsBasicBackgroundControlContext.h> //skin
-#endif
-
-
-CPlaylist::CPlaylist()
-{
- playlist_mode = 0;
- view_all_files = 0;
-}
-CPlaylist::~CPlaylist()
-{
- delete iListBox;
- delete iBackGround;
-}
-
-CPlaylist* CPlaylist::NewL( const TRect& aRect, GF_User *user)
-{
- CPlaylist* self = CPlaylist::NewLC( aRect, user);
- CleanupStack::Pop( self );
- return self;
-}
-CPlaylist* CPlaylist::NewLC( const TRect& aRect, GF_User *user)
-{
- CPlaylist* self = new ( ELeave ) CPlaylist;
- CleanupStack::PushL( self );
- self->ConstructL( aRect, user);
- return self;
-}
-
-void CPlaylist::ConstructL(const TRect& aRect, GF_User *user)
-{
- CreateWindowL();
-
-#ifdef USE_SKIN
- iListBox = new (ELeave) CAknSingleStyleListBox();
-#else
- iListBox = new (ELeave) CEikTextListBox();
-#endif
- iListBox->ConstructL(this);
- iListBox->SetContainerWindowL(*this);
- iListBox->SetListBoxObserver(this);
-
- CDesCArray* textArray = new (ELeave) CDesCArrayFlat(16);
- iListBox->Model()->SetItemTextArray( textArray );
- iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-
- // Creates scrollbar.
- iListBox->CreateScrollBarFrameL( ETrue );
- iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto);
- //iListBox->ActivateL();
-
- iListBox->SetFocus(ETrue);
-
- SetRect(aRect);
- ActivateL();
- MakeVisible(EFalse);
-
- strcpy(szCurrentDir, "");
-
-#ifndef GPAC_GUI_ONLY
- m_user = user;
-
- strcpy(ext_list, "");
- u32 count = gf_cfg_get_key_count(user->config, "MimeTypes");
- for (u32 i=0; i<count; i++) {
- char szKeyList[1000], *sKey;
- const char *sMime = gf_cfg_get_key_name(user->config, "MimeTypes", i);
- const char *opt = gf_cfg_get_key(user->config, "MimeTypes", sMime);
- strcpy(szKeyList, opt+1);
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- sKey[0] = 0;
- strcat(ext_list, szKeyList);
- strcat(ext_list, " ");
- }
-
- const char *opt = gf_cfg_get_key(m_user->config, "General", "LastWorkingDir");
- if (opt) strcpy(szCurrentDir, opt);
-#endif
-
-}
-
-void CPlaylist::SizeChanged()
-{
- iListBox->SetRect( Rect() );
-}
-
-void CPlaylist::Draw(const TRect& aRect) const
-{
-#ifdef USE_SKIN
- CWindowGc& gc = SystemGc();
- MAknsSkinInstance* skin = AknsUtils::SkinInstance();
- MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
- AknsDrawUtils::Background( skin, cc, this, gc, aRect );
-#endif
-
-}
-
-#ifdef USE_SKIN
-TTypeUid::Ptr CPlaylist::MopSupplyObject(TTypeUid aId)
-{
- if(aId.iUid == MAknsControlContext::ETypeId && iBackGround) {
- return MAknsControlContext::SupplyMopObject( aId, iBackGround);
- }
- return CCoeControl::MopSupplyObject( aId );
-}
-#endif
-
-
-TInt CPlaylist::CountComponentControls() const
-{
- return 1;
-}
-CCoeControl* CPlaylist::ComponentControl(TInt aIndex) const
-{
- switch (aIndex) {
- case 0:
- return iListBox;
- default:
- return NULL;
- }
-}
-
-TKeyResponse CPlaylist::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-{
- if (aType != EEventKey) return iListBox->OfferKeyEventL(aKeyEvent, aType);
-
- switch (aKeyEvent.iScanCode) {
- case EStdKeyEnter:
- HandleSelection();
- return EKeyWasConsumed;
- default:
- return iListBox->OfferKeyEventL(aKeyEvent, aType);
- }
-}
-void CPlaylist::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType )
-{
- if (aEventType == MEikListBoxObserver::EEventItemClicked ||
- aEventType == MEikListBoxObserver::EEventEnterKeyPressed)
-
- HandleSelection();
-}
-
-void CPlaylist::ShowHide(Bool show)
-{
- if (show) {
- RefreshPlaylist();
- MakeVisible(ETrue);
- DrawNow();
- } else {
- /*cleanup*/
- ResetView();
- MakeVisible(EFalse);
- ((COsmo4AppUi *) CEikonEnv::Static()->AppUi())->SetTitle(NULL, 0);
- }
-}
-
-
-void CPlaylist::FlushItemList()
-{
- iListBox->HandleItemAdditionL();
- iListBox->SetCurrentItemIndexAndDraw(0);
-}
-
-void CPlaylist::ResetView()
-{
- CDesCArray* array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
- array->Reset();
- iListBox->Reset();
-}
-
-void CPlaylist::AddItem(const char *name, int is_directory)
-{
- TBuf<100> tmp;
- char szName[100];
- CDesCArray* array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
-
- if (is_directory) {
-#ifdef USE_SKIN
- sprintf(szName, "\t+ %s\t\t", name);
-#else
- sprintf(szName, "+ %s", name);
-#endif
- } else {
-#ifdef USE_SKIN
- sprintf(szName, "\t%s\t\t", name);
-#else
- strcpy(szName, name);
-#endif
- }
- tmp.SetLength(strlen(szName)+1);
- tmp.Copy( TPtrC8(( TText8* ) szName) );
- tmp.ZeroTerminate();
- array->AppendL(tmp);
-}
-
-static Bool enum_dirs(void *cbk, char *name, char *path, GF_FileEnumInfo *file_info)
-{
- CPlaylist *of = (CPlaylist *)cbk;
- of->AddItem(name, 1);
- return 0;
-}
-
-static Bool enum_files(void *cbk, char *name, char *path, GF_FileEnumInfo *file_info)
-{
- CPlaylist *of = (CPlaylist *)cbk;
- of->AddItem(name, 0);
- return 0;
-}
-
-
-void CPlaylist::ScanDirectory(const char *dir)
-{
- ResetView();
-
- if (!dir || !strlen(dir)) {
- RFs iFs;
- TDriveList aList;
- iFs.Connect();
- iFs.DriveList(aList);
- for (TInt i=0; i<KMaxDrives; i++) {
- if (aList[i]) {
- TChar aDrive;
- iFs.DriveToChar(i, aDrive);
- sprintf(szCurrentDir, "%c:", (TUint)aDrive);
- AddItem(szCurrentDir, 0);
- }
- }
- iFs.Close();
- FlushItemList();
- strcpy(szCurrentDir, "");
- return;
- } else {
- strcpy(szCurrentDir, dir);
- AddItem("..", 1);
- }
-
-#ifndef GPAC_GUI_ONLY
- gf_enum_directory((const char *) szCurrentDir, 1, enum_dirs, this, NULL);
- gf_enum_directory((char *) szCurrentDir, 0, enum_files, this, view_all_files ? NULL : ext_list);
-#endif
- FlushItemList();
-
- ((COsmo4AppUi *) CEikonEnv::Static()->AppUi())->SetTitle(szCurrentDir, 0);
-
-}
-
-void CPlaylist::GetSelectionName(char *szName)
-{
- CDesCArray* array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
- TInt idx = iListBox->CurrentItemIndex();
-
-#ifndef GPAC_GUI_ONLY
-
-#if defined(_UNICODE)
- size_t len;
- /*handle terminating zero !!*/
- u16 szNameUTF16[100];
- len = (*array)[idx].Size();
- memcpy(szNameUTF16, (*array)[idx].Ptr(), sizeof(u8)*len);
- szNameUTF16[len/2] = 0;
- const u16 *sptr = szNameUTF16;
-
- /*skip initial '\t'*/
-#ifdef USE_SKIN
- sptr += 1;
-#endif
-
- len = gf_utf8_wcstombs(szName, 512, &sptr);
- szName[len] = 0;
-
-
-#else
-
- char *src = (*array)[idx]).Ptr();
- /*skip initial '\t'*/
-#ifdef USE_SKIN
- src += 1;
-#endif
- strcpy(szName, (const char *) src) ;
-#endif
-
- /*remove trailing "\t\t"*/
-#ifdef USE_SKIN
- len = strlen(szName);
- szName[len-2] = 0;
-#endif
-
-#else
- szName[0] = 0;
-#endif
-
-}
-
-void CPlaylist::HandleSelection()
-{
- char szName[100];
- GetSelectionName(szName);
-
- /*sub-directory*/
- if ((szName[0] == '+') && (szName[1] == ' ')) {
- /*browse up*/
- if ((szName[2] == '.') && (szName[3] == '.')) {
- char *prev = strrchr(szCurrentDir, '\\');
- if (prev) {
- prev[0] = 0;
- ScanDirectory(szCurrentDir);
- } else {
- ScanDirectory(NULL);
- }
- } else {
- strcat(szCurrentDir, "\\");
- strcat(szCurrentDir, szName+2);
- ScanDirectory(szCurrentDir);
- }
- } else if (szName[1] == ':') {
- ScanDirectory(szName);
- } else {
- char szURL[1024];
- COsmo4AppUi *app = (COsmo4AppUi *) CEikonEnv::Static()->AppUi();
- if (playlist_mode) {
- TInt idx = iListBox->CurrentItemIndex();
-#ifndef GPAC_GUI_ONLY
- const char *url = gf_cfg_get_key_name(m_user->config, "Playlist", idx);
- if (url) app->PlayURL(url);
-#endif
- } else {
- gf_cfg_set_key(m_user->config, "General", "LastWorkingDir", (const char *) szCurrentDir);
- sprintf(szURL, "%s\\%s", szCurrentDir, szName);
- app->PlayURL(szURL);
- }
- }
-}
-
-Bool CPlaylist::SelectionIsFile()
-{
- char szName[100];
- GetSelectionName(szName);
- if ((szName[0] == '+') && (szName[1] == ' ')) return 0;
- else if (szName[1] == ':') return 0;
- return 1;
-}
-
-Bool CPlaylist::IsInPlaylist()
-{
- char szURL[1024];
- char szName[100];
- GetSelectionName(szName);
- if ((szName[0] == '+') && (szName[1] == ' ')) return 0;
- else if (szName[1] == ':') return 0;
-
- /*remove from playlist*/
- sprintf(szURL, "%s\\%s", szCurrentDir, szName);
-#ifndef GPAC_GUI_ONLY
- const char *opt = gf_cfg_get_key(m_user->config, "Playlist", szURL);
- if (opt) return 1;
-#endif
- return 0;
-}
-
-static Bool dir_add_files(void *cbk, char *name, char *path, GF_FileEnumInfo *file_info)
-{
- CPlaylist *pl = (CPlaylist *)cbk;
-
-#if 0
- if (!bViewUnknownTypes && extension_list) {
- char *ext = strrchr(name, '.');
- if (!ext || !strstr(extension_list, ext+1)) return 0;
- }
-#endif
-
-#ifndef GPAC_GUI_ONLY
- gf_cfg_set_key(pl->m_user->config, "Playlist", path, "");
-#endif
-
- return 0;
-}
-
-
-void CPlaylist::RefreshPlaylist()
-{
- if (playlist_mode) {
-#ifndef GPAC_GUI_ONLY
- u32 count = gf_cfg_get_key_count(m_user->config, "Playlist");
- ResetView();
- for (u32 i=0; i<count; i++) {
- const char *opt = gf_cfg_get_key_name(m_user->config, "Playlist", i);
- const char *sep = strrchr(opt, '\\');
- if (!sep) sep = strrchr(opt, '/');
- AddItem(sep ? (sep+1) : opt, 0);
- }
- if (!count) AddItem("[empty]", 0);
-#endif
- FlushItemList();
-
- ((COsmo4AppUi *) CEikonEnv::Static()->AppUi())->SetTitle("Playlist", 0);
- } else {
- ScanDirectory(szCurrentDir);
- }
-}
-
-
-void CPlaylist::PlaylistAct(Osmo4_PLActions act)
-{
- char szURL[1024];
- char szName[100];
- CDesCArray*array;
- TInt idx;
- TInt count;
-
- if (act==Osmo4PLClear) {
- while (1) {
-#ifndef GPAC_GUI_ONLY
- const char *opt = gf_cfg_get_key_name(m_user->config, "Playlist", 0);
- if (!opt) break;
- gf_cfg_set_key(m_user->config, "Playlist", opt, NULL);
-#endif
- }
- RefreshPlaylist();
- return;
- } else if (act == Osmo4PLToggleMode) {
- playlist_mode = !playlist_mode;
- RefreshPlaylist();
- return;
- } else if (act == Osmo4PLToggleAllFiles) {
- view_all_files = !view_all_files;
- RefreshPlaylist();
- return;
- } else if (act == Osmo4PLAdd) {
-#ifndef GPAC_GUI_ONLY
- GetSelectionName(szName);
- if ((szName[0] == '+') && (szName[1] == ' ')) {
- if ((szName[2] != '.') && (szName[3] != '.')) {
- sprintf(szURL, "%s\\%s", szCurrentDir, szName+2);
- gf_enum_directory(szURL, 0, dir_add_files, this, view_all_files ? NULL : ext_list);
- }
- } else if (szName[1] == ':') {
- gf_enum_directory(szName, 0, dir_add_files, this, view_all_files ? NULL : ext_list);
- } else {
- sprintf(szURL, "%s\\%s", szCurrentDir, szName);
- gf_cfg_set_key(m_user->config, "Playlist", szURL, "");
- }
-#endif
- return;
- }
-
- GetSelectionName(szName);
- if ((szName[0] == '+') && (szName[1] == ' ')) return;
- else if (szName[1] == ':') return;
-
- switch (act) {
- /*remove from playlist*/
- case Osmo4PLRem:
-#ifndef GPAC_GUI_ONLY
- sprintf(szURL, "%s\\%s", szCurrentDir, szName);
- gf_cfg_set_key(m_user->config, "Playlist", szURL, NULL);
-#endif
- RefreshPlaylist();
- break;
- /*move up*/
- case Osmo4PLMoveUp:
- array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
- count = array->Count();
- idx = iListBox->CurrentItemIndex();
- sprintf(szURL, "%s\\%s", szCurrentDir, szName);
-#ifndef GPAC_GUI_ONLY
- gf_cfg_set_key(m_user->config, "Playlist", szURL, NULL);
- gf_cfg_insert_key(m_user->config, "Playlist", szURL, "", idx-1);
-#endif
- RefreshPlaylist();
- if (idx>1) iListBox->SetCurrentItemIndexAndDraw(idx-1);
- break;
- /*move down*/
- case Osmo4PLMoveDown:
- array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
- count = array->Count();
- idx = iListBox->CurrentItemIndex();
- sprintf(szURL, "%s\\%s", szCurrentDir, szName);
-#ifndef GPAC_GUI_ONLY
- gf_cfg_set_key(m_user->config, "Playlist", szURL, NULL);
- gf_cfg_insert_key(m_user->config, "Playlist", szURL, "", idx+1);
-#endif
- RefreshPlaylist();
- if (idx<count-1) iListBox->SetCurrentItemIndexAndDraw(idx+1);
- break;
- default:
- break;
- }
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / Symbian GUI player
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef __osmo4playlist_H__
-#define __osmo4playlist_H__
-
-#include <e32base.h>
-#include <coecntrl.h>
-#include <eiklbo.h>
-
-#define USE_SKIN
-
-#ifdef USE_SKIN
-class MAknsControlContext; // for skins support
-#endif
-
-
-#include <gpac/user.h>
-
-class CEikTextListBox; //For list box
-
-enum Osmo4_PLActions
-{
- Osmo4PLAdd = 0,
- Osmo4PLRem,
- Osmo4PLClear,
- Osmo4PLMoveUp,
- Osmo4PLMoveDown,
- Osmo4PLToggleMode,
- Osmo4PLToggleAllFiles,
-};
-
-class CPlaylist : public CCoeControl,MEikListBoxObserver
-{
-public:
- static CPlaylist* NewL( const TRect& aRect, GF_User *user);
- static CPlaylist* NewLC( const TRect& aRect, GF_User *user);
- virtual ~CPlaylist();
- void SizeChanged();
-
- virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-
- void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType );
-
- void AddItem(const char *name, int is_directory);
- TInt CountComponentControls() const;
- CCoeControl* ComponentControl(TInt aIndex) const;
- void Draw(const TRect& aRect) const;
-
- void ShowHide(Bool show);
- Bool SelectionIsFile();
- Bool IsInPlaylist();
- Bool PlaylistMode() {
- return playlist_mode;
- }
- Bool ViewAllFiles() {
- return view_all_files;
- }
-
- void PlaylistAct(Osmo4_PLActions act);
-
-#ifndef GPAC_GUI_ONLY
- GF_User *m_user;
-#endif
-
-private:
- void ConstructL(const TRect& aRect, GF_User *user);
- CPlaylist();
-
-
-#ifdef USE_SKIN
- TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
- MAknsControlContext* iBackGround;
-#endif
-
-
- void ResetView();
- void FlushItemList();
- void ScanDirectory(const char *dir);
- void HandleSelection();
- void GetSelectionName(char *name);
- void RefreshPlaylist();
-
- char szCurrentDir[1024];
- CEikTextListBox* iListBox;
- Bool playlist_mode;
- Bool view_all_files;
- char ext_list[4096];
-};
-
-#endif //__osmo4playlist_H__
-
+++ /dev/null
-#include <appinfo.rh>
-#include "osmo4_gen.rss"
-
-rls_string STRING_osmo_caption_string "Osmo4"
-
-RESOURCE LOCALISABLE_APP_INFO r_osmo4_localisable_app_info
- {
- short_caption = STRING_osmo_caption_string;
- caption_and_icon =
- CAPTION_AND_ICON_INFO
- {
- caption = STRING_osmo_caption_string;
-
- number_of_icons = 1;
- icon_file = "\\resource\\apps\\osmo4_aif.mif";
- };
- }
-
-// End of File
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 88 88">
-<g>
-<g>
-<rect fill="none" width="88" height="88"/>
-</g>
-
-<defs>
-<radialGradient id="grad1" fx="0.45" fy="0.2">
-<stop offset="0" stop-color="rgb(128, 128, 128)"/>
-<stop offset="1" stop-color="black"/>
-</radialGradient>
-<radialGradient id="grad2" fx="0.5" fy="0.5">
-<stop offset="0" stop-color="black"/>
-<stop offset="0.8" stop-color="rgb(128,0,0)"/>
-<stop offset="0.9" stop-color="rgb(255,0,0)"/>
-<stop offset="1" stop-color="rgb(128,0,0)"/>
-</radialGradient>
-</defs>
-
-<g transform="translate(1,1)">
-<circle fill="rgb(128, 128, 128)" cx="44" cy="54" r="20"/>
-<polygon fill="rgb(128, 128, 128)" points="44 34 64 14 24 14"/>
-<circle fill="none" stroke-width="8" stroke="rgb(128, 128, 128)" cx="44" cy="44" r="34"/>
-</g>
-
-<g>
-<circle fill="url(#grad1)" cx="44" cy="54" r="20"/>
-<polygon fill="black" points="44 34 64 14 24 14"/>
-<circle fill="none" stroke-width="8" stroke="red" cx="44" cy="44" r="34"/>
-</g>
-
-</g>
-</svg>
+++ /dev/null
-/* Copyright (c) 2004, Nokia. All rights reserved */
-
-
-// INCLUDES
-#include <apcaptionfile.rh>
-
-
-// RESOURCE DEFINITIONS
-// -----------------------------------------------------------------------------
-//
-// Caption data for Osmo4
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE CAPTION_DATA
- {
- caption="Osmo4";
- shortcaption= "Osmo4";
- }
-
-// End of File
+++ /dev/null
-/* Copyright (c) 2004, Nokia. All rights reserved */
-
-// RESOURCE IDENTIFIER
-NAME OSMO // 4 letter ID
-
-
-// INCLUDES
-#include <eikon.rh>
-#include <avkon.rh>
-#include <avkon.rsg>
-
-RESOURCE RSS_SIGNATURE
- {
- }
-
-RESOURCE TBUF r_default_document_name
- {
- buf="OSMO";
- }
-
-RESOURCE EIK_APP_INFO
- {
- menubar = r_Osmo4_menubar;
- cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
- }
-
-
-RESOURCE MENU_BAR r_Osmo4_menubar
- {
- titles =
- {
- MENU_TITLE { menu_pane = r_Osmo4_menu; }
- };
- }
-
-
-RESOURCE MENU_PANE r_Osmo4_menu
- {
- }
-
-RESOURCE MENU_PANE r_osmo4_sm1
- {
- }
-
-RESOURCE MENU_PANE r_osmo4_sm2
- {
- }
-
-RESOURCE MENU_PANE r_osmo4_sm3
- {
- }
-
-RESOURCE MENU_PANE r_osmo4_ssm1
- {
- }
-RESOURCE MENU_PANE r_osmo4_ssm2
- {
- }
-
+++ /dev/null
-/*
-* ==============================================================================
-* Name : osmo4_reg.rss
-* Part of : osmo4
-* Interface :
-* Description :
-* Version :
-*
-* Copyright (c) 2005-2006 Nokia Corporation.
-* This material, including documentation and any related
-* computer programs, is protected by copyright controlled by
-* Nokia Corporation.
-* ==============================================================================
-*/
-
-#include <appinfo.rh>
-#include <osmo4.rsg>
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0xF01F9075
-
-RESOURCE APP_REGISTRATION_INFO
- {
- app_file="Osmo4";
- localisable_resource_file = "\\resource\\apps\\Osmo4";
- localisable_resource_id = R_OSMO4_LOCALISABLE_APP_INFO;
-
- embeddability=KAppNotEmbeddable;
- newfile=KAppDoesNotSupportNewFile;
- }
-
+++ /dev/null
-// AddressBar.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "osmo4.h"
-#include "MainFrm.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// AddressBar dialog
-
-IMPLEMENT_DYNAMIC(CInitDialogBar, CDialogBar)
-
-BEGIN_MESSAGE_MAP(CInitDialogBar, CDialogBar)
-END_MESSAGE_MAP()
-
-
-CInitDialogBar::CInitDialogBar()
-{
-}
-
-CInitDialogBar::~CInitDialogBar()
-{
-}
-
-BOOL CInitDialogBar::Create(CWnd * pParentWnd, LPCTSTR lpszTemplateName, UINT nStyle, UINT nID)
-{
- if(!CDialogBar::Create(pParentWnd, lpszTemplateName, nStyle, nID))
- return FALSE;
-
- if (!OnInitDialog()) return FALSE;
-
- return TRUE;
-}
-
-BOOL CInitDialogBar::Create(CWnd * pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID)
-{
- if(!Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID)) return FALSE;
-
- if(!OnInitDialog()) return FALSE;
- return TRUE;
-}
-
-
-BOOL CInitDialogBar::OnInitDialog()
-{
- UpdateData(FALSE);
- return TRUE;
-}
-
-void CInitDialogBar::DoDataExchange(CDataExchange* pDX)
-{
- CDialogBar::DoDataExchange(pDX);
-}
-
-
-
-IMPLEMENT_DYNAMIC(AddressBar, CInitDialogBar)
-
-
-BEGIN_MESSAGE_MAP(AddressBar, CInitDialogBar)
- //{{AFX_MSG_MAP(AddressBar)
- ON_WM_SIZE()
- ON_WM_CLOSE()
- ON_CBN_SELENDOK(IDC_ADDRESS, OnSelendOK)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-AddressBar::AddressBar () : CInitDialogBar()
-{
-}
-
-BOOL AddressBar::OnInitDialog()
-{
- CInitDialogBar::OnInitDialog();
-
- return TRUE;
-}
-
-
-void AddressBar::DoDataExchange(CDataExchange* pDX)
-{
- CInitDialogBar::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(AddressBar)
- DDX_Control(pDX, IDC_DUMTXT, m_Title);
- DDX_Control(pDX, IDC_ADDRESS, m_Address);
- //}}AFX_DATA_MAP
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// AddressBar message handlers
-
-void AddressBar::OnSize(UINT nType, int cx, int cy)
-{
- u32 w;
- POINT pt;
- //CDialog::OnSize(nType, cx, cy);
-
- if (!m_Address.m_hWnd) return;
- RECT rc;
- m_Title.GetClientRect(&rc);
- w = rc.right - rc.left;
- m_Address.GetWindowRect(&rc);
- pt.x = rc.left;
- pt.y = rc.top;
- ScreenToClient(&pt);
- rc.right = cx - pt.x;
- m_Address.SetWindowPos(this, 0, 0, rc.right, rc.bottom, SWP_NOZORDER | SWP_NOMOVE);
-
-}
-
-void AddressBar::OnClose()
-{
-}
-
-void AddressBar::ReloadURLs()
-{
- Osmo4 *gpac = GetApp();
- u32 i=0;
-
- while (m_Address.GetCount()) m_Address.DeleteString(0);
- while (1) {
- const char *sOpt = gf_cfg_get_key_name(gpac->m_user.config, "RecentFiles", i);
- if (!sOpt) return;
- m_Address.AddString(sOpt);
- i++;
- }
-}
-
-void AddressBar::SelectionReady()
-{
- void UpdateLastFiles(GF_Config *cfg, const char *URL);
-
- CString URL;
- int sel = m_Address.GetCurSel();
- if (sel == CB_ERR) {
- m_Address.GetWindowText(URL);
- } else {
- m_Address.GetLBText(sel, URL);
- }
- if (!URL.GetLength()) return;
- Osmo4 *gpac = GetApp();
- Playlist *pl = ((CMainFrame*)gpac->m_pMainWnd)->m_pPlayList;
- /*don't store local files*/
- if (URL.Find("://", 0)>0) {
- UpdateLastFiles(gpac->m_user.config, URL);
- ReloadURLs();
- }
- pl->Truncate();
- pl->QueueURL(URL);
- pl->RefreshList();
- pl->PlayNext();
-}
-
-void AddressBar::OnSelendOK()
-{
- SelectionReady();
-}
-
-BOOL AddressBar::PreTranslateMessage(MSG* pMsg)
-{
- if (pMsg->message == WM_KEYDOWN) {
- switch (pMsg->wParam) {
- case VK_RETURN:
- ::TranslateMessage(pMsg);
- ::DispatchMessage(pMsg);
- SelectionReady();
- return TRUE;
- default:
- break;
- }
- }
- return CInitDialogBar::PreTranslateMessage(pMsg);
-}
-
+++ /dev/null
-#if !defined(AFX_ADDRESSBAR_H__B0764C99_5CC2_4412_8B1F_22E71BAD70F0__INCLUDED_)
-#define AFX_ADDRESSBAR_H__B0764C99_5CC2_4412_8B1F_22E71BAD70F0__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// AddressBar.h : header file
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-// AddressBar dialog
-
-class CInitDialogBar : public CDialogBar
-{
- DECLARE_DYNAMIC(CInitDialogBar)
-
-// Construction
-public:
- CInitDialogBar();
- virtual ~CInitDialogBar();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CInitDialogBar)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-public:
- virtual BOOL Create(CWnd * pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID);
- virtual BOOL Create(CWnd * pParentWnd, LPCTSTR lpszTemplateName, UINT nStyle, UINT nID);
-
-protected:
- virtual BOOL OnInitDialog();
-
-protected:
-
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// AddressBar dialog
-
-class AddressBar : public CInitDialogBar
-{
-
- DECLARE_DYNAMIC(AddressBar)
-
- // Construction
-public:
- AddressBar();
-
-// Dialog Data
- //{{AFX_DATA(AddressBar)
- enum { IDD = IDD_NAVBAR };
- CStatic m_Title;
- CComboBox m_Address;
- //}}AFX_DATA
-
- void ReloadURLs();
- void SelectionReady();
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(AddressBar)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- //virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(AddressBar)
- virtual BOOL OnInitDialog();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnClose();
- afx_msg void OnSelendOK();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_ADDRESSBAR_H__B0764C99_5CC2_4412_8B1F_22E71BAD70F0__INCLUDED_)
+++ /dev/null
-// FileProps.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "osmo4.h"
-#include "FileProps.h"
-#include "MainFrm.h"
-
-/*ISO 639 languages*/
-#include <gpac/iso639.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CFileProps dialog
-
-
-CFileProps::CFileProps(CWnd* pParent /*=NULL*/)
- : CDialog(CFileProps::IDD, pParent)
-{
- //{{AFX_DATA_INIT(CFileProps)
- //}}AFX_DATA_INIT
-}
-
-
-void CFileProps::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CFileProps)
- DDX_Control(pDX, IDC_VIEWSEL, m_ViewSel);
- DDX_Control(pDX, IDC_ODINFO, m_ODInfo);
- DDX_Control(pDX, IDC_ODTREE, m_ODTree);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CFileProps, CDialog)
- //{{AFX_MSG_MAP(CFileProps)
- ON_NOTIFY(TVN_SELCHANGED, IDC_ODTREE, OnSelchangedOdtree)
- ON_BN_CLICKED(IDC_WORLD, OnWorld)
- ON_BN_CLICKED(IDC_VIEWSG, OnViewsg)
- ON_WM_TIMER()
- ON_WM_CLOSE()
- ON_WM_DESTROY()
- ON_NOTIFY(TCN_SELCHANGE, IDC_VIEWSEL, OnSelchangeViewsel)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CFileProps message handlers
-
-
-#define FP_TIMER_ID 20
-
-BOOL CFileProps::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- char sText[5000];
- sprintf(sText, "%s Properties", ((CMainFrame*)GetApp()->m_pMainWnd)->m_pPlayList->GetDisplayName());
-
- SetWindowText(sText);
- current_odm = NULL;
-
- m_ViewSel.InsertItem(0, "General");
- m_ViewSel.InsertItem(1, "Streams");
- m_ViewSel.InsertItem(2, "Playback");
- m_ViewSel.InsertItem(3, "Network");
-
- m_ODTree.SetIndent(0);
- RewriteODTree();
- SetTimer(FP_TIMER_ID, 500, NULL);
-
- return TRUE;
-}
-
-
-void CFileProps::WriteInlineTree(GF_ObjectManager *root_od, HTREEITEM parent)
-{
- Osmo4 *gpac = GetApp();
-
- /*browse all ODs*/
- u32 count = gf_term_get_object_count(gpac->m_term, root_od);
-
- for (u32 i=0; i<count; i++) {
- GF_ObjectManager *odm = gf_term_get_object(gpac->m_term, root_od, i);
- if (!odm) return;
- HTREEITEM item = m_ODTree.InsertItem("Object Descriptor", 0, 0, parent);
- m_ODTree.SetItemData(item, (DWORD) odm);
- /*if inline propagate*/
- switch (gf_term_object_subscene_type(gpac->m_term, odm)) {
- case 1:
- m_ODTree.SetItemText(item, "Root Scene");
- WriteInlineTree(odm, item);
- break;
- case 2:
- m_ODTree.SetItemText(item, "Inline Scene");
- WriteInlineTree(odm, item);
- break;
- case 3:
- m_ODTree.SetItemText(item, "Extern Proto Lib");
- WriteInlineTree(odm, item);
- break;
- default:
- break;
- }
- }
-}
-
-void CFileProps::RewriteODTree()
-{
- Osmo4 *gpac = GetApp();
-
- m_ODTree.DeleteAllItems();
-
- GF_ObjectManager *root_odm = gf_term_get_root_object(gpac->m_term);
- if (!root_odm) return;
-
- HTREEITEM root = m_ODTree.InsertItem("Root OD", 0, 0);
- m_ODTree.SetItemData(root, (DWORD) root_odm);
-
- m_ODTree.SetItemText(root, "Root Scene");
- WriteInlineTree(root_odm, root);
-}
-
-void CFileProps::OnSelchangedOdtree(NMHDR* pNMHDR, LRESULT* pResult)
-{
- NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
- *pResult = 0;
-
- HTREEITEM item = m_ODTree.GetSelectedItem();
- GF_ObjectManager *odm = (GF_ObjectManager *) m_ODTree.GetItemData(item);
- if (!odm) return;
-
- SetInfo(odm);
-}
-
-
-void CFileProps::OnClose()
-{
- KillTimer(FP_TIMER_ID);
- DestroyWindow();
-}
-
-void CFileProps::OnDestroy()
-{
- CDialog::OnDestroy();
- delete this;
- ((CMainFrame *)GetApp()->m_pMainWnd)->m_pProps = NULL;
-}
-
-void CFileProps::OnSelchangeViewsel(NMHDR* pNMHDR, LRESULT* pResult)
-{
- SetInfo(current_odm);
- *pResult = 0;
-}
-
-void CFileProps::SetInfo(GF_ObjectManager *odm)
-{
- current_odm = odm;
- switch (m_ViewSel.GetCurSel()) {
- case 3:
- SetNetworkInfo();
- break;
- case 2:
- SetDecoderInfo();
- break;
- case 1:
- SetStreamsInfo();
- break;
- default:
- SetGeneralInfo();
- break;
- }
-}
-
-void CFileProps::OnTimer(UINT_PTR nIDEvent)
-{
- if (nIDEvent == FP_TIMER_ID) {
- switch (m_ViewSel.GetCurSel()) {
- case 3:
- SetNetworkInfo();
- break;
- case 2:
- SetDecoderInfo();
- break;
- }
- }
-
- CDialog::OnTimer(nIDEvent);
-}
-
-void CFileProps::SetGeneralInfo()
-{
- char info[10000];
- char buf[1000];
- GF_MediaInfo odi;
- GF_ObjectManager *odm;
- u32 h, m, s, i, j;
-
- Osmo4 *gpac = GetApp();
- odm = current_odm;
-
- strcpy(info, "");
- if (!odm || gf_term_get_object_info(gpac->m_term, odm, &odi) != GF_OK) return;
-
- if (!odi.od) {
- strcat(info, odi.service_url);
- m_ODInfo.SetWindowText(info);
- return;
- }
- sprintf(buf, "%sObject Descriptor ID %d\r\n", (odi.has_profiles) ? "Initial " : "", odi.od->objectDescriptorID);
- strcat(info, buf);
- if (odi.duration) {
- h = (u32) (odi.duration / 3600);
- m = (u32) (odi.duration / 60) - h*60;
- s = (u32) (odi.duration) - h*3600 - m*60;
- sprintf(buf, "Duration %02d:%02d:%02d\r\n", h, m, s);
- strcat(info, buf);
- } else {
- strcat(info, "Unknown duration\r\n");
- }
- if (odi.owns_service) {
- strcat(info, "Service Handler: ");
- strcat(info, odi.service_handler);
- strcat(info, "\r\n");
- strcat(info, "Service URL: ");
- strcat(info, odi.service_url);
- strcat(info, "\r\n");
- }
-
- if (odi.od->URLString) {
- strcat(info, "Remote OD - URL: ");
- strcat(info, odi.od->URLString);
- strcat(info, "\r\n");
- }
- /*get OD content info*/
- if (odi.codec_name) {
- switch (odi.od_type) {
- case GF_STREAM_VISUAL:
- sprintf(buf, "Video Object: Width %d - Height %d\r\n", odi.width, odi.height);
- strcat(info, buf);
- strcat(info, "Media Codec ");
- strcat(info, odi.codec_name);
- strcat(info, "\r\n");
- if (odi.par) {
- sprintf(buf, "Pixel Aspect Ratio: %d:%d\r\n", (odi.par>>16)&0xFF, (odi.par)&0xFF);
- strcat(info, buf);
- }
- break;
- case GF_STREAM_AUDIO:
- sprintf(buf, "Audio Object: Sample Rate %d - %d channels\r\n", odi.sample_rate, odi.num_channels);
- strcat(info, buf);
- strcat(info, "Media Codec ");
- strcat(info, odi.codec_name);
- strcat(info, "\r\n");
- break;
- case GF_STREAM_PRIVATE_SCENE:
- case GF_STREAM_SCENE:
- if (odi.width && odi.height) {
- sprintf(buf, "Scene Description: Width %d - Height %d\r\n", odi.width, odi.height);
- } else {
- sprintf(buf, "Scene Description: No size specified\r\n");
- }
- strcat(info, buf);
- strcat(info, "Scene Codec ");
- strcat(info, odi.codec_name);
- strcat(info, "\r\n");
- break;
- case GF_STREAM_TEXT:
- if (odi.width && odi.height) {
- sprintf(buf, "Text Object: Width %d - Height %d\r\n", odi.width, odi.height);
- } else {
- sprintf(buf, "Text Object: No size specified\r\n");
- }
- strcat(info, buf);
- strcat(info, "Text Codec ");
- strcat(info, odi.codec_name);
- strcat(info, "\r\n");
- break;
- }
- }
- if (odi.protection) {
- strcat(info, "Encrypted Media");
- if (odi.protection==2) strcat(info, " NOT UNLOCKED");
- strcat(info, "\r\n");
- }
-
- if (!gf_list_count(odi.od->OCIDescriptors)) {
- m_ODInfo.SetWindowText(info);
- return;
- }
-
- strcat(info, "\r\nObject Content Information:\r\n");
-
- /*check OCI (not everything interests us) - FIXME: support for unicode*/
- for (i=0; i<gf_list_count(odi.od->OCIDescriptors); i++) {
- GF_Descriptor *desc = (GF_Descriptor *) gf_list_get(odi.od->OCIDescriptors, i);
- switch (desc->tag) {
- case GF_ODF_SEGMENT_TAG:
- {
- GF_Segment *sd = (GF_Segment *) desc;
- strcat(info, "\r\nSegment Descriptor:\r\n");
- sprintf(buf, "Name: %s - start time %g sec - duration %g sec\r\n", sd->SegmentName, sd->startTime, sd->Duration);
- strcat(info, buf);
- }
- break;
- case GF_ODF_CC_NAME_TAG:
- {
- GF_CC_Name *ccn = (GF_CC_Name *)desc;
- strcat(info, "\r\nContent Creators:\r\n");
- for (j=0; j<gf_list_count(ccn->ContentCreators); j++) {
- GF_ContentCreatorInfo *ci = (GF_ContentCreatorInfo *) gf_list_get(ccn->ContentCreators, j);
- if (!ci->isUTF8) continue;
- strcat(info, "\t");
- strcat(info, ci->contentCreatorName);
- strcat(info, "\r\n");
- }
- }
- break;
-
- case GF_ODF_SHORT_TEXT_TAG:
- {
- GF_ShortTextual *std = (GF_ShortTextual *)desc;
- strcat(info, "\r\n");
- strcat(info, std->eventName);
- strcat(info, ": ");
- strcat(info, std->eventText);
- strcat(info, "\r\n");
- }
- break;
- /*todo*/
- case GF_ODF_CC_DATE_TAG:
- break;
- default:
- break;
- }
-
- }
-
- m_ODInfo.SetWindowText(info);
-}
-
-void CFileProps::OnWorld()
-{
- CString wit;
- const char *str;
- GF_List *descs;
- Osmo4 *gpac = GetApp();
-
- descs = gf_list_new();
- str = gf_term_get_world_info(gpac->m_term, current_odm, descs);
- if (!str) {
- MessageBox("No World Info available", "Sorry!");
- return;
- }
-
- wit = "";
- for (u32 i=0; i<gf_list_count(descs); i++) {
- const char *d = (const char *) gf_list_get(descs, i);
- wit += d;
- wit += "\n";
- }
- MessageBox(wit, str);
- gf_list_del(descs);
-}
-
-void CFileProps::OnViewsg()
-{
- char szOutRadname[GF_MAX_PATH], *pFilename=NULL;
- Osmo4 *gpac = GetApp();
-
- strcpy(szOutRadname, gpac->szUserPath);
- if ( szOutRadname[strlen(szOutRadname)-1] != '\\'
- && szOutRadname[strlen(szOutRadname)-1] != '/')
- strcat(szOutRadname, "\\");
- strcat(szOutRadname, "scene_dump");
-
- GF_Err e = gf_term_dump_scene(gpac->m_term, (char *) szOutRadname, &pFilename, gpac->m_ViewXMTA, GF_FALSE, current_odm);
-
- if (e) {
- MessageBox(gf_error_to_string(e), "Error while dumping");
- } else {
- ShellExecute(NULL, "open", pFilename, NULL, NULL, SW_SHOWNORMAL);
- }
- if (pFilename) gf_free(pFilename);
-}
-
-void CFileProps::SetDecoderInfo()
-{
- GF_MediaInfo odi;
- char buf[1000], info[2000];
- u32 h, m, s;
- Osmo4 *gpac = GetApp();
-
- sprintf(info, "");
- m_ODInfo.SetWindowText("");
-
- if (!current_odm || gf_term_get_object_info(gpac->m_term, current_odm, &odi)) return;
- if (!odi.od) return;
-
- strcat(info, "Status: ");
- switch (odi.status) {
- case 0:
- case 1:
- case 2:
- h = (u32) (odi.current_time / 3600);
- m = (u32) (odi.current_time / 60) - h*60;
- s = (u32) (odi.current_time) - h*3600 - m*60;
- sprintf(buf, "%s\r\nObject Time: %02d:%02d:%02d\r\n", (odi.status==0) ? "Stopped" : (odi.status==1) ? "Playing" : "Paused", h, m, s);
- strcat(info, buf);
- break;
- case 3:
- strcat(info, "Not Setup");
- m_ODInfo.SetWindowText(info);
- return;
- default:
- strcat(info, "Setup Failed");
- m_ODInfo.SetWindowText(info);
- return;
- }
- /*get clock drift*/
- sprintf(buf, "Clock drift: %d ms\r\n", odi.clock_drift);
- strcat(info, buf);
- /*get buffering*/
- if (odi.buffer>=0) {
- sprintf(buf, "Buffering Time: %d ms\r\n", odi.buffer);
- strcat(info, buf);
- } else if (odi.buffer==-1) {
- strcat(info, "Not buffering\r\n");
- } else {
- strcat(info, "Not Playing\r\n");
- }
- /*get DB occupation*/
- if (odi.buffer>=0) {
- sprintf(buf, "Decoding Buffer: %d Access Units\r\n", odi.db_unit_count);
- strcat(info, buf);
- }
- /*get CB occupation*/
- if (odi.cb_max_count) {
- sprintf(buf, "Composition Memory: %d/%d Units\r\n", odi.cb_unit_count, odi.cb_max_count);
- strcat(info, buf);
- }
-
- Float avg_dec_time = 0;
- if (odi.nb_dec_frames) {
- avg_dec_time = (Float) odi.total_dec_time;
- avg_dec_time /= odi.nb_dec_frames;
- }
- sprintf(buf, "Bitrate over last second: %d kbps\r\nMax bitrate over one second: %d kbps\r\nAverage Decoding Time %.2f ms (%d max)\r\nTotal decoded frames %d - %d dropped\r\n",
- (u32) odi.avg_bitrate/1024, odi.max_bitrate/1024, avg_dec_time, odi.max_dec_time, odi.nb_dec_frames, odi.nb_dropped);
- strcat(info, buf);
-
- m_ODInfo.SetWindowText(info);
-}
-
-
-void CFileProps::SetStreamsInfo()
-{
- u32 i, count;
- char info[10000];
- char buf[1000];
- GF_MediaInfo odi;
- GF_ObjectManager *odm;
- Bool is_media;
-
- Osmo4 *gpac = GetApp();
- odm = current_odm;
-
- strcpy(info, "");
- m_ODInfo.SetWindowText("");
-
- if (!odm || gf_term_get_object_info(gpac->m_term, odm, &odi) != GF_OK) return;
- if (!odi.od) return;
-
-
- if (odi.has_profiles) {
- strcat(info, "MPEG-4 Profiles and Levels:\r\n");
- sprintf(buf, "\tOD Profile@Level %d\r\n", odi.OD_pl);
- strcat(info, buf);
- sprintf(buf, "\tScene Profile@Level %d\r\n", odi.scene_pl);
- strcat(info, buf);
- sprintf(buf, "\tGraphics Profile@Level %d\r\n", odi.graphics_pl);
- strcat(info, buf);
- sprintf(buf, "\tAudio Profile@Level %d\r\n", odi.audio_pl);
- strcat(info, buf);
- sprintf(buf, "\tVisual Profile@Level %d\r\n", odi.visual_pl);
- strcat(info, buf);
- sprintf(buf, "\tInline Content Profiled %s\r\n", odi.inline_pl ? "yes" : "no");
- strcat(info, buf);
- strcat(info, "\r\n");
- }
- is_media = GF_FALSE;
- count = gf_list_count(odi.od->ESDescriptors);
-
- for (i=0; i<count; i++) {
- GF_ESD *esd = (GF_ESD *) gf_list_get(odi.od->ESDescriptors, i);
-
- sprintf(buf, "\t** Stream ID %d - Clock ID %d **\r\n", esd->ESID, esd->OCRESID);
- strcat(info, buf);
- if (esd->dependsOnESID) {
- sprintf(buf, "Depends on Stream ID %d for decoding\r\n", esd->dependsOnESID);
- strcat(info, buf);
- }
- sprintf(buf, "%s\r\n", gf_esd_get_textual_description(esd));
- strcat(info, buf);
-
- sprintf(buf, "Buffer Size %d\r\nAverage Bitrate %d bps\r\nMaximum Bitrate %d bps\r\n", esd->decoderConfig->bufferSizeDB, esd->decoderConfig->avgBitrate, esd->decoderConfig->maxBitrate);
- strcat(info, buf);
- if (esd->slConfig->predefined==SLPredef_SkipSL) {
- sprintf(buf, "Not using MPEG-4 Synchronization Layer\r\n");
- } else {
- sprintf(buf, "Stream Clock Resolution %d\r\n", esd->slConfig->timestampResolution);
- }
- strcat(info, buf);
- if (esd->URLString) {
- sprintf(buf, "Stream Location: %s\r\n", esd->URLString);
- strcat(info, buf);
- }
-
- /*check language*/
- if (esd->langDesc) {
- s32 lang_idx;
- char lan[4];
- lan[0] = esd->langDesc->langCode>>16;
- lan[1] = (esd->langDesc->langCode>>8)&0xFF;
- lan[2] = (esd->langDesc->langCode)&0xFF;
- lan[3] = 0;
-
- lang_idx = gf_lang_find(lan);
- if (lang_idx>=0) {
- sprintf(buf, "Stream Language: %s\r\n", gf_lang_get_name(lang_idx) );
- strcat(info, buf);
- }
- }
- strcat(info, "\r\n");
- }
-
- m_ODInfo.SetWindowText(info);
-}
-
-void CFileProps::SetNetworkInfo()
-{
- char info[10000];
- char buf[10000];
- u32 id;
- NetStatCommand com;
- GF_MediaInfo odi;
- u32 d_enum, nb_streams;
- GF_Err e;
- GF_ObjectManager *odm;
- Osmo4 *gpac = GetApp();
- odm = current_odm;
-
- strcpy(info, "");
- m_ODInfo.SetWindowText("");
-
- if (!odm || gf_term_get_object_info(gpac->m_term, odm, &odi) != GF_OK) return;
- if (!odi.od) return;
-
- if (odi.owns_service) {
- const char *url, *path;
- u32 done, total, bps;
- strcpy(info, "Current Downloads in service:\r\n");
- d_enum = 0;
- while (gf_term_get_download_info(gpac->m_term, odm, &d_enum, &url, &path, &done, &total, &bps)) {
- if (total && done) {
- sprintf(buf, "%s %s: %d / %d bytes (%.2f %%) - %.2f kBps\r\n", url, path, done, total, (100.0f*done)/total, ((Float)bps)/1024);
- } else {
- sprintf(buf, "%s %s: %.2f kbps\r\n", url, path, ((Float)bps*8)/1024);
- }
- strcat(info, buf);
- }
- if (!d_enum) strcpy(info, "No Downloads in service\r\n");
- strcat(info, "\r\n");
- }
-
- d_enum = 0;
- nb_streams = 0;
- while (gf_term_get_channel_net_info(gpac->m_term, odm, &d_enum, &id, &com, &e)) {
- if (e) continue;
- if (!com.bw_down && !com.bw_up) continue;
- nb_streams ++;
-
- sprintf(buf, "Stream ID %d statistics:\r\n", id);
- strcat(info, buf);
- if (com.multiplex_port) {
- sprintf(buf, "\tMultiplex Port %d - multiplex ID %d\r\n", com.multiplex_port, com.port);
- } else {
- sprintf(buf, "\tPort %d\r\n", com.port);
- }
- strcat(info, buf);
- sprintf(buf, "\tPacket Loss Percentage: %.4f\r\n", com.pck_loss_percentage);
- strcat(info, buf);
- sprintf(buf, "\tDown Bandwidth: %.3f kbps\r\n", ((Float)com.bw_down) / 1024);
- strcat(info, buf);
- if (com.bw_up) {
- sprintf(buf, "\tUp Bandwidth: %d bps\r\n", com.bw_up);
- strcat(info, buf);
- }
- if (com.ctrl_port) {
- if (com.multiplex_port) {
- sprintf(buf, "\tControl Multiplex Port: %d - Control Multiplex ID %d\r\n", com.multiplex_port, com.ctrl_port);
- } else {
- sprintf(buf, "\tControl Port: %d\r\n", com.ctrl_port);
- }
- strcat(info, buf);
- sprintf(buf, "\tControl Down Bandwidth: %d bps\r\n", com.ctrl_bw_down);
- strcat(info, buf);
- sprintf(buf, "\tControl Up Bandwidth: %d bps\r\n", com.ctrl_bw_up);
- strcat(info, buf);
- }
- strcat(info, "\r\n");
- }
- if (!nb_streams) strcat(info, "No network streams in this object\r\n");
-
- m_ODInfo.SetWindowText(info);
-}
+++ /dev/null
-#if !defined(AFX_FILEPROPS_H__CA4484B4_0301_4BE1_8736_551250121C3F__INCLUDED_)
-#define AFX_FILEPROPS_H__CA4484B4_0301_4BE1_8736_551250121C3F__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// FileProps.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CFileProps dialog
-
-class CFileProps : public CDialog
-{
-// Construction
-public:
- CFileProps(CWnd* pParent = NULL); // standard constructor
- BOOL Create(CWnd * pParent)
- {
- return CDialog::Create( CFileProps::IDD, pParent);
- }
-
-// Dialog Data
- //{{AFX_DATA(CFileProps)
- enum { IDD = IDD_PROPERTIES };
- CTabCtrl m_ViewSel;
- CEdit m_ODInfo;
- CTreeCtrl m_ODTree;
- //}}AFX_DATA
-
-
- void RewriteODTree();
- void WriteInlineTree(GF_ObjectManager *root_od, HTREEITEM parent);
- void SetInfo(GF_ObjectManager *odm);
-
-private:
- GF_ObjectManager *current_odm;
- void SetGeneralInfo();
- void SetStreamsInfo();
- void SetDecoderInfo();
- void SetNetworkInfo();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CFileProps)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CFileProps)
- virtual BOOL OnInitDialog();
- afx_msg void OnSelchangedOdtree(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnWorld();
- afx_msg void OnViewsg();
- afx_msg void OnTimer(UINT_PTR nIDEvent);
- afx_msg void OnClose();
- afx_msg void OnDestroy();
- afx_msg void OnSelchangeViewsel(NMHDR* pNMHDR, LRESULT* pResult);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_FILEPROPS_H__CA4484B4_0301_4BE1_8736_551250121C3F__INCLUDED_)
+++ /dev/null
-// MainFrm.cpp : implementation of the CMainFrame class
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-
-#include "MainFrm.h"
-#include "resource.h"
-
-#include <gpac/network.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildView
-
-CChildView::CChildView()
-{
-}
-
-CChildView::~CChildView()
-{
- /*since the wndproc is overwritten by the terminal, we detach the handle otherwise we get a nice assertion
- failure from windows*/
- HWND hWnd = Detach();
- ::PostMessage(hWnd, WM_QUIT, 0, 0);
-}
-
-
-BEGIN_MESSAGE_MAP(CChildView,CWnd )
- //{{AFX_MSG_MAP(CChildView)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildView message handlers
-
-BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
-{
- cs.dwExStyle = 0;
- cs.style &= ~WS_BORDER;
-
- cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
- ::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_WINDOW+1), NULL);
-
- return TRUE;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame
-
-IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
-
-BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- ON_WM_CREATE()
- ON_WM_SETFOCUS()
- ON_WM_INITMENUPOPUP()
- ON_WM_SIZE()
- ON_WM_MOVE()
- ON_MESSAGE(WM_SETSIZE,OnSetSize)
- ON_MESSAGE(WM_NAVIGATE,OnNavigate)
- ON_MESSAGE(WM_OPENURL, Open)
- ON_MESSAGE(WM_NEWINSTANCE, NewInstanceOpened)
-
- ON_WM_LBUTTONDOWN()
- ON_WM_LBUTTONDBLCLK()
- ON_WM_LBUTTONUP()
- ON_WM_CHAR()
- ON_WM_SYSKEYDOWN()
- ON_WM_SYSKEYUP()
- ON_WM_KEYDOWN()
- ON_WM_KEYUP()
- ON_WM_DROPFILES()
- ON_MESSAGE(WM_CONSOLEMSG, OnConsoleMessage)
- ON_COMMAND(ID_VIEW_ORIGINAL, OnViewOriginal)
- ON_COMMAND(ID_VIEW_FULLSCREEN, OnViewFullscreen)
- ON_COMMAND(ID_AR_KEEP, OnArKeep)
- ON_COMMAND(ID_AR_FILL, OnArFill)
- ON_COMMAND(ID_AR_43, OnAr43)
- ON_COMMAND(ID_AR_169, OnAr169)
- ON_UPDATE_COMMAND_UI(ID_AR_169, OnUpdateAr169)
- ON_UPDATE_COMMAND_UI(ID_AR_43, OnUpdateAr43)
- ON_UPDATE_COMMAND_UI(ID_AR_FILL, OnUpdateArFill)
- ON_UPDATE_COMMAND_UI(ID_AR_KEEP, OnUpdateArKeep)
- ON_COMMAND(ID_NAVIGATE_NONE, OnNavigateNone)
- ON_COMMAND(ID_NAVIGATE_WALK, OnNavigateWalk)
- ON_COMMAND(ID_NAVIGATE_FLY, OnNavigateFly)
- ON_COMMAND(ID_NAVIGATE_EXAM, OnNavigateExam)
- ON_COMMAND(ID_NAVIGATE_SLIDE, OnNavigateSlide)
- ON_COMMAND(ID_NAVIGATE_PAN, OnNavigatePan)
- ON_COMMAND(ID_NAVIGATE_ORBIT, OnNavigateOrbit)
- ON_COMMAND(ID_NAVIGATE_GAME, OnNavigateGame)
- ON_COMMAND(ID_NAVIGATE_VR, OnNavigateVR)
- ON_COMMAND(ID_NAV_RESET, OnNavigateReset)
- ON_COMMAND(ID_SHORTCUTS, OnShortcuts)
- ON_COMMAND(IDD_CONFIGURE, OnConfigure)
- ON_COMMAND(ID_FILE_PROP, OnFileProp)
- ON_COMMAND(ID_VIEW_PL, OnViewPlaylist)
- ON_UPDATE_COMMAND_UI(ID_FILE_PROP, OnUpdateFileProp)
- ON_UPDATE_COMMAND_UI(ID_NAVIGATE_NONE, OnUpdateNavigate)
- ON_COMMAND(ID_REC_ENABLE, OnCacheEnable)
- ON_UPDATE_COMMAND_UI(ID_REC_ENABLE, OnUpdateCacheEnable)
- ON_COMMAND(ID_REC_STOP, OnCacheStop)
- ON_COMMAND(ID_REC_ABORT, OnCacheAbort)
- ON_UPDATE_COMMAND_UI(ID_REC_STOP, OnUpdateCacheStop)
- ON_COMMAND(ID_COLLIDE_DISP, OnCollideDisp)
- ON_UPDATE_COMMAND_UI(ID_COLLIDE_DISP, OnUpdateCollideDisp)
- ON_COMMAND(ID_COLLIDE_NONE, OnCollideNone)
- ON_UPDATE_COMMAND_UI(ID_COLLIDE_NONE, OnUpdateCollideNone)
- ON_COMMAND(ID_COLLIDE_REG, OnCollideReg)
- ON_UPDATE_COMMAND_UI(ID_COLLIDE_REG, OnUpdateCollideReg)
- ON_COMMAND(ID_HEADLIGHT, OnHeadlight)
- ON_UPDATE_COMMAND_UI(ID_HEADLIGHT, OnUpdateHeadlight)
- ON_COMMAND(ID_GRAVITY, OnGravity)
- ON_UPDATE_COMMAND_UI(ID_GRAVITY, OnUpdateGravity)
- ON_COMMAND(ID_NAV_INFO, OnNavInfo)
- ON_COMMAND(ID_NAV_NEXT, OnNavNext)
- ON_COMMAND(ID_NAV_PREV, OnNavPrev)
- ON_UPDATE_COMMAND_UI(ID_NAV_NEXT, OnUpdateNavNext)
- ON_UPDATE_COMMAND_UI(ID_NAV_PREV, OnUpdateNavPrev)
- ON_COMMAND(ID_CLEAR_NAV, OnClearNav)
- ON_UPDATE_COMMAND_UI(ID_VIEW_PL, OnUpdateViewPlaylist)
- ON_COMMAND(ID_PLAYLIST_LOOP, OnPlaylistLoop)
- ON_UPDATE_COMMAND_UI(ID_PLAYLIST_LOOP, OnUpdatePlaylistLoop)
- ON_COMMAND(ID_ADD_SUBTITLE, OnAddSubtitle)
- ON_UPDATE_COMMAND_UI(ID_REC_ABORT, OnUpdateCacheStop)
- ON_UPDATE_COMMAND_UI(ID_NAVIGATE_WALK, OnUpdateNavigate)
- ON_UPDATE_COMMAND_UI(ID_NAVIGATE_FLY, OnUpdateNavigate)
- ON_UPDATE_COMMAND_UI(ID_NAVIGATE_EXAM, OnUpdateNavigate)
- ON_UPDATE_COMMAND_UI(ID_NAVIGATE_PAN, OnUpdateNavigate)
- ON_UPDATE_COMMAND_UI(ID_NAVIGATE_SLIDE, OnUpdateNavigate)
- ON_UPDATE_COMMAND_UI(ID_NAVIGATE_ORBIT, OnUpdateNavigate)
- ON_UPDATE_COMMAND_UI(ID_NAVIGATE_VR, OnUpdateNavigate)
- ON_UPDATE_COMMAND_UI(ID_NAVIGATE_GAME, OnUpdateNavigate)
- ON_COMMAND(ID_FILE_EXIT, OnFileExit)
- ON_COMMAND(ID_VIEW_CPU, OnViewCPU)
- ON_UPDATE_COMMAND_UI(ID_VIEW_CPU, OnUpdateViewCPU)
-
- ON_COMMAND(ID_FILE_COPY, OnFileCopy)
- ON_UPDATE_COMMAND_UI(ID_FILE_COPY, OnUpdateFileCopy)
- ON_COMMAND(ID_FILE_PASTE, OnFilePaste)
- ON_UPDATE_COMMAND_UI(ID_FILE_PASTE, OnUpdateFilePaste)
-
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame construction/destruction
-
-CMainFrame::CMainFrame()
-{
- m_icoerror = AfxGetApp()->LoadIcon(IDI_ERR);
- m_icomessage = AfxGetApp()->LoadIcon(IDI_MESSAGE);
- m_bFullScreen = GF_FALSE;
- m_RestoreFS = 0;
- m_aspect_ratio = GF_ASPECT_RATIO_KEEP;
- m_pProps = NULL;
- m_pOpt = NULL;
- m_pPlayList = NULL;
- m_pWndView = new CChildView();
- m_bInitShow = GF_TRUE;
- m_bStartupFile = GF_TRUE;
- m_num_chapters = 0;
- m_chapters_start = NULL;
- m_last_prog = -1;
- m_timer_on = 0;
- m_show_rti = GF_FALSE;
- nb_viewpoints = 0;
-}
-
-CMainFrame::~CMainFrame()
-{
- if (m_chapters_start) gf_free(m_chapters_start);
- if (m_pProps != NULL) m_pProps->DestroyWindow();
- if (m_pOpt != NULL) m_pOpt->DestroyWindow();
- if (m_pPlayList != NULL) delete m_pPlayList;
- delete m_pWndView;
-}
-
-#define RTI_TIMER 22
-#define RTI_REFRESH_MS 250
-
-void CALLBACK EXPORT RTInfoTimer(HWND , UINT , UINT_PTR nID , DWORD )
-{
- char szMsg[100];
- GF_SystemRTInfo rti;
- if (nID != RTI_TIMER) return;
- Osmo4 *app = GetApp();
- CMainFrame *pFrame = (CMainFrame *) app->m_pMainWnd;
- /*shutdown*/
- if (!pFrame) return;
-
- if (pFrame->m_show_rti && !pFrame->m_timer_on) {
- if (!gf_sys_get_rti(RTI_REFRESH_MS, &rti, 0)) return;
- if (!rti.gpac_memory) rti.gpac_memory = rti.process_memory ? rti.process_memory : rti.physical_memory;
-
- if (pFrame->m_show_rti && !pFrame->m_timer_on) {
- sprintf(szMsg, "FPS %02.2f - CPU %02d (%02d) - Mem %d kB",
- gf_term_get_framerate(app->m_term, GF_FALSE), rti.total_cpu_usage, rti.process_cpu_usage, rti.gpac_memory/1024);
- pFrame->m_wndStatusBar.SetPaneText(1, szMsg);
- }
- }
-
- if (! gf_term_get_option(app->m_term, GF_OPT_IS_FINISHED)) {
- u32 ms = gf_term_get_time_in_ms(app->m_term);
- u32 h = ms / 1000 / 3600;
- u32 m = ms / 1000 / 60 - h*60;
- u32 s = ms / 1000 - h*3600 - m*60;
-
- sprintf(szMsg, "%02d:%02d.%02d", h, m, s);
- pFrame->m_wndStatusBar.SetPaneText(0, szMsg);
- }
-}
-
-static UINT status_indics[] =
-{
- ID_TIMER,
- ID_SEPARATOR, // status line indicator
-};
-
-
-
-int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- UINT buttonArray[50];
- TBBUTTONINFO bi;
- u32 *ba;
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- // create a view to occupy the client area of the frame
- if (!m_pWndView->CreateEx(0, NULL, NULL, WS_CHILD, 0, 0, 300, 200, m_hWnd, NULL, NULL))
- {
- TRACE0("Failed to create view window\n");
- return -1;
- }
- m_pPlayList = new Playlist();
- m_pPlayList->Create();
- m_pPlayList->ShowWindow(SW_HIDE);
-
-
- if (!m_wndToolBar.CreateEx(this, WS_CHILD | CBRS_TOP | CBRS_FLYBY) ||
- !m_wndToolBar.LoadBitmap(IDR_MAINTOOLS))
- {
- TRACE0("Failed to create toolbar\n");
- return -1; // fail to create
- }
-
- ba = &buttonArray[0];
- *ba = ID_OPEN_FILE;
- ba++;
- *ba = ID_SEPARATOR;
- ba++;
- *ba = ID_NAV_PREV;
- ba++;
- *ba = ID_NAV_NEXT;
- ba++;
- *ba = ID_SEPARATOR;
- ba++;
- *ba = ID_FILE_PLAY;
- ba++;
- *ba = ID_FILE_STEP;
- ba++;
- *ba = ID_FILE_STOP;
- ba++;
- *ba = ID_SEPARATOR;
- ba++;
- *ba = ID_FILE_PROP;
- ba++;
- *ba = ID_SEPARATOR;
- ba++;
- *ba = ID_FILE_PROP;
- ba++;
- *ba = ID_SWITCH_RENDER;
- m_wndToolBar.SetButtons(buttonArray, 13);
- m_wndToolBar.SetButtonInfo(0, ID_OPEN_FILE, TBBS_BUTTON, 0);
- m_wndToolBar.SetButtonInfo(1, ID_SEPARATOR, TBBS_SEPARATOR, 0);
- m_wndToolBar.SetButtonInfo(2, ID_NAV_PREV, TBBS_DROPDOWN, 1);
- m_wndToolBar.SetButtonInfo(3, ID_NAV_NEXT, TBBS_DROPDOWN, 2);
- m_wndToolBar.SetButtonInfo(4, ID_SEPARATOR, TBBS_SEPARATOR, 0);
- m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 3);
- m_wndToolBar.SetButtonInfo(6, ID_FILE_STEP, TBBS_BUTTON, 5);
- m_wndToolBar.SetButtonInfo(7, ID_FILE_STOP, TBBS_BUTTON, 6);
- m_wndToolBar.SetButtonInfo(8, ID_SEPARATOR, TBBS_SEPARATOR, 0);
- m_wndToolBar.SetButtonInfo(9, ID_FILE_PROP, TBBS_BUTTON, 7);
- m_wndToolBar.SetButtonInfo(10, ID_SEPARATOR, TBBS_SEPARATOR, 0);
- m_wndToolBar.SetButtonInfo(11, IDD_CONFIGURE, TBBS_BUTTON, 8);
- m_wndToolBar.SetButtonInfo(12, ID_SWITCH_RENDER, TBBS_BUTTON, 9);
-
- CToolBarCtrl &ctrl = m_wndToolBar.GetToolBarCtrl();
- ctrl.SetStyle(TBSTYLE_FLAT | TBSTYLE_DROPDOWN);
- ctrl.SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
-
- memset(&bi, 0, sizeof(bi));
- bi.cbSize = sizeof(bi);
- ctrl.GetButtonInfo(2, &bi);
- bi.fsStyle |= TBSTYLE_DROPDOWN;
- ctrl.SetButtonInfo(ID_NAV_PREV, &bi);
-
- memset(&bi, 0, sizeof(bi));
- bi.cbSize = sizeof(bi);
- ctrl.GetButtonInfo(3, &bi);
- bi.fsStyle |= TBSTYLE_DROPDOWN;
- ctrl.SetButtonInfo(ID_NAV_NEXT, &bi);
-
- if (!m_wndStatusBar.Create(this) ||
- !m_wndStatusBar.SetIndicators(status_indics,
- sizeof(status_indics)/sizeof(UINT)))
- {
- TRACE0("Failed to create status bar\n");
- return -1; // fail to create
- }
-
- if (!m_Address.Create(this, IDD_NAVBAR, WS_CHILD | CBRS_TOP | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, IDD_NAVBAR) ) {
- return -1; // fail to create
- }
-
- if (!m_Sliders.Create(IDD_SLIDERS, this) ) {
- return -1; // fail to create
- }
-
- m_wndStatusBar.SetPaneInfo(0, ID_TIMER, SBPS_NORMAL, 60);
- m_wndStatusBar.SetPaneInfo(1, ID_SEPARATOR, SBPS_STRETCH, 0);
- SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE);
- SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);
-
- SetTimer(RTI_TIMER, RTI_REFRESH_MS, RTInfoTimer);
- return 0;
-}
-
-
-BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
-{
- if( !CFrameWnd::PreCreateWindow(cs) )
- return FALSE;
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
-
- cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
- cs.lpszClass = AfxRegisterWndClass(0);
- return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame diagnostics
-
-#ifdef _DEBUG
-void CMainFrame::AssertValid() const
-{
- CFrameWnd::AssertValid();
-}
-
-void CMainFrame::Dump(CDumpContext& dc) const
-{
- CFrameWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame message handlers
-void CMainFrame::OnSetFocus(CWnd* pOldWnd)
-{
- m_pWndView->SetFocus();
- if (m_RestoreFS==1) {
- m_RestoreFS=2;
- }
- else if (m_RestoreFS==2) {
- m_RestoreFS = 0;
- SetFullscreen();
- }
-}
-
-BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
-{
- // let the view have first crack at the command
- if (m_pWndView->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
- return TRUE;
-
- // otherwise, do default handling
- return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
-}
-
-
-void CMainFrame::OnSize(UINT nType, int cx, int cy)
-{
- RECT rc2;
- u32 tool_h, slide_h, add_h, stat_h;
-
- if (m_bInitShow) {
- CFrameWnd::OnSize(nType, cx, cy);
- return;
- }
- m_wndToolBar.GetClientRect(&rc2);
- tool_h = rc2.bottom - rc2.top;
- m_Address.GetClientRect(&rc2);
- add_h = rc2.bottom - rc2.top;
- m_Sliders.GetClientRect(&rc2);
- slide_h = rc2.bottom - rc2.top;
- m_wndStatusBar.GetClientRect(&rc2);
- stat_h = rc2.bottom - rc2.top;
- if ((u32) cy <= tool_h+add_h+slide_h+stat_h) {
- OnSetSize(cx, 1);
- return;
- }
-
- CFrameWnd::OnSize(nType, cx, cy);
- cy -= tool_h + add_h + slide_h + stat_h;
-
- m_Address.SetWindowPos(this, 0, 0, cx, add_h, SWP_SHOWWINDOW | SWP_NOMOVE);
-
- m_pWndView->ShowWindow(SW_SHOW);
- m_pWndView->SetWindowPos(this, 0, add_h + tool_h, cx, cy, SWP_NOZORDER);
-
- m_Sliders.SetWindowPos(this, 0, add_h + tool_h + cy, cx, slide_h, SWP_NOZORDER|SWP_SHOWWINDOW);
- /*and resize term*/
- gf_term_set_size(GetApp()->m_term, cx, cy);
-}
-
-
-LRESULT CMainFrame::OnSetSize(WPARAM wParam, LPARAM lParam)
-{
- UINT width, height;
- width = (UINT) wParam;
- height = (UINT) lParam;
- if (m_bInitShow) {
- m_wndToolBar.UpdateWindow();
- m_wndToolBar.ShowWindow(SW_SHOW);
- m_Address.UpdateWindow();
- m_Address.ShowWindow(SW_SHOW);
- m_Sliders.UpdateWindow();
- m_Sliders.ShowWindow(SW_SHOW);
- m_Sliders.m_PosSlider.EnableWindow(FALSE);
- m_pWndView->ShowWindow(SW_SHOW);
- ShowWindow(SW_SHOW);
- m_bInitShow = GF_FALSE;
- }
-
- RECT winRect;
- winRect.left = 0;
- winRect.right = width;
- winRect.top = 0;
- winRect.bottom = height;
- AdjustWindowRectEx(&winRect, GetStyle(), TRUE, GetExStyle());
- winRect.bottom -= winRect.top;
- winRect.right -= winRect.left;
- winRect.left = winRect.top = 0;
-
- RECT rc2;
- m_Address.GetClientRect(&rc2);
- winRect.bottom += rc2.bottom;
- m_wndToolBar.GetClientRect(&rc2);
- winRect.bottom += rc2.bottom;
- m_Sliders.GetClientRect(&rc2);
- winRect.bottom += rc2.bottom;
- m_wndStatusBar.GetClientRect(&rc2);
- winRect.bottom += rc2.bottom;
-
- GetWindowRect(&rc2);
- rc2.bottom -= rc2.top;
- rc2.right -= rc2.left;
- if ((rc2.right != winRect.right) || (rc2.bottom != winRect.bottom)) {
- SetWindowPos(NULL, 0, 0, winRect.right, winRect.bottom, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW);
- } else {
- /*just resize term*/
- //gf_term_set_size(GetApp()->m_term, width, height);
- SetWindowPos(NULL, 0, 0, winRect.right, winRect.bottom, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW);
- }
- return 0;
-}
-
-void CMainFrame::OnMove(int x, int y)
-{
- CFrameWnd::OnMove(x, y);
- RECT rc;
-
- m_wndToolBar.GetClientRect(&rc);
- m_wndToolBar.SetWindowPos(this, x, y, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
- y += rc.bottom - rc.top;
- m_Address.SetWindowPos(this, x, y, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
- m_Address.GetClientRect(&rc);
- y += rc.bottom - rc.top;
- m_pWndView->SetWindowPos(this, x, y, 0, 0, SWP_NOSIZE);
- m_pWndView->GetClientRect(&rc);
- y += rc.bottom;
- m_Sliders.SetWindowPos(this, x, y, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
-}
-
-
-#define PROGRESS_TIMER 20
-#define PROGRESS_REFRESH_MS 100
-
-void CALLBACK EXPORT ProgressTimer(HWND , UINT , UINT_PTR nID , DWORD )
-{
- u32 now;
- if (nID != PROGRESS_TIMER) return;
- Osmo4 *app = GetApp();
- CMainFrame *pFrame = (CMainFrame *) app->m_pMainWnd;
- /*shutdown*/
- if (!pFrame) return;
-
- now = gf_term_get_time_in_ms(app->m_term);
- if (!now) return;
-
- if (app->can_seek && !pFrame->m_Sliders.m_grabbed) {
- if (now >= app->max_duration + 100) {
- if (gf_term_get_option(app->m_term, GF_OPT_IS_FINISHED)) {
- pFrame->m_pPlayList->PlayNext();
- }
- /*if no IsOver go on forever*/
- } else {
- if (!app->m_reset)
- pFrame->m_Sliders.m_PosSlider.SetPos(now);
- }
- }
-}
-
-void CMainFrame::SetProgTimer(Bool bOn)
-{
- if (bOn)
- SetTimer(PROGRESS_TIMER, PROGRESS_REFRESH_MS, ProgressTimer);
- else
- KillTimer(PROGRESS_TIMER);
-}
-
-
-LRESULT CMainFrame::Open(WPARAM wParam, LPARAM lParam)
-{
- Bool do_pause;
- Osmo4 *app = GetApp();
- CString txt, url;
- m_bStartupFile = GF_FALSE;
- txt = "Osmo4 - ";
- txt += m_pPlayList->GetDisplayName();
-
- url = m_pPlayList->GetURL();
- m_Address.m_Address.SetWindowText(url);
- SetWindowText(txt);
- if (app->start_mode==1) do_pause = GF_TRUE;
- else if (app->start_mode==2) do_pause = GF_FALSE;
- else do_pause = /*!app->m_AutoPlay*/GF_FALSE;
- gf_term_connect_from_time(app->m_term, (LPCSTR) url, app->m_reconnect_time, do_pause);
- app->m_reconnect_time = 0;
- app->start_mode = 0;
- app->UpdatePlayButton();
- nb_viewpoints = 0;
- return 1;
-}
-
-LRESULT CMainFrame::NewInstanceOpened(WPARAM wParam, LPARAM lParam)
-{
- Bool queue_only = GF_FALSE;
- char *url = (char *) static_gpac_get_url();
- if (!strnicmp(url, "-queue ", 7)) {
- queue_only = GF_TRUE;
- url += 7;
- }
- m_pPlayList->QueueURL(url);
- m_pPlayList->RefreshList();
- if (!queue_only) m_pPlayList->PlayNext();
- return 1;
-}
-
-
-void CMainFrame::ForwardMessage()
-{
- const MSG *msg = GetCurrentMessage();
- m_pWndView->SendMessage(msg->message, msg->wParam, msg->lParam);
-}
-void CMainFrame::OnSysKeyUp(UINT , UINT , UINT ) {
- ForwardMessage();
-}
-void CMainFrame::OnSysKeyDown(UINT , UINT , UINT ) {
- ForwardMessage();
-}
-void CMainFrame::OnChar(UINT , UINT , UINT ) {
- ForwardMessage();
-}
-void CMainFrame::OnKeyDown(UINT , UINT , UINT ) {
- ForwardMessage();
-}
-void CMainFrame::OnKeyUp(UINT , UINT , UINT ) {
- ForwardMessage();
-}
-void CMainFrame::OnLButtonDown(UINT , CPoint ) {
- ForwardMessage();
-}
-void CMainFrame::OnLButtonDblClk(UINT , CPoint ) {
- ForwardMessage();
-}
-void CMainFrame::OnLButtonUp(UINT , CPoint ) {
- ForwardMessage();
-}
-
-void CMainFrame::OnDropFiles(HDROP hDropInfo)
-{
- u32 i, count;
- Osmo4 *app = GetApp();
- char fileName[MAX_PATH];
-
- count = ::DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0);
- if (!count) return;
-
- /*if playing and sub d&d, open sub in current presentation*/
- if (app->m_isopen && (count==1)) {
- ::DragQueryFile(hDropInfo, 0, fileName, MAX_PATH);
- char *ext = strrchr(fileName, '.');
- if (ext && ( !stricmp(ext, ".srt") || !stricmp(ext, ".sub") || !stricmp(ext, ".ttxt") || !stricmp(ext, ".xml") ) ) {
- AddSubtitle(fileName, GF_TRUE);
- return;
- }
- }
-
- /* if (count==1)
- m_pPlayList->Truncate();
- else
- */ m_pPlayList->Clear();
-
- for (i=0; i<count; i++) {
- ::DragQueryFile (hDropInfo, i, fileName, MAX_PATH);
- m_pPlayList->QueueURL(fileName);
- }
- m_pPlayList->RefreshList();
- m_pPlayList->PlayNext();
-}
-
-void CALLBACK EXPORT ConsoleTimer(HWND , UINT , UINT_PTR , DWORD )
-{
- CMainFrame *pFrame = (CMainFrame *) GetApp()->m_pMainWnd;
-
- pFrame->m_wndStatusBar.GetStatusBarCtrl().SetIcon(2, NULL);
- pFrame->KillTimer(pFrame->m_timer_on);
- pFrame->m_timer_on = 0;
- pFrame->m_wndStatusBar.SetPaneText(1, "Ready");
-}
-
-#define CONSOLE_DISPLAY_TIME 1000
-
-LRESULT CMainFrame::OnConsoleMessage(WPARAM wParam, LPARAM lParam)
-{
- if (m_timer_on) KillTimer(m_timer_on);
-
- if (console_err>=0) {
- m_wndStatusBar.GetStatusBarCtrl().SetIcon(2, m_icomessage);
- m_wndStatusBar.SetPaneText(1, console_message);
- } else {
- char msg[5000];
- m_wndStatusBar.GetStatusBarCtrl().SetIcon(2, m_icoerror);
- sprintf(msg, "%s (%s)", console_message, console_service);
- m_wndStatusBar.SetPaneText(1, msg);
- }
- m_timer_on = SetTimer(10, wParam ? (UINT) wParam : CONSOLE_DISPLAY_TIME, ConsoleTimer);
- return 0;
-}
-
-BOOL CMainFrame::DestroyWindow()
-{
- if (GetApp()->m_isopen) KillTimer(PROGRESS_TIMER);
- /*signal close to prevent callbacks but don't close, this is done in ExitInstance (otherwise there's a
- deadlock happening not sure why yet)*/
-// GetApp()->m_open = 0;
- return CFrameWnd::DestroyWindow();
-}
-
-
-void CMainFrame::OnViewOriginal()
-{
- Osmo4 *gpac = GetApp();
- gf_term_set_option(gpac->m_term, GF_OPT_ORIGINAL_VIEW, 1);
- OnSetSize(gpac->orig_width, gpac->orig_height);
-}
-
-void CMainFrame::SetFullscreen()
-{
- Osmo4 *gpac = GetApp();
- if (!m_bFullScreen) {
- GetWindowRect(&backup_wnd_rc);
- if (gf_term_set_option(gpac->m_term, GF_OPT_FULLSCREEN, 1) == GF_OK)
- m_bFullScreen = GF_TRUE;
- } else {
- if (gf_term_set_option(gpac->m_term, GF_OPT_FULLSCREEN, 0) == GF_OK)
- m_bFullScreen = GF_FALSE;
- SetWindowPos(NULL, backup_wnd_rc.left, backup_wnd_rc.top, backup_wnd_rc.right-backup_wnd_rc.left, backup_wnd_rc.bottom-backup_wnd_rc.top, SWP_NOZORDER);
- }
-}
-
-void CMainFrame::OnViewFullscreen()
-{
- SetFullscreen();
-}
-
-void CMainFrame::OnArKeep()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
- m_aspect_ratio = GF_ASPECT_RATIO_KEEP;
-}
-
-void CMainFrame::OnArFill()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN);
- m_aspect_ratio = GF_ASPECT_RATIO_FILL_SCREEN;
-}
-
-void CMainFrame::OnAr43()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3);
- m_aspect_ratio = GF_ASPECT_RATIO_4_3;
-}
-
-void CMainFrame::OnAr169()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);
- m_aspect_ratio = GF_ASPECT_RATIO_16_9;
-}
-
-void CMainFrame::OnUpdateAr169(CCmdUI* pCmdUI)
-{
- pCmdUI->SetCheck(m_aspect_ratio == GF_ASPECT_RATIO_16_9);
-}
-
-void CMainFrame::OnUpdateAr43(CCmdUI* pCmdUI)
-{
- pCmdUI->SetCheck(m_aspect_ratio == GF_ASPECT_RATIO_4_3);
-}
-
-void CMainFrame::OnUpdateArFill(CCmdUI* pCmdUI)
-{
- pCmdUI->SetCheck(m_aspect_ratio == GF_ASPECT_RATIO_FILL_SCREEN);
-}
-
-void CMainFrame::OnUpdateArKeep(CCmdUI* pCmdUI)
-{
- pCmdUI->SetCheck(m_aspect_ratio == GF_ASPECT_RATIO_KEEP);
-}
-
-void CMainFrame::OnUpdateNavigate(CCmdUI* pCmdUI)
-{
- BOOL enable;
- Osmo4 *app = GetApp();
- pCmdUI->Enable(FALSE);
- if (!app->m_isopen) return;
-
- u32 type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION_TYPE);
- enable = type ? TRUE : FALSE;
-
- if (pCmdUI->m_nID==ID_NAV_RESET) {
- pCmdUI->Enable(TRUE);
- return;
- }
-
- u32 mode = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION);
- /*common 2D/3D modes*/
- if (pCmdUI->m_nID==ID_NAVIGATE_NONE) {
- pCmdUI->Enable(enable);
- pCmdUI->SetCheck(mode ? 0 : 1);
- }
- else if (pCmdUI->m_nID==ID_NAVIGATE_EXAM) {
- pCmdUI->Enable(enable);
- pCmdUI->SetCheck((mode==GF_NAVIGATE_EXAMINE) ? 1 : 0);
- }
- else if (pCmdUI->m_nID==ID_NAVIGATE_SLIDE) {
- pCmdUI->Enable(enable);
- pCmdUI->SetCheck((mode==GF_NAVIGATE_SLIDE) ? 1 : 0);
- }
-
- if (type==GF_NAVIGATE_TYPE_2D) return;
- pCmdUI->Enable(enable);
- if (pCmdUI->m_nID==ID_NAVIGATE_WALK) pCmdUI->SetCheck((mode==GF_NAVIGATE_WALK) ? 1 : 0);
- else if (pCmdUI->m_nID==ID_NAVIGATE_FLY) pCmdUI->SetCheck((mode==GF_NAVIGATE_FLY) ? 1 : 0);
- else if (pCmdUI->m_nID==ID_NAVIGATE_PAN) pCmdUI->SetCheck((mode==GF_NAVIGATE_PAN) ? 1 : 0);
- else if (pCmdUI->m_nID==ID_NAVIGATE_VR) pCmdUI->SetCheck((mode==GF_NAVIGATE_VR) ? 1 : 0);
- else if (pCmdUI->m_nID==ID_NAVIGATE_GAME) pCmdUI->SetCheck((mode==GF_NAVIGATE_GAME) ? 1 : 0);
-}
-
-
-void CMainFrame::SetNavigate(u32 mode)
-{
- Osmo4 *app = GetApp();
- gf_term_set_option(app->m_term, GF_OPT_NAVIGATION, mode);
-}
-void CMainFrame::OnNavigateNone() {
- SetNavigate(GF_NAVIGATE_NONE);
-}
-void CMainFrame::OnNavigateWalk() {
- SetNavigate(GF_NAVIGATE_WALK);
-}
-void CMainFrame::OnNavigateFly() {
- SetNavigate(GF_NAVIGATE_FLY);
-}
-void CMainFrame::OnNavigateExam() {
- SetNavigate(GF_NAVIGATE_EXAMINE);
-}
-void CMainFrame::OnNavigateSlide() {
- SetNavigate(GF_NAVIGATE_SLIDE);
-}
-void CMainFrame::OnNavigatePan() {
- SetNavigate(GF_NAVIGATE_PAN);
-}
-void CMainFrame::OnNavigateOrbit() {
- SetNavigate(GF_NAVIGATE_ORBIT);
-}
-void CMainFrame::OnNavigateVR() {
- SetNavigate(GF_NAVIGATE_VR);
-}
-void CMainFrame::OnNavigateGame() {
- SetNavigate(GF_NAVIGATE_GAME);
-}
-
-void CMainFrame::OnNavigateReset()
-{
- Osmo4 *app = GetApp();
- gf_term_set_option(app->m_term, GF_OPT_NAVIGATION_TYPE, 0);
-}
-
-
-LRESULT CMainFrame::OnNavigate(WPARAM /*wParam*/, LPARAM /*lParam*/)
-{
- Osmo4 *gpac = GetApp();
-
- /*this is a migrate instruction, just disconnect the player*/
- if (gpac->m_navigate_url.IsEmpty() ) {
- gf_term_disconnect(gpac->m_term);
- return 0;
- }
-
- if (gf_term_is_supported_url(gpac->m_term, gpac->m_navigate_url, GF_TRUE, gpac->m_NoMimeFetch)) {
- char *str = gf_url_concatenate(m_pPlayList->GetURL(), gpac->m_navigate_url);
- if (str) {
- m_pPlayList->Truncate();
- m_pPlayList->QueueURL(str);
- gf_free(str);
- m_pPlayList->RefreshList();
- m_pPlayList->PlayNext();
- return 0;
- }
- }
-
- if (m_bFullScreen) {
- SetFullscreen();
- m_RestoreFS = 1;
- }
-
- console_message = gpac->m_navigate_url;
- console_err = GF_OK;
- PostMessage(WM_CONSOLEMSG);
- ShellExecute(NULL, "open", (LPCSTR) gpac->m_navigate_url, NULL, NULL, SW_SHOWNORMAL);
-
- return 0;
-}
-
-void CMainFrame::OnFileProp()
-{
- if (!m_pProps) {
- m_pProps = new CFileProps(this);
- m_pProps->Create(this);
- }
- m_pProps->ShowWindow(SW_SHOW);
-}
-
-void CMainFrame::OnUpdateFileProp(CCmdUI* pCmdUI)
-{
- pCmdUI->Enable(GetApp()->m_isopen);
-}
-
-void CMainFrame::OnConfigure()
-{
- if (!m_pOpt) {
- m_pOpt = new COptions(this);
- m_pOpt->Create(this);
- }
- m_pOpt->ShowWindow(SW_SHOW);
-}
-
-void CMainFrame::OnShortcuts()
-{
- MessageBox(
- "Open File: Ctrl + O\n"
- "Open URL: Ctrl + U\n"
- "Reload File: F5\n"
- "Pause/Resume File: Ctrl + P\n"
- "Step by Step: Ctrl + S\n"
- "Seek +5%: Alt + left arrow\n"
- "Seek -5%: Alt + right arrow\n"
- "Switch quality up: Ctrl + H\n"
- "Switch quality down: Ctrl + L\n"
- "Fullscreen On/Off: Double-click or Escape\n"
- "\n"
- "Show Properties: Ctrl + I\n"
- "Show Playlist: F3\n"
- "Next Playlist Item: Ctrl + right arrow\n"
- "Previous Playlist Item: Ctrl + left arrow\n"
- "\n"
- "Aspect Ratio Normal: Ctrl + 1\n"
- "Aspect Ratio Fill: Ctrl + 2\n"
- "Aspect Ratio 4/3: Ctrl + 3\n"
- "Aspect Ratio 16/9: Ctrl + 4\n"
-
-
- , "Shortcuts Available on Osmo4", MB_OK);
-}
-
-void CMainFrame::OnNavInfo()
-{
- MessageBox(
- "* Walk & Fly modes:\n"
- "\tH move: H pan - V move: Z-translate - V move+CTRL or Wheel: V pan - Right Click (Walk only): Jump\n"
- "\tleft/right: H pan - left/right+CTRL: H translate - up/down: Z-translate - up/down+CTRL: V pan\n"
- "* Pan mode:\n"
- "\tH move: H pan - V move: V pan - V move+CTRL or Wheel: Z-translate\n"
- "\tleft/right: H pan - left/right+CTRL: H translate - up/down: V pan - up/down+CTRL: Z-translate\n"
- "* Slide mode:\n"
- "\tH move: H translate - V move: V translate - V move+CTRL or Wheel: Z-translate\n"
- "\tleft/right: H translate - left/right+CTRL: H pan - up/down: V translate - up/down+CTRL: Z-translate\n"
- "* Examine & Orbit mode:\n"
- "\tH move: Y-Axis rotate - H move+CTRL: Z-Axis rotate - V move: X-Axis rotate - V move+CTRL or Wheel: Z-translate\n"
- "\tleft/right: Y-Axis rotate - left/right+CTRL: H translate - up/down: X-Axis rotate - up/down+CTRL: Y-translate\n"
- "* VR mode:\n"
- "\tH move: H pan - V move: V pan - V move+CTRL or Wheel: Camera Zoom\n"
- "\tleft/right: H pan - up/down: V pan - up/down+CTRL: Camera Zoom\n"
- "* Game mode (press END to escape):\n"
- "\tH move: H pan - V move: V pan\n"
- "\tleft/right: H translate - up/down: Z-translate\n"
- "\n"
- "* All 3D modes: CTRL+PGUP/PGDOWN will zoom in/out camera (field of view) \n"
-
- "\n"
- "*Slide Mode in 2D:\n"
- "\tH move: H translate - V move: V translate - V move+CTRL: zoom\n"
- "\tleft/right: H translate - up/down: V translate - up/down+CTRL: zoom\n"
- "*Examine Mode in 2D (3D renderer only):\n"
- "\tH move: Y-Axis rotate - V move: X-Axis rotate\n"
- "\tleft/right: Y-Axis rotate - up/down: X-Axis rotate\n"
-
- "\n"
- "HOME: reset navigation to last viewpoint (2D or 3D navigation)\n"
- "SHIFT key in all modes: fast movement\n"
-
- , "3D navigation keys (\'H\'orizontal and \'V\'ertical) used in GPAC", MB_OK);
-}
-
-
-
-void CMainFrame::BuildViewList()
-{
- Osmo4 *app = GetApp();
- if (!app->m_isopen) return;
-
- /*THIS IS HARCODED FROM THE MENU LAYOUT */
- CMenu *pMenu = GetMenu()->GetSubMenu(1)->GetSubMenu(0);
- while (pMenu->GetMenuItemCount()) pMenu->DeleteMenu(0, MF_BYPOSITION);
-
- s32 id = ID_VP_0;
- nb_viewpoints = 0;
- while (1) {
- const char *szName = NULL;
- Bool bound;
- GF_Err e = gf_term_get_viewpoint(app->m_term, nb_viewpoints+1, &szName, &bound);
- if (e) break;
- if (szName) {
- pMenu->AppendMenu(MF_ENABLED, id+nb_viewpoints, szName);
- } else {
- char szLabel[1024];
- sprintf(szLabel, "Viewpoint #%d", nb_viewpoints+1);
- pMenu->AppendMenu(MF_ENABLED, id+nb_viewpoints, szLabel);
- }
- nb_viewpoints++;
- if (nb_viewpoints==ID_VP_19-ID_VP_0) break;
- }
-}
-
-
-void CMainFrame::BuildStreamList(Bool reset_only)
-{
- u32 nb_subs;
- CMenu *pSelect;
- Osmo4 *app = GetApp();
-
- pSelect = GetMenu()->GetSubMenu(2)->GetSubMenu(0);
- /*THIS IS HARCODED FROM THE MENU LAYOUT */
- CMenu *pMenu = pSelect->GetSubMenu(0);
- while (pMenu->GetMenuItemCount()) pMenu->DeleteMenu(0, MF_BYPOSITION);
- pMenu = pSelect->GetSubMenu(1);
- while (pMenu->GetMenuItemCount()) pMenu->DeleteMenu(0, MF_BYPOSITION);
- pMenu = pSelect->GetSubMenu(2);
- while (pMenu->GetMenuItemCount()) pMenu->DeleteMenu(0, MF_BYPOSITION);
-
- if (reset_only) {
- m_bFirstStreamQuery = GF_TRUE;
- return;
- }
- if (!app->m_isopen || !gf_term_get_option(app->m_term, GF_OPT_CAN_SELECT_STREAMS)) return;
-
- GF_ObjectManager *root_od = gf_term_get_root_object(app->m_term);
- if (!root_od) return;
- u32 count = gf_term_get_object_count(app->m_term, root_od);
- nb_subs = 0;
-
- for (u32 i=0; i<count; i++) {
- char szLabel[1024];
- GF_MediaInfo info;
- GF_ObjectManager *odm = gf_term_get_object(app->m_term, root_od, i);
- if (!odm) return;
-
- if (gf_term_get_object_info(app->m_term, odm, &info) != GF_OK) break;
- if (info.owns_service) {
- char *szName = (char *)strrchr(info.service_url, '\\');
- if (!szName) szName = (char *)strrchr(info.service_url, '/');
- if (!szName) szName = (char *) info.service_url;
- else szName += 1;
- strcpy(szLabel, szName);
- szName = strrchr(szLabel, '.');
- if (szName) szName[0] = 0;
- }
-
- switch (info.od_type) {
- case GF_STREAM_AUDIO:
- pMenu = pSelect->GetSubMenu(0);
- if (!info.owns_service) {
- if (info.lang) {
- sprintf(szLabel, "Language %s (ID %d)", gf_4cc_to_str(info.lang), info.od->objectDescriptorID);
- } else {
- sprintf(szLabel, "ID %d", info.od->objectDescriptorID);
- }
- }
- pMenu->AppendMenu(MF_ENABLED, ID_SELOBJ_0 + i, szLabel);
- break;
- case GF_STREAM_VISUAL:
- pMenu = pSelect->GetSubMenu(1);
- if (!info.owns_service) sprintf(szLabel, "ID %d", info.od->objectDescriptorID);
- pMenu->AppendMenu(MF_ENABLED, ID_SELOBJ_0 + i, szLabel);
- break;
- case GF_STREAM_TEXT:
- nb_subs ++;
- pMenu = pSelect->GetSubMenu(2);
- if (!info.owns_service) {
- if (info.lang) {
- sprintf(szLabel, "Language %s (ID %d)", gf_4cc_to_str(info.lang), info.od->objectDescriptorID);
- } else {
- sprintf(szLabel, "ID %d", info.od->objectDescriptorID);
- }
- }
- pMenu->AppendMenu(MF_ENABLED, ID_SELOBJ_0 + i, szLabel);
- break;
- }
- }
- if (m_bFirstStreamQuery) {
- m_bFirstStreamQuery = GF_FALSE;
- if (!nb_subs && app->m_LookForSubtitles) LookForSubtitles();
- }
-
-}
-
-BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
-{
- int ID = LOWORD(wParam);
- Osmo4 *app = GetApp();
-
- if ( (ID>=ID_VP_0) && (ID<=ID_VP_0+nb_viewpoints)) {
- ID -= ID_VP_0;
- gf_term_set_viewpoint(app->m_term, ID+1, NULL);
- return TRUE;
- }
- if ( (ID>=ID_NAV_PREV_0) && (ID<=ID_NAV_PREV_9)) {
- ID -= ID_NAV_PREV_0;
- s32 prev = m_pPlayList->m_cur_entry - ID;
- if (prev>=0) {
- m_pPlayList->m_cur_entry = prev;
- m_pPlayList->PlayPrev();
- }
- return TRUE;
- }
- if ( (ID>=ID_NAV_NEXT_0) && (ID<=ID_NAV_NEXT_9)) {
- ID -= ID_NAV_NEXT_0;
- u32 next = m_pPlayList->m_cur_entry + ID;
- if (next < gf_list_count(m_pPlayList->m_entries) ) {
- m_pPlayList->m_cur_entry = next;
- m_pPlayList->PlayNext();
- }
- return TRUE;
- }
- if ( (ID>=ID_SELOBJ_0) && (ID<=ID_SELOBJ_29)) {
- ID -= ID_SELOBJ_0;
- GF_ObjectManager *root_od = gf_term_get_root_object(app->m_term);
- if (!root_od) return TRUE;
- GF_ObjectManager *odm = gf_term_get_object(app->m_term, root_od, ID);
- gf_term_select_object(app->m_term, odm);
- return TRUE;
- }
- if ( (ID>=ID_SETCHAP_FIRST) && (ID<=ID_SETCHAP_LAST)) {
- ID -= ID_SETCHAP_FIRST;
- gf_term_play_from_time(app->m_term, (u32) (1000*m_chapters_start[ID]), 0);
- return TRUE;
- }
- return CFrameWnd::OnCommand(wParam, lParam);
-}
-
-void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT ID, BOOL bSys)
-{
- Osmo4 *app = GetApp();
- /*viewport list*/
- if (pPopupMenu->GetMenuItemID(0)==ID_VP_0) {
- for (int i=0; i<nb_viewpoints; i++) {
- const char *szName;
- Bool bound;
- GF_Err e = gf_term_get_viewpoint(app->m_term, i+1, &szName, &bound);
- pPopupMenu->EnableMenuItem(i, MF_BYPOSITION);
- if (bound) pPopupMenu->CheckMenuItem(i, MF_BYPOSITION | MF_CHECKED);
- }
- return;
- }
- /*navigation*/
- if ((pPopupMenu->GetMenuItemID(0)==ID_NAV_PREV_0) || (pPopupMenu->GetMenuItemID(0)==ID_NAV_NEXT_0)) {
- int count = pPopupMenu->GetMenuItemCount();
- for (int i=0; i<count; i++) {
- pPopupMenu->EnableMenuItem(i, MF_BYPOSITION);
- }
- return;
- }
- /*stream selection*/
- if (pPopupMenu->m_hMenu == GetMenu()->GetSubMenu(2)->m_hMenu) {
- if (!app->m_isopen || !gf_term_get_option(app->m_term, GF_OPT_CAN_SELECT_STREAMS)) {
- pPopupMenu->EnableMenuItem(0, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
- } else {
- pPopupMenu->EnableMenuItem(0, MF_BYPOSITION | MF_ENABLED);
- }
- }
- if ((pPopupMenu->GetMenuItemID(0)>=ID_SELOBJ_0) && (pPopupMenu->GetMenuItemID(0)<=ID_SELOBJ_29)) {
- GF_ObjectManager *root_od = gf_term_get_root_object(app->m_term);
- if (!root_od) return;
-
- int count = pPopupMenu->GetMenuItemCount();
- for (int i=0; i<count; i++) {
- u32 id = pPopupMenu->GetMenuItemID(i) - ID_SELOBJ_0;
- GF_ObjectManager *odm = gf_term_get_object(app->m_term, root_od, id);
- if (!odm) {
- pPopupMenu->EnableMenuItem(i, MF_DISABLED | MF_BYPOSITION);
- } else {
- GF_MediaInfo info;
-
- gf_term_get_object_info(app->m_term, odm, &info);
- pPopupMenu->EnableMenuItem(i, MF_BYPOSITION);
- pPopupMenu->CheckMenuItem(i, MF_BYPOSITION | (info.status ? MF_CHECKED : MF_UNCHECKED) );
- }
- }
- return;
- }
- /*chapters*/
- if (pPopupMenu->m_hMenu == GetMenu()->GetSubMenu(2)->m_hMenu) {
- if (!app->m_isopen || !m_num_chapters) {
- pPopupMenu->EnableMenuItem(1, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
- } else {
- pPopupMenu->EnableMenuItem(1, MF_BYPOSITION | MF_ENABLED);
- }
- }
- if ((pPopupMenu->GetMenuItemID(0)>=ID_SETCHAP_FIRST) && (pPopupMenu->GetMenuItemID(0)<=ID_SETCHAP_LAST)) {
- Double now = gf_term_get_time_in_ms(app->m_term);
- now /= 1000;
-
- int count = pPopupMenu->GetMenuItemCount();
- for (int i=0; i<count; i++) {
- u32 id = pPopupMenu->GetMenuItemID(i) - ID_SETCHAP_FIRST;
- pPopupMenu->EnableMenuItem(i, MF_BYPOSITION);
-
- Bool is_current = GF_FALSE;
- if (m_chapters_start[id]<=now) {
- if (id+1<m_num_chapters) {
- if (m_chapters_start[id+1]>now) is_current = GF_TRUE;
- } else {
- is_current = GF_TRUE;
- }
- }
- pPopupMenu->CheckMenuItem(i, MF_BYPOSITION | (is_current ? MF_CHECKED : MF_UNCHECKED));
- }
- return;
- }
- /*default*/
- CFrameWnd::OnInitMenuPopup(pPopupMenu, ID, bSys);
-}
-
-void CMainFrame::OnCollideDisp()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_COLLISION, GF_COLLISION_DISPLACEMENT);
-}
-
-void CMainFrame::OnUpdateCollideDisp(CCmdUI* pCmdUI)
-{
- Osmo4 *gpac = GetApp();
- pCmdUI->Enable(gpac->m_isopen);
- pCmdUI->SetCheck( (gf_term_get_option(gpac->m_term, GF_OPT_COLLISION) == GF_COLLISION_DISPLACEMENT) ? 1 : 0);
-}
-
-void CMainFrame::OnCollideNone()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_COLLISION, GF_COLLISION_NONE);
-}
-
-void CMainFrame::OnUpdateCollideNone(CCmdUI* pCmdUI)
-{
- Osmo4 *gpac = GetApp();
- pCmdUI->Enable(gpac->m_isopen);
- pCmdUI->SetCheck( (gf_term_get_option(gpac->m_term, GF_OPT_COLLISION) == GF_COLLISION_NONE) ? 1 : 0);
-}
-
-void CMainFrame::OnCollideReg()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_COLLISION, GF_COLLISION_NORMAL);
-}
-
-void CMainFrame::OnUpdateCollideReg(CCmdUI* pCmdUI)
-{
- Osmo4 *gpac = GetApp();
- pCmdUI->Enable(gpac->m_isopen);
- pCmdUI->SetCheck( (gf_term_get_option(gpac->m_term, GF_OPT_COLLISION) == GF_COLLISION_NORMAL) ? 1 : 0);
-}
-
-void CMainFrame::OnHeadlight()
-{
- Osmo4 *app = GetApp();
- Bool val = gf_term_get_option(app->m_term, GF_OPT_HEADLIGHT) ? GF_FALSE : GF_TRUE;
- gf_term_set_option(app->m_term, GF_OPT_HEADLIGHT, val);
-}
-
-void CMainFrame::OnUpdateHeadlight(CCmdUI* pCmdUI)
-{
- Osmo4 *app = GetApp();
- pCmdUI->Enable(FALSE);
- if (!app->m_isopen) return;
- u32 type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION_TYPE);
- if (type!=GF_NAVIGATE_TYPE_3D) return;
-
- pCmdUI->Enable(TRUE);
- pCmdUI->SetCheck(gf_term_get_option(app->m_term, GF_OPT_HEADLIGHT) ? 1 : 0);
-}
-
-void CMainFrame::OnGravity()
-{
- Osmo4 *app = GetApp();
- Bool val = gf_term_get_option(app->m_term, GF_OPT_GRAVITY) ? GF_FALSE : GF_TRUE;
- gf_term_set_option(app->m_term, GF_OPT_GRAVITY, val);
-}
-
-void CMainFrame::OnUpdateGravity(CCmdUI* pCmdUI)
-{
- Osmo4 *app = GetApp();
- pCmdUI->Enable(FALSE);
- if (!app->m_isopen) return;
- u32 type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION_TYPE);
- if (type!=GF_NAVIGATE_TYPE_3D) return;
- type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION);
- if (type != GF_NAVIGATE_WALK) return;
- pCmdUI->Enable(TRUE);
- pCmdUI->SetCheck(gf_term_get_option(app->m_term, GF_OPT_GRAVITY) ? 1 : 0);
-}
-
-
-BOOL CMainFrame::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
-{
-
- if (((LPNMHDR)lParam)->code == TBN_DROPDOWN) {
- RECT rc;
- s32 i, count, start;
- POINT pt;
- CMenu *pPopup = new CMenu();
- pPopup->CreatePopupMenu();
-
- m_wndToolBar.GetWindowRect(&rc);
- pt.y = rc.bottom;
- pt.x = rc.left;
- m_wndToolBar.GetToolBarCtrl().GetItemRect(0, &rc);
- pt.x += (rc.right - rc.left);
- m_wndToolBar.GetToolBarCtrl().GetItemRect(1, &rc);
- pt.x += (rc.right - rc.left);
-
- count = gf_list_count(m_pPlayList->m_entries);
- if ( ((LPNMTOOLBAR)lParam)->iItem == ID_NAV_PREV) {
- start = m_pPlayList->m_cur_entry - 1;
- for (i=0; i<10; i++) {
- if (start - i < 0) break;
- if (start - i >= count) break;
- PLEntry *ple = (PLEntry *) gf_list_get(m_pPlayList->m_entries, start - i);
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_NAV_PREV_0 + i, ple->m_disp_name);
- }
- } else {
- start = m_pPlayList->m_cur_entry + 1;
- for (i=0; i<10; i++) {
- if (start + i >= count) break;
- PLEntry *ple = (PLEntry *) gf_list_get(m_pPlayList->m_entries, start + i);
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_NAV_NEXT_0 + i, ple->m_disp_name);
- }
- m_wndToolBar.GetToolBarCtrl().GetItemRect(2, &rc);
- pt.x += (rc.right - rc.left);
- }
- pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, this);
- delete pPopup;
-
- return FALSE;
- }
- return CFrameWnd::OnNotify(wParam, lParam, pResult);
-}
-
-void CMainFrame::OnNavNext()
-{
- Osmo4 *app = GetApp();
- /*don't play if last could trigger playlist loop*/
- if ((m_pPlayList->m_cur_entry<0) || (gf_list_count(m_pPlayList->m_entries) == 1 + (u32) m_pPlayList->m_cur_entry)) return;
- m_pPlayList->PlayNext();
-}
-
-void CMainFrame::OnUpdateNavNext(CCmdUI* pCmdUI)
-{
- if (m_pPlayList->m_cur_entry<0) pCmdUI->Enable(FALSE);
- else if ((u32) m_pPlayList->m_cur_entry + 1 == gf_list_count(m_pPlayList->m_entries) ) pCmdUI->Enable(FALSE);
- else pCmdUI->Enable(TRUE);
-}
-
-void CMainFrame::OnNavPrev()
-{
- Osmo4 *app = GetApp();
- if (m_pPlayList->m_cur_entry<=0) return;
- m_pPlayList->PlayPrev();
-}
-
-void CMainFrame::OnUpdateNavPrev(CCmdUI* pCmdUI)
-{
- if (m_pPlayList->m_cur_entry<=0) pCmdUI->Enable(FALSE);
- else pCmdUI->Enable(TRUE);
-}
-
-
-void CMainFrame::OnClearNav()
-{
- m_pPlayList->ClearButPlaying();
-}
-
-void CMainFrame::OnViewPlaylist()
-{
- m_pPlayList->ShowWindow(m_pPlayList->IsWindowVisible() ? SW_HIDE : SW_SHOW);
-}
-
-void CMainFrame::OnUpdateViewPlaylist(CCmdUI* pCmdUI)
-{
- pCmdUI->SetCheck(m_pPlayList->IsWindowVisible() ? 1 : 0);
-}
-void CMainFrame::OnPlaylistLoop()
-{
- GetApp()->m_Loop = GetApp()->m_Loop ? GF_FALSE : GF_TRUE;
- gf_cfg_set_key(GetApp()->m_user.config, "General", "PlaylistLoop", GetApp()->m_Loop ? "yes" : "no");
-}
-
-void CMainFrame::OnUpdatePlaylistLoop(CCmdUI* pCmdUI)
-{
- pCmdUI->SetCheck(GetApp()->m_Loop ? GF_TRUE : GF_FALSE);
-}
-
-void CMainFrame::OnAddSubtitle()
-{
- CFileDialog fd(TRUE,NULL,NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, "All Subtitles|*.srt;*.sub;*.ttxt;*.xml|SRT Subtitles|*.srt|SUB Subtitles|*.sub|3GPP TimedText|*.ttxt|QuckTime TeXML|*.xml|");
- if (fd.DoModal() != IDOK) return;
-
- AddSubtitle(fd.GetPathName(), GF_TRUE);
-}
-
-void CMainFrame::AddSubtitle(const char *fileName, Bool auto_play)
-{
- gf_term_add_object(GetApp()->m_term, fileName, auto_play);
-}
-
-static Bool subs_enum_dir_item(void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info)
-{
- CMainFrame *_this = (CMainFrame *)cbck;
- _this->AddSubtitle(item_path, GF_FALSE);
- return GF_FALSE;
-}
-
-void CMainFrame::LookForSubtitles()
-{
- char dir[GF_MAX_PATH];
- CString url = m_pPlayList->GetURL();
- strcpy(dir, url);
- char *sep = strrchr(dir, '\\');
- if (!sep) ::GetCurrentDirectory(GF_MAX_PATH, dir);
- else sep[0] = 0;
-
- gf_enum_directory(dir, GF_FALSE, subs_enum_dir_item, this, "ttxt;srt");
-}
-
-void CMainFrame::OnCacheEnable()
-{
- Osmo4 *app = GetApp();
- u32 state = gf_term_get_option(app->m_term, GF_OPT_MEDIA_CACHE);
- if (state==GF_MEDIA_CACHE_DISABLED) {
- gf_term_set_option(app->m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_ENABLED);
- } else if (state==GF_MEDIA_CACHE_DISABLED) {
- gf_term_set_option(app->m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISABLED);
- }
-}
-
-void CMainFrame::OnUpdateCacheEnable(CCmdUI* pCmdUI)
-{
- Osmo4 *app = GetApp();
- u32 state = gf_term_get_option(app->m_term, GF_OPT_MEDIA_CACHE);
- switch (state) {
- case GF_MEDIA_CACHE_ENABLED:
- pCmdUI->SetText("Enabled");
- pCmdUI->Enable(TRUE);
- break;
- case GF_MEDIA_CACHE_RUNNING:
- pCmdUI->SetText("Running");
- pCmdUI->Enable(FALSE);
- break;
- case GF_MEDIA_CACHE_DISABLED:
- pCmdUI->SetText("Disabled");
- break;
- }
-}
-
-void CMainFrame::OnUpdateCacheStop(CCmdUI* pCmdUI)
-{
- Osmo4 *app = GetApp();
- u32 state = gf_term_get_option(app->m_term, GF_OPT_MEDIA_CACHE);
- pCmdUI->Enable( (state==GF_MEDIA_CACHE_RUNNING) ? TRUE : FALSE);
-}
-
-void CMainFrame::OnCacheStop()
-{
- Osmo4 *app = GetApp();
- gf_term_set_option(app->m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISABLED);
-}
-void CMainFrame::OnCacheAbort()
-{
- Osmo4 *app = GetApp();
- gf_term_set_option(app->m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISCARD);
-}
-
-void CMainFrame::OnFileExit()
-{
- DestroyWindow();
-}
-
-
-void CMainFrame::BuildChapterList(Bool reset_only)
-{
- CMenu *pChaps;
- GF_MediaInfo odi;
- NetInfoCommand com;
- Osmo4 *app = GetApp();
-
- /*THIS IS HARCODED FROM THE MENU LAYOUT */
- pChaps = GetMenu()->GetSubMenu(2)->GetSubMenu(1);
- while (pChaps->GetMenuItemCount()) pChaps->DeleteMenu(0, MF_BYPOSITION);
-
- if (m_chapters_start) gf_free(m_chapters_start);
- m_chapters_start = NULL;
- m_num_chapters = 0;
- if (reset_only) return;
-
- GF_ObjectManager *root_od = gf_term_get_root_object(app->m_term);
- if (!root_od) return;
- if (gf_term_get_object_info(app->m_term, root_od, &odi) != GF_OK) return;
-
- u32 count = gf_list_count(odi.od->OCIDescriptors);
- m_num_chapters = 0;
- for (u32 i=0; i<count; i++) {
- char szLabel[1024];
- GF_Segment *seg = (GF_Segment *) gf_list_get(odi.od->OCIDescriptors, i);
- if (seg->tag != GF_ODF_SEGMENT_TAG) continue;
-
- if (seg->SegmentName && strlen((const char *)seg->SegmentName)) {
- strcpy(szLabel, (const char *) seg->SegmentName);
- } else {
- sprintf(szLabel, "Chapter #%02d", m_num_chapters+1);
- }
- pChaps->AppendMenu(MF_ENABLED, ID_SETCHAP_FIRST + m_num_chapters, szLabel);
-
- m_chapters_start = (Double *) gf_realloc(m_chapters_start, sizeof(Double)*(m_num_chapters+1));
- m_chapters_start[m_num_chapters] = seg->startTime;
- m_num_chapters++;
- }
-
- /*get any service info*/
- if (!m_bStartupFile && gf_term_get_service_info(app->m_term, root_od, &com) == GF_OK) {
- CString title("");
- if (com.track_info) {
- title.Format("%02d ", (u32) (com.track_info>>16) );
- }
- if (com.artist) {
- title += com.artist;
- title += " ";
- }
- if (com.name) {
- title += com.name;
- title += " ";
- }
- if (com.album) {
- title += "(";
- title += com.album;
- title += ")";
- }
-
- if (title.GetLength()) SetWindowText(title);
- }
-}
-
-void CMainFrame::OnViewCPU()
-{
- m_show_rti = m_show_rti ? GF_FALSE : GF_TRUE;
-}
-
-void CMainFrame::OnUpdateViewCPU(CCmdUI* pCmdUI)
-{
- pCmdUI->Enable(TRUE);
- pCmdUI->SetCheck(m_show_rti);
-}
-
-
-void CMainFrame::OnFileCopy()
-{
- size_t len;
- const char *text = gf_term_get_text_selection(GetApp()->m_term, GF_FALSE);
- if (!text) return;
-
- if (!IsClipboardFormatAvailable(CF_TEXT)) return;
- if (!OpenClipboard()) return;
- EmptyClipboard();
-
- len = strlen(text);
- if (!len) return;
-
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(char));
- LPTSTR lptstrCopy = (char *) GlobalLock(hglbCopy);
- memcpy(lptstrCopy, text, len * sizeof(char));
- lptstrCopy[len] = 0;
- GlobalUnlock(hglbCopy);
- SetClipboardData(CF_TEXT, hglbCopy);
- CloseClipboard();
-}
-
-void CMainFrame::OnUpdateFileCopy(CCmdUI* pCmdUI)
-{
- Osmo4 *app = GetApp();
- if (IsClipboardFormatAvailable(CF_TEXT)
- && app->m_term
- && (gf_term_get_text_selection(app->m_term, GF_TRUE)!=NULL)
- ) {
- pCmdUI->Enable(TRUE);
- } else {
- pCmdUI->Enable(FALSE);
- }
-}
-
-
-void CMainFrame::OnFilePaste()
-{
- if (!IsClipboardFormatAvailable(CF_TEXT)) return;
- if (!OpenClipboard()) return;
-
- HGLOBAL hglbCopy = GetClipboardData(CF_TEXT);
- if (hglbCopy) {
- LPTSTR lptstrCopy = (char *) GlobalLock(hglbCopy);
- gf_term_paste_text(GetApp()->m_term, lptstrCopy, GF_FALSE);
- GlobalUnlock(hglbCopy);
- }
- CloseClipboard();
-}
-
-void CMainFrame::OnUpdateFilePaste(CCmdUI* pCmdUI)
-{
- Osmo4 *app = GetApp();
- if (IsClipboardFormatAvailable(CF_TEXT)
- && app->m_term
- && (gf_term_paste_text(app->m_term, NULL, GF_TRUE)==GF_OK)
- ) {
- pCmdUI->Enable(TRUE);
- } else {
- pCmdUI->Enable(FALSE);
- }
-}
-
-
+++ /dev/null
-// MainFrm.h : interface of the CMainFrame class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_MAINFRM_H__3666B63B_D886_4F0B_9953_A2AF09E3C15A__INCLUDED_)
-#define AFX_MAINFRM_H__3666B63B_D886_4F0B_9953_A2AF09E3C15A__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include <gpac/tools.h>
-#include <gpac/constants.h>
-#include <gpac/modules/service.h>
-#include <gpac/options.h>
-
-#include "FileProps.h"
-#include "Options.h"
-#include "AddressBar.h"
-#include "Sliders.h"
-#include "Playlist.h"
-
-
-class CChildView : public CWnd
-{
-// Construction
-public:
- CChildView();
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CChildView)
-protected:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CChildView();
-
- // Generated message map functions
-protected:
- //{{AFX_MSG(CChildView)
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-
-class CMainFrame : public CFrameWnd
-{
-
-public:
- CMainFrame();
-protected:
- DECLARE_DYNAMIC(CMainFrame)
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMainFrame)
-public:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
- virtual BOOL DestroyWindow();
-protected:
- virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CMainFrame();
-#ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
-#endif
-
-public:
- CStatusBar m_wndStatusBar;
- CToolBar m_wndToolBar;
- Sliders m_Sliders;
- AddressBar m_Address;
- CFileProps *m_pProps;
- COptions *m_pOpt;
- Playlist *m_pPlayList;
- CChildView *m_pWndView;
- Bool m_bFullScreen;
- u32 m_RestoreFS;
- UINT_PTR m_timer_on;
- CString console_message;
- CString console_service;
- GF_Err console_err;
- u32 m_aspect_ratio;
- RECT backup_wnd_rc;
- Bool m_bFirstStreamQuery;
- /*filter progress events to avoid killing importers with status bar text display...*/
- s32 m_last_prog;
- Bool m_show_rti;
- Bool m_bStartupFile;
-
-public:
- void SetFullscreen();
- void BuildViewList();
- void BuildStreamList(Bool reset_ony);
- void BuildChapterList(Bool reset_ony);
- void SetProgTimer(Bool bOn);
- void AddSubtitle(const char *fileName, Bool auto_play);
-
-private:
- void ForwardMessage();
- HICON m_icoerror, m_icomessage;
- s32 nb_viewpoints;
- Bool m_bInitShow;
-
- void SetNavigate(u32 mode);
- void LookForSubtitles();
-
- Double *m_chapters_start;
- u32 m_num_chapters;
-
-
-// Generated message map functions
-protected:
- //{{AFX_MSG(CMainFrame)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSetFocus(CWnd *pOldWnd);
- afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
- afx_msg BOOL OnCommand(WPARAM wParam, LPARAM lParam);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnMove(int x, int y);
- afx_msg LRESULT OnSetSize(WPARAM wParam, LPARAM lParam);
- afx_msg LRESULT OnNavigate(WPARAM wParam, LPARAM lParam);
- afx_msg LRESULT Open(WPARAM wParam, LPARAM lParam);
- afx_msg LRESULT NewInstanceOpened(WPARAM wParam, LPARAM lParam);
-
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnChar( UINT nChar, UINT nRepCnt, UINT nFlags );
- afx_msg void OnSysKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags );
- afx_msg void OnSysKeyUp( UINT nChar, UINT nRepCnt, UINT nFlags );
- afx_msg void OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags );
- afx_msg void OnKeyUp( UINT nChar, UINT nRepCnt, UINT nFlags );
- afx_msg void OnDropFiles(HDROP hDropInfo);
- afx_msg LRESULT OnConsoleMessage(WPARAM wParam, LPARAM lParam);
- afx_msg void OnViewOriginal();
- afx_msg void OnViewFullscreen();
- afx_msg void OnArKeep();
- afx_msg void OnArFill();
- afx_msg void OnAr43();
- afx_msg void OnAr169();
- afx_msg void OnUpdateAr169(CCmdUI* pCmdUI);
- afx_msg void OnUpdateAr43(CCmdUI* pCmdUI);
- afx_msg void OnUpdateArFill(CCmdUI* pCmdUI);
- afx_msg void OnUpdateArKeep(CCmdUI* pCmdUI);
- afx_msg void OnNavigateNone();
- afx_msg void OnNavigateWalk();
- afx_msg void OnNavigateFly();
- afx_msg void OnNavigateExam();
- afx_msg void OnNavigateSlide();
- afx_msg void OnNavigatePan();
- afx_msg void OnNavigateOrbit();
- afx_msg void OnNavigateGame();
- afx_msg void OnNavigateVR();
- afx_msg void OnNavigateReset();
- afx_msg void OnShortcuts();
- afx_msg void OnConfigure();
- afx_msg void OnFileProp();
- afx_msg void OnViewPlaylist();
- afx_msg void OnUpdateFileProp(CCmdUI* pCmdUI);
- afx_msg void OnUpdateNavigate(CCmdUI* pCmdUI);
- afx_msg void OnCacheEnable();
- afx_msg void OnUpdateCacheEnable(CCmdUI* pCmdUI);
- afx_msg void OnCacheStop();
- afx_msg void OnCacheAbort();
- afx_msg void OnUpdateCacheStop(CCmdUI* pCmdUI);
- afx_msg void OnCollideDisp();
- afx_msg void OnUpdateCollideDisp(CCmdUI* pCmdUI);
- afx_msg void OnCollideNone();
- afx_msg void OnUpdateCollideNone(CCmdUI* pCmdUI);
- afx_msg void OnCollideReg();
- afx_msg void OnUpdateCollideReg(CCmdUI* pCmdUI);
- afx_msg void OnHeadlight();
- afx_msg void OnUpdateHeadlight(CCmdUI* pCmdUI);
- afx_msg void OnGravity();
- afx_msg void OnUpdateGravity(CCmdUI* pCmdUI);
- afx_msg void OnNavInfo();
- afx_msg void OnNavNext();
- afx_msg void OnNavPrev();
- afx_msg void OnUpdateNavNext(CCmdUI* pCmdUI);
- afx_msg void OnUpdateNavPrev(CCmdUI* pCmdUI);
- afx_msg void OnClearNav();
- afx_msg void OnUpdateViewPlaylist(CCmdUI* pCmdUI);
- afx_msg void OnPlaylistLoop();
- afx_msg void OnUpdatePlaylistLoop(CCmdUI* pCmdUI);
- afx_msg void OnAddSubtitle();
- afx_msg void OnFileExit();
- afx_msg void OnViewCPU();
- afx_msg void OnUpdateViewCPU(CCmdUI* pCmdUI);
- afx_msg void OnFileCopy();
- afx_msg void OnUpdateFileCopy(CCmdUI* pCmdUI);
- afx_msg void OnFilePaste();
- afx_msg void OnUpdateFilePaste(CCmdUI* pCmdUI);
-
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MAINFRM_H__3666B63B_D886_4F0B_9953_A2AF09E3C15A__INCLUDED_)
+++ /dev/null
-// OpenUrl.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include "OpenUrl.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// COpenUrl dialog
-
-
-COpenUrl::COpenUrl(CWnd* pParent /*=NULL*/)
- : CDialog(COpenUrl::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COpenUrl)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void COpenUrl::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COpenUrl)
- DDX_Control(pDX, IDC_COMBOURL, m_URLs);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COpenUrl, CDialog)
- //{{AFX_MSG_MAP(COpenUrl)
- ON_BN_CLICKED(IDC_BUTGO, OnButgo)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-
-
-#define MAX_LAST_FILES 20
-void UpdateLastFiles(GF_Config *cfg, const char *URL)
-{
- u32 nb_entries;
- gf_cfg_set_key(cfg, "RecentFiles", URL, NULL);
- gf_cfg_insert_key(cfg, "RecentFiles", URL, "", 0);
- /*remove last entry if needed*/
- nb_entries = gf_cfg_get_key_count(cfg, "RecentFiles");
- if (nb_entries>MAX_LAST_FILES) {
- gf_cfg_set_key(cfg, "RecentFiles", gf_cfg_get_key_name(cfg, "RecentFiles", nb_entries-1), NULL);
- }
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// COpenUrl message handlers
-
-void COpenUrl::OnButgo()
-{
- CString URL;
- int sel = m_URLs.GetCurSel();
- if (sel == CB_ERR) {
- m_URLs.GetWindowText(URL);
- } else {
- m_URLs.GetLBText(sel, URL);
- }
- if (!URL.GetLength()) {
- EndDialog(IDCANCEL);
- return;
- }
-
- Osmo4 *gpac = GetApp();
-
- m_url = URL;
- UpdateLastFiles(gpac->m_user.config, (const char *) URL);
- EndDialog(IDOK);
-}
-
-BOOL COpenUrl::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- u32 i=0;
-
- while (m_URLs.GetCount()) m_URLs.DeleteString(0);
- while (1) {
- const char *sOpt = gf_cfg_get_key_name(gpac->m_user.config, "RecentFiles", i);
- if (!sOpt) break;
- m_URLs.AddString(sOpt);
- i++;
- }
- return TRUE;
-}
+++ /dev/null
-#if !defined(AFX_OPENURL_H__ADB51A74_305E_4183_8D44_03EEB83D2BFA__INCLUDED_)
-#define AFX_OPENURL_H__ADB51A74_305E_4183_8D44_03EEB83D2BFA__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// OpenUrl.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// COpenUrl dialog
-
-class COpenUrl : public CDialog
-{
-// Construction
-public:
- COpenUrl(CWnd* pParent = NULL); // standard constructor
- CString m_url;
-
-// Dialog Data
- //{{AFX_DATA(COpenUrl)
- enum { IDD = IDD_OPENFILE };
- CComboBox m_URLs;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COpenUrl)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COpenUrl)
- afx_msg void OnBrowse();
- afx_msg void OnButgo();
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OPENURL_H__ADB51A74_305E_4183_8D44_03EEB83D2BFA__INCLUDED_)
+++ /dev/null
-// Options.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include "MainFrm.h"
-
-#include <gpac/modules/codec.h>
-#include <gpac/modules/raster2d.h>
-#include <gpac/modules/font.h>
-#include <gpac/modules/audio_out.h>
-#include <gpac/modules/video_out.h>
-
-#include <gpac/iso639.h>
-#include "Options.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions dialog
-
-
-COptions::COptions(CWnd* pParent /*=NULL*/)
- : CDialog(COptions::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptions)
- //}}AFX_DATA_INIT
-}
-
-
-void COptions::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptions)
- DDX_Control(pDX, IDC_SELECT, m_Selector);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptions, CDialog)
- //{{AFX_MSG_MAP(COptions)
- ON_BN_CLICKED(IDC_SAVEOPT, OnSaveopt)
- ON_WM_CLOSE()
- ON_WM_DESTROY()
- ON_CBN_SELCHANGE(IDC_SELECT, OnSelchangeSelect)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-BOOL COptions::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- m_general.Create(IDD_OPT_GEN, this);
- m_systems.Create(IDD_OPT_SYSTEMS, this);
- m_render.Create(IDD_OPT_RENDER, this);
- m_render2d.Create(IDD_OPT_RENDER2D, this);
- m_render3d.Create(IDD_OPT_RENDER3D, this);
- m_decoder.Create(IDD_OPT_DECODER, this);
- m_audio.Create(IDD_OPT_AUDIO, this);
- m_video.Create(IDD_OPT_VIDEO, this);
- m_http.Create(IDD_OPT_HTTP, this);
- m_font.Create(IDD_OPT_FONT, this);
- m_stream.Create(IDD_OPT_STREAM, this);
- m_cache.Create(IDD_OPT_MCACHE, this);
- m_files.Create(IDD_OPT_FILETYPES, this);
- m_logs.Create(IDD_OPT_LOGS, this);
-
- m_Selector.AddString("General");
- m_Selector.AddString("MPEG-4 Systems");
- m_Selector.AddString("Media Decoders");
- m_Selector.AddString("Compositor");
- m_Selector.AddString("2D Drawing");
- m_Selector.AddString("3D Drawing");
- m_Selector.AddString("Video Output");
- m_Selector.AddString("Audio Output");
- m_Selector.AddString("Text Engine");
- m_Selector.AddString("File Download");
- m_Selector.AddString("Real-Time Streaming");
- m_Selector.AddString("Streaming Cache");
- m_Selector.AddString("File Types");
- m_Selector.AddString("Log System");
-
- HideAll();
-
- const char *sOpt = gf_cfg_get_key(GetApp()->m_user.config, "General", "ConfigPanel");
- u32 sel = sOpt ? atoi(sOpt) : 0;
- if (sel>13) sel=13;
- m_Selector.SetCurSel(sel);
- m_general.ShowWindow(SW_SHOW);
-
- OnSelchangeSelect();
-
- return TRUE;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions message handlers
-
-void COptions::HideAll()
-{
- m_general.ShowWindow(SW_HIDE);
- m_systems.ShowWindow(SW_HIDE);
- m_render.ShowWindow(SW_HIDE);
- m_render2d.ShowWindow(SW_HIDE);
- m_render3d.ShowWindow(SW_HIDE);
- m_audio.ShowWindow(SW_HIDE);
- m_video.ShowWindow(SW_HIDE);
- m_http.ShowWindow(SW_HIDE);
- m_font.ShowWindow(SW_HIDE);
- m_stream.ShowWindow(SW_HIDE);
- m_decoder.ShowWindow(SW_HIDE);
- m_cache.ShowWindow(SW_HIDE);
- m_files.ShowWindow(SW_HIDE);
- m_files.ShowWindow(SW_HIDE);
- m_logs.ShowWindow(SW_HIDE);
-}
-
-void COptions::OnSelchangeSelect()
-{
- HideAll();
- switch (m_Selector.GetCurSel()) {
- case 0:
- m_general.ShowWindow(SW_SHOW);
- break;
- case 1:
- m_systems.ShowWindow(SW_SHOW);
- break;
- case 2:
- m_decoder.ShowWindow(SW_SHOW);
- break;
- case 3:
- m_render.ShowWindow(SW_SHOW);
- break;
- case 4:
- m_render2d.ShowWindow(SW_SHOW);
- break;
- case 5:
- m_render3d.ShowWindow(SW_SHOW);
- break;
- case 6:
- m_video.ShowWindow(SW_SHOW);
- break;
- case 7:
- m_audio.ShowWindow(SW_SHOW);
- break;
- case 8:
- m_font.ShowWindow(SW_SHOW);
- break;
- case 9:
- m_http.ShowWindow(SW_SHOW);
- break;
- case 10:
- m_stream.ShowWindow(SW_SHOW);
- break;
- case 11:
- m_cache.ShowWindow(SW_SHOW);
- break;
- case 12:
- m_files.ShowWindow(SW_SHOW);
- break;
- case 13:
- m_logs.ShowWindow(SW_SHOW);
- break;
- }
-}
-
-void COptions::OnSaveopt()
-{
- m_general.SaveOptions();
- m_systems.SaveOptions();
- m_decoder.SaveOptions();
- m_render.SaveOptions();
- m_render2d.SaveOptions();
- m_render3d.SaveOptions();
- m_audio.SaveOptions();
- m_video.SaveOptions();
- m_http.SaveOptions();
- m_font.SaveOptions();
- m_stream.SaveOptions();
- m_cache.SaveOptions();
- m_logs.SaveOptions();
-
- Osmo4 *gpac = GetApp();
- gf_term_set_option(gpac->m_term, GF_OPT_RELOAD_CONFIG, 1);
- m_render2d.SetYUV();
-}
-
-void COptions::OnClose()
-{
- char str[20];
- sprintf(str, "%d", m_Selector.GetCurSel());
- gf_cfg_set_key(GetApp()->m_user.config, "General", "ConfigPanel", str);
-
- DestroyWindow();
-}
-
-void COptions::OnDestroy()
-{
- CDialog::OnDestroy();
- delete this;
- ((CMainFrame *)GetApp()->m_pMainWnd)->m_pOpt = NULL;
-}
-
-
-COptGen::COptGen(CWnd* pParent /*=NULL*/)
- : CDialog(COptGen::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptGen)
- //}}AFX_DATA_INIT
-}
-
-
-void COptGen::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptGen)
- DDX_Control(pDX, IDC_LOOKFORSUB, m_LookForSubs);
- DDX_Control(pDX, IDC_DUMP_XMT, m_ViewXMT);
- DDX_Control(pDX, IDC_NO_CONSOLE, m_NoConsole);
- DDX_Control(pDX, IDC_LOOP, m_Loop);
- DDX_Control(pDX, IDC_SINGLE_INSTANCE, m_SingleInstance);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptGen, CDialog)
- //{{AFX_MSG_MAP(COptGen)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptGen message handlers
-
-
-
-BOOL COptGen::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "Loop");
- m_Loop.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "LookForSubtitles");
- m_LookForSubs.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "ConsoleOff");
- m_NoConsole.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "ViewXMT");
- m_ViewXMT.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "SingleInstance");
- m_SingleInstance.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- return TRUE;
-}
-
-void COptGen::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
-
- gpac->m_Loop = (Bool) m_Loop.GetCheck();
- gf_cfg_set_key(gpac->m_user.config, "General", "Loop", gpac->m_Loop ? "yes" : "no");
- gpac->m_LookForSubtitles = (Bool) m_LookForSubs.GetCheck();
- gf_cfg_set_key(gpac->m_user.config, "General", "LookForSubtitles", gpac->m_LookForSubtitles ? "yes" : "no");
- gpac->m_NoConsole = (Bool) m_NoConsole.GetCheck();
- gf_cfg_set_key(gpac->m_user.config, "General", "ConsoleOff", gpac->m_NoConsole ? "yes" : "no");
- gpac->m_ViewXMTA = (Bool) m_ViewXMT.GetCheck();
- gf_cfg_set_key(gpac->m_user.config, "General", "ViewXMT", gpac->m_ViewXMTA ? "yes" : "no");
- gpac->m_SingleInstance = (Bool) m_SingleInstance.GetCheck();
- gf_cfg_set_key(gpac->m_user.config, "General", "SingleInstance", gpac->m_SingleInstance ? "yes" : "no");
-}
-
-COptSystems::COptSystems(CWnd* pParent /*=NULL*/)
- : CDialog(COptSystems::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptSystems)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void COptSystems::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptSystems)
- DDX_Control(pDX, IDC_FORCE_DURATION, m_ForceDuration);
- DDX_Control(pDX, IDC_DEC_THREAD, m_Threading);
- DDX_Control(pDX, IDC_BIFSDROP, m_LateFramesAlwaysDrawn);
- DDX_Control(pDX, IDC_LANG, m_Lang);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptSystems, CDialog)
- //{{AFX_MSG_MAP(COptSystems)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptSystems message handlers
-
-
-
-
-
-BOOL COptSystems::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "Language3CC");
- if (!sOpt) sOpt = "eng";
- s32 select = 0;
- while (m_Lang.GetCount()) m_Lang.DeleteString(0);
- u32 i, count = gf_lang_get_count();
- for (i=0; i<count; i++) {
- const char *n2c = gf_lang_get_2cc(i);
- const char *n3c = gf_lang_get_3cc(i);
-
- m_Lang.AddString(gf_lang_get_name(i) );
- if (sOpt && n3c && !stricmp(sOpt, n3c))
- select = m_Lang.GetCount() - 1;
- }
- m_Lang.SetCurSel(select);
-
-
- /*system config*/
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "ThreadingPolicy");
- select = 0;
- while (m_Threading.GetCount()) m_Threading.DeleteString(0);
- m_Threading.AddString("Single Thread");
- m_Threading.AddString("Mutli Thread");
- if (sOpt && !stricmp(sOpt, "Multi")) select = 1;
- m_Threading.AddString("Free");
- if (sOpt && !stricmp(sOpt, "Free")) select = 2;
- m_Threading.SetCurSel(select);
-
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "ForceSingleClock");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_ForceDuration.SetCheck(1);
- } else {
- m_ForceDuration.SetCheck(0);
- }
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "DrawLateFrames");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_LateFramesAlwaysDrawn.SetCheck(1);
- } else {
- m_LateFramesAlwaysDrawn.SetCheck(0);
- }
-
-
- return TRUE;
-}
-
-
-void COptSystems::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
-
- s32 sel = m_Lang.GetCurSel();
- u32 i=0;
-
- gf_cfg_set_key(gpac->m_user.config, "Systems", "LanguageName", gf_lang_get_name(i) );
- gf_cfg_set_key(gpac->m_user.config, "Systems", "Language3CC", gf_lang_get_3cc(i) );
- gf_cfg_set_key(gpac->m_user.config, "Systems", "Language2CC", gf_lang_get_2cc(i) );
-
- sel = m_Threading.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Systems", "ThreadingPolicy", (sel==0) ? "Single" : ( (sel==1) ? "Multi" : "Free"));
- gf_cfg_set_key(gpac->m_user.config, "Systems", "ForceSingleClock", m_ForceDuration.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Systems", "DrawLateFrames", m_LateFramesAlwaysDrawn.GetCheck() ? "yes" : "no");
-}
-
-
-OptDecoder::OptDecoder(CWnd* pParent /*=NULL*/)
- : CDialog(OptDecoder::IDD, pParent)
-{
- //{{AFX_DATA_INIT(OptDecoder)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void OptDecoder::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(OptDecoder)
- DDX_Control(pDX, IDC_VIDEC_LIST, m_Video);
- DDX_Control(pDX, IDC_AUDEC_LIST, m_Audio);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(OptDecoder, CDialog)
- //{{AFX_MSG_MAP(OptDecoder)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// OptDecoder message handlers
-
-
-
-BOOL OptDecoder::OnInitDialog()
-{
- u32 i;
- const char *sOpt;
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
-
- /*audio dec enum*/
- while (m_Audio.GetCount()) m_Audio.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "DefAudioDec");
- u32 count = gf_modules_get_count(gpac->m_user.modules);
- GF_BaseDecoder *ifce;
- s32 select = 0;
- s32 to_sel = 0;
- for (i=0; i<count; i++) {
- ifce = (GF_BaseDecoder *) gf_modules_load_interface(gpac->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
- if (!ifce) continue;
-
- if (ifce->CanHandleStream(ifce, GF_STREAM_AUDIO, NULL, 0)) {
- if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
- m_Audio.AddString(ifce->module_name);
- to_sel++;
- }
- gf_modules_close_interface((GF_BaseInterface *)ifce);
- }
- m_Audio.SetCurSel(select);
-
- /*video dec enum*/
- while (m_Video.GetCount()) m_Video.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "DefVideoDec");
- count = gf_modules_get_count(gpac->m_user.modules);
- select = 0;
- to_sel = 0;
- for (i=0; i<count; i++) {
- ifce = (GF_BaseDecoder *) gf_modules_load_interface(gpac->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
- if (!ifce) continue;
-
- if (ifce->CanHandleStream(ifce, GF_STREAM_VISUAL, NULL, 0)) {
- if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
- m_Video.AddString(ifce->module_name);
- to_sel++;
- }
- gf_modules_close_interface((GF_BaseInterface *)ifce);
- }
- m_Video.SetCurSel(select);
- return TRUE;
-}
-
-void OptDecoder::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
- char str[100];
- m_Audio.GetWindowText(str, 100);
- gf_cfg_set_key(gpac->m_user.config, "Systems", "DefAudioDec", str);
- m_Video.GetWindowText(str, 100);
- gf_cfg_set_key(gpac->m_user.config, "Systems", "DefVideoDec", str);
-
-}
-
-COptRender::COptRender(CWnd* pParent /*=NULL*/)
- : CDialog(COptRender::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptRender)
- //}}AFX_DATA_INIT
-}
-
-
-void COptRender::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptRender)
- DDX_Control(pDX, IDC_DRAW_BOUNDS, m_DrawBounds);
- DDX_Control(pDX, IDC_GD_LIST, m_Graphics);
- DDX_Control(pDX, IDC_USE_RENDER3D, m_Use3DRender);
- DDX_Control(pDX, IDC_AA_LIST, m_AntiAlias);
- DDX_Control(pDX, IDC_FORCE_SIZE, m_ForceSize);
- DDX_Control(pDX, IDC_FAST_RENDER, m_HighSpeed);
- DDX_Control(pDX, IDC_BIFS_RATE, m_BIFSRate);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender, CDialog)
- //{{AFX_MSG_MAP(COptRender)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptRender message handlers
-
-
-
-#define NUM_RATES 11
-static char *BIFSRates[11] =
-{
- "5.0",
- "7.5",
- "10.0",
- "12.5",
- "15.0",
- "24.0",
- "25.0",
- "30.0",
- "50.0",
- "60.0",
- "100.0",
-};
-
-
-
-BOOL COptRender::OnInitDialog()
-{
- s32 i;
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "OpenGLMode");
- m_Use3DRender.SetCheck( (sOpt && !strcmp(sOpt, "always")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ForceSceneSize");
- m_ForceSize.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "FrameRate");
- if (!sOpt) sOpt = "30.0";
- s32 select = 0;
- while (m_BIFSRate.GetCount()) m_BIFSRate.DeleteString(0);
- for (i = 0; i<NUM_RATES; i++) {
- m_BIFSRate.AddString(BIFSRates[i]);
- if (sOpt && !stricmp(sOpt, BIFSRates[i]) ) select = i;
- }
- m_BIFSRate.SetCurSel(select);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "HighSpeed");
- m_HighSpeed.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "AntiAlias");
- while (m_AntiAlias.GetCount()) m_AntiAlias.DeleteString(0);
-
- m_AntiAlias.AddString("None");
- m_AntiAlias.AddString("Text only");
- m_AntiAlias.AddString("Complete");
- select = 2;
- if (sOpt && !stricmp(sOpt, "Text")) select = 1;
- else if (sOpt && !stricmp(sOpt, "None")) select = 0;
- m_AntiAlias.SetCurSel(select);
-
- /*graphics driver enum*/
- while (m_Graphics.GetCount()) m_Graphics.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "core", "raster2d");
- s32 count = gf_modules_get_count(gpac->m_user.modules);
- GF_BaseInterface *ifce;
- select = 0;
- u32 to_sel = 0;
- for (i=0; i<count; i++) {
- ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_RASTER_2D_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
- m_Graphics.AddString(ifce->module_name);
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_Graphics.SetCurSel(select);
-
-
- m_DrawBounds.AddString("None");
- m_DrawBounds.AddString("Box/Rect");
- m_DrawBounds.AddString("AABB Tree");
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "BoundingVolume");
- if (sOpt && !stricmp(sOpt, "Box")) m_DrawBounds.SetCurSel(1);
- else if (sOpt && !stricmp(sOpt, "AABB")) m_DrawBounds.SetCurSel(2);
- else m_DrawBounds.SetCurSel(0);
-
- return TRUE;
-}
-
-
-Bool COptRender::SaveOptions()
-{
- char str[50];
- Osmo4 *gpac = GetApp();
-
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "HighSpeed", m_HighSpeed.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "ForceSceneSize", m_ForceSize.GetCheck() ? "yes" : "no");
-
- s32 sel = m_BIFSRate.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "FrameRate", BIFSRates[sel]);
-
- sel = m_AntiAlias.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "AntiAlias", (sel==0) ? "None" : ( (sel==1) ? "Text" : "All"));
-
- sel = m_DrawBounds.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "BoundingVolume", (sel==2) ? "AABB" : (sel==1) ? "Box" : "None");
-
- m_Graphics.GetWindowText(str, 50);
- gf_cfg_set_key(gpac->m_user.config, "core", "raster2d", str);
-
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "OpenGLMode", m_Use3DRender.GetCheck() ? "always" : "disable");
- return GF_FALSE;
-}
-
-
-COptRender2D::COptRender2D(CWnd* pParent /*=NULL*/)
- : CDialog(COptRender2D::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptRender2D)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void COptRender2D::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptRender2D)
- DDX_Control(pDX, IDC_FORMAT_YUV, m_YUVFormat);
- DDX_Control(pDX, IDC_YUV, m_NoYUV);
- DDX_Control(pDX, IDC_ZOOM_SCALABLE, m_Scalable);
- DDX_Control(pDX, IDC_DIRECTRENDER, m_DirectRender);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender2D, CDialog)
- //{{AFX_MSG_MAP(COptRender2D)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptRender2D message handlers
-
-BOOL COptRender2D::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DrawMode");
- if (sOpt && !stricmp(sOpt, "immediate")) {
- m_DirectRender.SetCheck(1);
- } else {
- m_DirectRender.SetCheck(0);
- }
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ScalableZoom");
- if (sOpt && !stricmp(sOpt, "no")) {
- m_Scalable.SetCheck(0);
- } else {
- m_Scalable.SetCheck(1);
- }
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DisableYUV");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_NoYUV.SetCheck(1);
- } else {
- m_NoYUV.SetCheck(0);
- }
-
- SetYUV();
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void COptRender2D::SetYUV()
-{
- Osmo4 *gpac = GetApp();
- u32 yuv_format = gf_term_get_option(gpac->m_term, GF_OPT_YUV_FORMAT);
- if (!yuv_format) {
- m_YUVFormat.SetWindowText("(No YUV used)");
- } else {
- char str[100];
- sprintf(str, "(%s used)", gf_4cc_to_str(yuv_format));
- m_YUVFormat.SetWindowText(str);
- }
-}
-
-void COptRender2D::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "DrawMode", m_DirectRender.GetCheck() ? "immediate" : "defer");
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "ScalableZoom", m_Scalable.GetCheck() ? "yes" : "no");
-
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "DisableYUV", m_NoYUV.GetCheck() ? "yes" : "no");
-}
-
-
-COptRender3D::COptRender3D(CWnd* pParent /*=NULL*/)
- : CDialog(COptRender3D::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptRender3D)
- //}}AFX_DATA_INIT
-}
-
-
-void COptRender3D::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptRender3D)
- DDX_Control(pDX, IDC_BITMAP_USE_PIXEL, m_BitmapPixels);
- DDX_Control(pDX, IDC_DISABLE_TX_RECT, m_DisableTXRect);
- DDX_Control(pDX, IDC_RASTER_OUTLINE, m_RasterOutlines);
- DDX_Control(pDX, IDC_EMUL_POW2, m_EmulPow2);
- DDX_Control(pDX, IDC_DISABLE_POLY_AA, m_PolyAA);
- DDX_Control(pDX, IDC_DRAW_NORMALS, m_DrawNormals);
- DDX_Control(pDX, IDC_BACK_CULL, m_BackCull);
- DDX_Control(pDX, IDC_DRAW_MODE, m_Wireframe);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender3D, CDialog)
- //{{AFX_MSG_MAP(COptRender3D)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptRender3D message handlers
-
-
-BOOL COptRender3D::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- m_DrawNormals.AddString("Never");
- m_DrawNormals.AddString("Per Face");
- m_DrawNormals.AddString("Per Vertex");
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DrawNormals");
- if (sOpt && !stricmp(sOpt, "PerFace")) m_DrawNormals.SetCurSel(1);
- else if (sOpt && !stricmp(sOpt, "PerVertex")) m_DrawNormals.SetCurSel(2);
- else m_DrawNormals.SetCurSel(0);
-
- m_BackCull.AddString("Off");
- m_BackCull.AddString("On");
- m_BackCull.AddString("Alpha");
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "BackFaceCulling");
- if (sOpt && !stricmp(sOpt, "Off")) m_BackCull.SetCurSel(0);
- else if (sOpt && !stricmp(sOpt, "Alpha")) m_BackCull.SetCurSel(2);
- else m_BackCull.SetCurSel(1);
-
- m_Wireframe.AddString("Solid");
- m_Wireframe.AddString("Wireframe");
- m_Wireframe.AddString("Both");
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "Wireframe");
- if (sOpt && !stricmp(sOpt, "WireOnly")) m_Wireframe.SetCurSel(1);
- else if (sOpt && !stricmp(sOpt, "WireOnSolid")) m_Wireframe.SetCurSel(2);
- else m_Wireframe.SetCurSel(0);
-
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "RasterOutlines");
- m_RasterOutlines.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "EmulatePOW2");
- m_EmulPow2.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "PolygonAA");
- m_PolyAA.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "BitmapCopyPixels");
- m_BitmapPixels.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DisableRectExt");
- m_DisableTXRect.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void COptRender3D::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
-
- u32 sel = m_DrawNormals.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "DrawNormals", (sel==2) ? "PerVertex" : (sel==1) ? "PerFace" : "Never");
- sel = m_BackCull.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "BackFaceCulling", (sel==2) ? "Alpha" : (sel==1) ? "On" : "Off");
- sel = m_Wireframe.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "Wireframe", (sel==2) ? "WireOnSolid" : (sel==1) ? "WireOnly" : "WireNone");
-
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "RasterOutlines", m_RasterOutlines.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "EmulatePOW2", m_EmulPow2.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "PolygonAA", m_PolyAA.GetCheck() ? "yes" : "no");
-
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "DisableRectExt", m_DisableTXRect.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "BitmapCopyPixels", m_BitmapPixels.GetCheck() ? "yes" : "no");
-}
-
-COptVideo::COptVideo(CWnd* pParent /*=NULL*/)
- : CDialog(COptVideo::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptVideo)
- //}}AFX_DATA_INIT
-}
-
-
-void COptVideo::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptVideo)
- DDX_Control(pDX, IDC_SWITCH_RES, m_SwitchRes);
- DDX_Control(pDX, IDC_VIDEO_LIST, m_Videos);
- DDX_Control(pDX, IDC_HWMEMORY, m_UseHWMemory);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptVideo, CDialog)
- //{{AFX_MSG_MAP(COptVideo)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptVideo message handlers
-
-BOOL COptVideo::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- m_SwitchRes.SetCheck(gf_cfg_get_bool(gpac->m_user.config, "core", "switch-vres") );
- sOpt = gf_cfg_get_bool(gpac->m_user.config, "core", "hwvmem");
- m_UseHWMemory.SetCheck(sOpt && !stricmp(sOpt, "Always") ? 1 : 0);
-
-
- u32 count = gf_modules_get_count(gpac->m_user.modules);
- GF_BaseInterface *ifce;
- s32 to_sel = 0;
- s32 select = 0;
- /*video drivers enum*/
- while (m_Videos.GetCount()) m_Videos.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "core", "video-output");
-
- for (u32 i=0; i<count; i++) {
- ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_VIDEO_OUTPUT_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
- m_Videos.AddString(ifce->module_name);
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_Videos.SetCurSel(select);
-
- return TRUE;
-
-}
-
-void COptVideo::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
- char str[50];
-
- gf_cfg_set_key(gpac->m_user.config, "core", "switch-vres", m_SwitchRes.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "core", "hwvmem", m_UseHWMemory.GetCheck() ? "Always" : "Auto");
- m_Videos.GetWindowText(str, 50);
- gf_cfg_set_key(gpac->m_user.config, "core", "video-output", str);
-}
-
-
-COptAudio::COptAudio(CWnd* pParent /*=NULL*/)
- : CDialog(COptAudio::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptAudio)
- //}}AFX_DATA_INIT
-}
-
-
-void COptAudio::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptAudio)
- DDX_Control(pDX, IDC_AUDIO_NOTIFS, m_Notifs);
- DDX_Control(pDX, IDC_DRIVER_LIST, m_DriverList);
- DDX_Control(pDX, IDC_AUDIO_RESYNC, m_AudioResync);
- DDX_Control(pDX, IDC_AUDIO_MULTICH, m_AudioMultiCH);
- DDX_Control(pDX, IDC_AUDIO_FPS, m_AudioDur);
- DDX_Control(pDX, IDC_SPIN_FPS, m_SpinFPS);
- DDX_Control(pDX, IDC_FORCE_AUDIO, m_ForceConfig);
- DDX_Control(pDX, IDC_SPIN_AUDIO, m_AudioSpin);
- DDX_Control(pDX, IDC_EDIT_AUDIO, m_AudioEdit);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptAudio, CDialog)
- //{{AFX_MSG_MAP(COptAudio)
- ON_BN_CLICKED(IDC_FORCE_AUDIO, OnForceAudio)
- ON_CBN_SELCHANGE(IDC_DRIVER_LIST, OnSelchangeDriverList)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptAudio message handlers
-
-BOOL COptAudio::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- m_AudioSpin.SetBuddy(& m_AudioEdit);
- m_SpinFPS.SetBuddy(& m_AudioDur);
- m_SpinFPS.SetRange(0, 2000);
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "ForceConfig");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_ForceConfig.SetCheck(1);
- } else {
- m_ForceConfig.SetCheck(0);
- }
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "NumBuffers");
- if (sOpt) {
- m_AudioEdit.SetWindowText(sOpt);
- } else {
- m_AudioEdit.SetWindowText("2");
- }
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "TotalDuration");
- if (sOpt) {
- m_AudioDur.SetWindowText(sOpt);
- } else {
- m_AudioDur.SetWindowText("120");
- }
-
- OnForceAudio();
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "NoResync");
- m_AudioResync.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "DisableMultiChannel");
- m_AudioMultiCH.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- /*driver enum*/
- while (m_DriverList.GetCount()) m_DriverList.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "core", "audio-output");
- u32 count = gf_modules_get_count(gpac->m_user.modules);
- GF_BaseInterface *ifce;
- s32 select = 0;
- s32 to_sel = 0;
- for (u32 i=0; i<count; i++) {
- ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_AUDIO_OUTPUT_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
- m_DriverList.AddString(ifce->module_name);
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_DriverList.SetCurSel(select);
-
- m_Notifs.ShowWindow(SW_HIDE);
- if (sOpt && strstr(sOpt, "DirectSound")) m_Notifs.ShowWindow(SW_SHOW);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "DisableNotification");
- if (sOpt && !stricmp(sOpt, "yes"))
- m_Notifs.SetCheck(1);
- else
- m_Notifs.SetCheck(0);
-
- return TRUE;
-}
-
-
-void COptAudio::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
- char str[50];
-
- gf_cfg_set_key(gpac->m_user.config, "Audio", "ForceConfig", m_ForceConfig.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Audio", "NoResync", m_AudioResync.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Audio", "DisableMultiChannel", m_AudioMultiCH.GetCheck() ? "yes" : "no");
-
- m_AudioEdit.GetWindowText(str, 20);
- gf_cfg_set_key(gpac->m_user.config, "Audio", "NumBuffers", str);
- m_AudioDur.GetWindowText(str, 20);
- gf_cfg_set_key(gpac->m_user.config, "Audio", "TotalDuration", str);
-
- m_DriverList.GetWindowText(str, 50);
- gf_cfg_set_key(gpac->m_user.config, "core", "audio-output", str);
-
- if (strstr(str, "DirectSound")) {
- gf_cfg_set_key(gpac->m_user.config, "Audio", "DisableNotification", m_Notifs.GetCheck() ? "yes" : "no");
- }
-
-}
-
-void COptAudio::OnForceAudio()
-{
- BOOL en = m_ForceConfig.GetCheck();
-
- m_AudioSpin.EnableWindow(en);
- m_AudioEdit.EnableWindow(en);
- m_SpinFPS.EnableWindow(en);
- m_AudioDur.EnableWindow(en);
-}
-
-void COptAudio::OnSelchangeDriverList()
-{
- char str[50];
- m_DriverList.GetWindowText(str, 50);
- if (strstr(str, "DirectSound")) {
- m_Notifs.ShowWindow(SW_SHOW);
- } else {
- m_Notifs.ShowWindow(SW_HIDE);
- }
-}
-
-
-
-
-COptFont::COptFont(CWnd* pParent /*=NULL*/)
- : CDialog(COptFont::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptFont)
- //}}AFX_DATA_INIT
-}
-
-
-void COptFont::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptFont)
- DDX_Control(pDX, IDC_TEXTURE_MODE, m_TextureModes);
- DDX_Control(pDX, IDC_FONT_LIST, m_Fonts);
- DDX_Control(pDX, IDC_BROWSE_FONT, m_BrowseFont);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptFont, CDialog)
- //{{AFX_MSG_MAP(COptFont)
- ON_BN_CLICKED(IDC_BROWSE_FONT, OnBrowseFont)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptFont message handlers
-
-BOOL COptFont::OnInitDialog()
-{
- u32 i;
- GF_BaseInterface *ifce;
-
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- /*video drivers enum*/
- while (m_Fonts.GetCount()) m_Fonts.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "FontCache", "FontReader");
- s32 to_sel = 0;
- s32 select = 0;
- u32 count = gf_modules_get_count(gpac->m_user.modules);
- for (i=0; i<count; i++) {
- ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_FONT_READER_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
- m_Fonts.AddString(ifce->module_name);
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_Fonts.SetCurSel(select);
-
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "FontCache", "FontDirectory");
- if (sOpt) m_BrowseFont.SetWindowText(sOpt);
-
- /*text texturing modes*/
- while (m_TextureModes.GetCount()) m_TextureModes.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "TextureTextMode");
- m_TextureModes.AddString("Default");
- m_TextureModes.AddString("Never");
- m_TextureModes.AddString("Always");
- if (sOpt && !stricmp(sOpt, "3D")) m_TextureModes.SetCurSel(1);
- else if (sOpt && !stricmp(sOpt, "Always")) m_TextureModes.SetCurSel(2);
- else m_TextureModes.SetCurSel(0);
-
- return TRUE;
-}
-
-
-
-static char szCacheDir[MAX_PATH];
-
-static int CALLBACK LocCbck(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
-{
- char dir[MAX_PATH];
- if (uMsg == BFFM_INITIALIZED) {
- strcpy(dir, szCacheDir);
- SendMessage(hwnd, BFFM_SETSELECTION, TRUE,(LPARAM) dir);
- }
- return 0;
-}
-
-void COptFont::OnBrowseFont()
-{
- BROWSEINFO brw;
- LPMALLOC pMalloc;
- LPITEMIDLIST ret;
- char dir[MAX_PATH];
-
- if (NOERROR == ::SHGetMalloc(&pMalloc) ) {
-
- m_BrowseFont.GetWindowText(szCacheDir, MAX_PATH);
-
- memset(&brw, 0, sizeof(BROWSEINFO));
- brw.hwndOwner = this->GetSafeHwnd();
- brw.pszDisplayName = dir;
- brw.lpszTitle = "Select Font Directory...";
- brw.ulFlags = 0L;
- brw.lpfn = LocCbck;
-
- ret = SHBrowseForFolder(&brw);
- if (ret != NULL) {
- if (::SHGetPathFromIDList(ret, dir)) {
- m_BrowseFont.SetWindowText(dir);
- }
- pMalloc->Free(ret);
- }
- pMalloc->Release();
- }
-}
-
-
-void COptFont::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
- char str[MAX_PATH];
-
- m_Fonts.GetWindowText(str, 50);
- gf_cfg_set_key(gpac->m_user.config, "FontCache", "FontReader", str);
- m_BrowseFont.GetWindowText(str, 50);
- gf_cfg_set_key(gpac->m_user.config, "FontCache", "FontDirectory", str);
- switch (m_TextureModes.GetCurSel()) {
- case 2:
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "TextureTextMode", "Always");
- break;
- case 1:
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "TextureTextMode", "Never");
- break;
- default:
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "TextureTextMode", "Default");
- break;
- }
-}
-
-
-COptHTTP::COptHTTP(CWnd* pParent /*=NULL*/)
- : CDialog(COptHTTP::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptHTTP)
- //}}AFX_DATA_INIT
-}
-
-
-void COptHTTP::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptHTTP)
- DDX_Control(pDX, IDC_HTTP_PROXY, m_ProxyName);
- DDX_Control(pDX, IDC_HTTP_USE_PROXY, m_useProxy);
- DDX_Control(pDX, IDC_SAX_DELAY, m_SAXDuration);
- DDX_Control(pDX, IDC_SAX_PROGRESSIVE, m_Progressive);
- DDX_Control(pDX, IDC_RESTART_CACHE, m_DisableCache);
- DDX_Control(pDX, IDC_CLEAN_CACHE, m_CleanCache);
- DDX_Control(pDX, IDC_BROWSE_CACHE, m_CacheDir);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptHTTP, CDialog)
- //{{AFX_MSG_MAP(COptHTTP)
- ON_BN_CLICKED(IDC_BROWSE_CACHE, OnBrowseCache)
- ON_BN_CLICKED(IDC_SAX_PROGRESSIVE, OnSaxProgressive)
- ON_BN_CLICKED(IDC_HTTP_USE_PROXY, OnUseProxy)
- //}}AFX_MSG_MAP
- ON_BN_CLICKED(IDC_RESTART_CACHE, &COptHTTP::OnBnClickedRestartCache)
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptHTTP message handlers
-
-
-void COptHTTP::OnBrowseCache()
-{
- BROWSEINFO brw;
- LPMALLOC pMalloc;
- LPITEMIDLIST ret;
- char dir[MAX_PATH];
-
- if (NOERROR == ::SHGetMalloc(&pMalloc) ) {
-
- m_CacheDir.GetWindowText(szCacheDir, MAX_PATH);
-
- memset(&brw, 0, sizeof(BROWSEINFO));
- brw.hwndOwner = this->GetSafeHwnd();
- brw.pszDisplayName = dir;
- brw.lpszTitle = "Select HTTP Cache Directory...";
- brw.ulFlags = 0L;
- brw.lpfn = LocCbck;
-
- ret = SHBrowseForFolder(&brw);
- if (ret != NULL) {
- if (::SHGetPathFromIDList(ret, dir)) {
- m_CacheDir.SetWindowText(dir);
- }
- pMalloc->Free(ret);
- }
- pMalloc->Release();
- }
-}
-
-BOOL COptHTTP::OnInitDialog()
-{
- char proxy[GF_MAX_PATH];
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "CacheDirectory");
- if (sOpt) m_CacheDir.SetWindowText(sOpt);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "CleanCache");
- m_CleanCache.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "DisableCache");
- m_DisableCache.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "SAXLoader", "Progressive");
- m_Progressive.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- OnSaxProgressive();
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "SAXLoader", "MaxDuration");
- if (sOpt) {
- m_SAXDuration.SetWindowText(sOpt);
- } else {
- m_SAXDuration.SetWindowText("0");
- }
- //if (m_Progressive.GetCheck()) m_SAXDuration.EnableWindow(1);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "HTTPProxyEnabled");
- m_useProxy.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- OnUseProxy();
- strcpy(proxy, "");
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "HTTPProxyName");
- if (sOpt) {
- strcpy(proxy, sOpt);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "HTTPProxyPort");
- if (sOpt) {
- strcat(proxy, ":");
- strcat(proxy, sOpt);
- }
- }
- m_ProxyName.SetWindowText(proxy);
- return TRUE;
-}
-
-void COptHTTP::OnSaxProgressive()
-{
- if (m_Progressive.GetCheck()) {
- m_SAXDuration.EnableWindow(1);
- } else {
- m_SAXDuration.EnableWindow(0);
- }
-}
-
-
-void COptHTTP::OnUseProxy()
-{
- if (m_useProxy.GetCheck()) {
- m_ProxyName.EnableWindow(1);
- } else {
- m_ProxyName.EnableWindow(0);
- }
-}
-
-void COptHTTP::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
-
- gf_cfg_set_key(gpac->m_user.config, "Core", "CleanCache", m_CleanCache.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Core", "DisableCache", m_DisableCache.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "SAXLoader", "Progressive", m_Progressive.GetCheck() ? "yes" : "no");
-
- m_SAXDuration.GetWindowText(szCacheDir, MAX_PATH);
- gf_cfg_set_key(gpac->m_user.config, "SAXLoader", "MaxDuration", szCacheDir);
-
- gf_cfg_set_key(gpac->m_user.config, "Core", "HTTPProxyEnabled", m_useProxy.GetCheck() ? "yes" : "no");
- m_ProxyName.GetWindowText(szCacheDir, MAX_PATH);
- char *sep = strrchr(szCacheDir, ':');
- if (sep) {
- sep[0] = 0;
- gf_cfg_set_key(gpac->m_user.config, "Core", "HTTPProxyName", szCacheDir);
- sep[0] = ':';
- gf_cfg_set_key(gpac->m_user.config, "Core", "HTTPProxyPort", sep+1);
- } else {
- gf_cfg_set_key(gpac->m_user.config, "Core", "HTTPProxyName", szCacheDir);
- gf_cfg_set_key(gpac->m_user.config, "Core", "HTTPProxyPort", NULL);
- }
- m_CacheDir.GetWindowText(szCacheDir, MAX_PATH);
- gf_cfg_set_key(gpac->m_user.config, "Core", "CacheDirectory", szCacheDir);
-}
-
-
-COptStream::COptStream(CWnd* pParent /*=NULL*/)
- : CDialog(COptStream::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptStream)
- //}}AFX_DATA_INIT
-}
-
-
-void COptStream::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptStream)
- DDX_Control(pDX, IDC_REBUFFER_LEN, m_RebufferLen);
- DDX_Control(pDX, IDC_REBUFFER, m_Rebuffer);
- DDX_Control(pDX, IDC_BUFFER, m_Buffer);
- DDX_Control(pDX, IDC_TIMEOUT, m_Timeout);
- DDX_Control(pDX, IDC_REORDER, m_Reorder);
- DDX_Control(pDX, IDC_RTSP, m_UseRTSP);
- DDX_Control(pDX, IDC_PORT, m_Port);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptStream, CDialog)
- //{{AFX_MSG_MAP(COptStream)
- ON_CBN_SELCHANGE(IDC_PORT, OnSelchangePort)
- ON_BN_CLICKED(IDC_RTSP, OnRtsp)
- ON_BN_CLICKED(IDC_REBUFFER, OnRebuffer)
- ON_EN_UPDATE(IDC_REBUFFER_LEN, OnUpdateRebufferLen)
- ON_EN_UPDATE(IDC_BUFFER, OnUpdateBuffer)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptStream message handlers
-
-BOOL COptStream::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- while (m_Port.GetCount()) m_Port.DeleteString(0);
- m_Port.AddString("554 (RTSP standard)");
- m_Port.AddString("7070 (RTSP ext)");
- m_Port.AddString("80 (RTSP / HTTP tunnel)");
- m_Port.AddString("8080 (RTSP / HTTP tunnel)");
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "DefaultPort");
- u32 port = 554;
- Bool force_rtsp = GF_FALSE;
- if (sOpt) port = atoi(sOpt);
- switch (port) {
- case 8080:
- m_Port.SetCurSel(3);
- force_rtsp = GF_TRUE;
- break;
- case 80:
- m_Port.SetCurSel(2);
- force_rtsp = GF_TRUE;
- break;
- case 7070:
- m_Port.SetCurSel(1);
- break;
- default:
- m_Port.SetCurSel(0);
- break;
- }
-
- Bool use_rtsp = GF_FALSE;
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "RTPoverRTSP");
- if (sOpt && !stricmp(sOpt, "yes")) use_rtsp = GF_TRUE;
-
- if (force_rtsp) {
- m_UseRTSP.SetCheck(1);
- m_UseRTSP.EnableWindow(0);
- m_Reorder.SetCheck(0);
- m_Reorder.EnableWindow(0);
- } else {
- m_UseRTSP.SetCheck(use_rtsp);
- m_UseRTSP.EnableWindow(1);
- m_Reorder.EnableWindow(1);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "ReorderSize");
- if (sOpt && !stricmp(sOpt, "0")) {
- m_Reorder.SetCheck(0);
- } else {
- m_Reorder.SetCheck(1);
- }
- }
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "RTSPTimeout");
- if (sOpt) {
- m_Timeout.SetWindowText(sOpt);
- } else {
- m_Timeout.SetWindowText("30000");
- }
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Network", "BufferLength");
- if (sOpt) {
- m_Buffer.SetWindowText(sOpt);
- } else {
- m_Buffer.SetWindowText("3000");
- }
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Network", "RebufferLength");
- u32 buf_len = 0;
- if (sOpt) buf_len = atoi(sOpt);
- if (buf_len) {
- m_RebufferLen.SetWindowText(sOpt);
- m_Rebuffer.SetCheck(1);
- m_RebufferLen.EnableWindow(1);
- } else {
- m_RebufferLen.SetWindowText("0");
- m_Rebuffer.SetCheck(0);
- m_RebufferLen.EnableWindow(0);
- }
-
- return TRUE;
-}
-
-
-void COptStream::OnSelchangePort()
-{
- s32 sel = m_Port.GetCurSel();
- switch (sel) {
- case 3:
- case 2:
- m_UseRTSP.SetCheck(1);
- m_UseRTSP.EnableWindow(0);
- m_Reorder.SetCheck(0);
- m_Reorder.EnableWindow(0);
- break;
- case 1:
- default:
- m_UseRTSP.SetCheck(0);
- m_UseRTSP.EnableWindow(1);
- m_Reorder.SetCheck(1);
- m_Reorder.EnableWindow(1);
- break;
- }
-}
-
-void COptStream::OnRtsp()
-{
- if (m_UseRTSP.GetCheck()) {
- m_Reorder.SetCheck(0);
- m_Reorder.EnableWindow(0);
- } else {
- m_Reorder.SetCheck(1);
- m_Reorder.EnableWindow(1);
- }
-
-}
-
-void COptStream::CheckRebuffer()
-{
- char str[50];
- s32 buf, rebuf;
- m_Buffer.GetWindowText(str, 50);
- buf = atoi(str);
- m_RebufferLen.GetWindowText(str, 50);
- rebuf = atoi(str);
- if (rebuf*2 > buf) {
- rebuf = buf/2;
- sprintf(str, "%d", rebuf);
- m_RebufferLen.SetWindowText(str);
- }
-}
-
-void COptStream::OnRebuffer()
-{
- if (!m_Rebuffer.GetCheck()) {
- m_RebufferLen.EnableWindow(0);
- } else {
- m_RebufferLen.EnableWindow(1);
- CheckRebuffer();
- }
-}
-
-void COptStream::OnUpdateRebufferLen()
-{
- CheckRebuffer();
-}
-
-void COptStream::OnUpdateBuffer()
-{
- CheckRebuffer();
-}
-
-void COptStream::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
- Bool force_rtsp = GF_FALSE;
- s32 sel = m_Port.GetCurSel();
- switch (sel) {
- case 3:
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "8080");
- force_rtsp = GF_TRUE;
- break;
- case 2:
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "80");
- force_rtsp = GF_TRUE;
- break;
- case 1:
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "7070");
- break;
- default:
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "554");
- break;
- }
-
- if (force_rtsp) {
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTPoverRTSP", "yes");
- } else {
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTPoverRTSP", m_UseRTSP.GetCheck() ? "yes" : "no");
- if (!m_UseRTSP.GetCheck()) gf_cfg_set_key(gpac->m_user.config, "Streaming", "ReorderSize", m_Reorder.GetCheck() ? "30" : "0");
- }
-
- char str[50];
-
- m_Timeout.GetWindowText(str, 50);
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTSPTimeout", str);
-
- m_Buffer.GetWindowText(str, 50);
- gf_cfg_set_key(gpac->m_user.config, "Network", "BufferLength", str);
- if (m_Rebuffer.GetCheck()) {
- m_RebufferLen.GetWindowText(str, 50);
- gf_cfg_set_key(gpac->m_user.config, "Network", "RebufferLength", str);
- } else {
- gf_cfg_set_key(gpac->m_user.config, "Network", "RebufferLength", "0");
- }
-}
-
-
-
-
-COptMCache::COptMCache(CWnd* pParent /*=NULL*/)
- : CDialog(COptMCache::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptMCache)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void COptMCache::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptMCache)
- DDX_Control(pDX, IDC_BASEPRES, m_BaseName);
- DDX_Control(pDX, IDC_MCACHE_USENAME, m_UseBase);
- DDX_Control(pDX, IDC_MCACHE_OVERWRITE, m_Overwrite);
- DDX_Control(pDX, IDC_BROWSE_MCACHE, m_RecDir);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptMCache, CDialog)
- //{{AFX_MSG_MAP(COptMCache)
- ON_BN_CLICKED(IDC_BROWSE_MCACHE, OnBrowseMcache)
- ON_BN_CLICKED(IDC_MCACHE_USENAME, OnMcacheUsename)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptMCache message handlers
-
-void COptMCache::OnBrowseMcache()
-{
- BROWSEINFO brw;
- LPMALLOC pMalloc;
- LPITEMIDLIST ret;
- char dir[MAX_PATH];
-
- if (NOERROR == ::SHGetMalloc(&pMalloc) ) {
-
- m_RecDir.GetWindowText(szCacheDir, MAX_PATH);
-
- memset(&brw, 0, sizeof(BROWSEINFO));
- brw.hwndOwner = this->GetSafeHwnd();
- brw.pszDisplayName = dir;
- brw.lpszTitle = "Select HTTP Cache Directory...";
- brw.ulFlags = 0L;
- brw.lpfn = LocCbck;
-
- ret = SHBrowseForFolder(&brw);
- if (ret != NULL) {
- if (::SHGetPathFromIDList(ret, dir)) {
- m_RecDir.SetWindowText(dir);
- }
- pMalloc->Free(ret);
- }
- pMalloc->Release();
- }
-}
-
-BOOL COptMCache::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "StreamingCache", "RecordDirectory");
- if (!sOpt) sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "CacheDirectory");
- if (sOpt) m_RecDir.SetWindowText(sOpt);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "StreamingCache", "KeepExistingFiles");
- m_Overwrite.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 0 : 1);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "StreamingCache", "BaseFileName");
- if (sOpt) {
- m_UseBase.SetCheck(1);
- m_BaseName.EnableWindow(TRUE);
- m_BaseName.SetWindowText(sOpt);
- } else {
- m_UseBase.SetCheck(0);
- m_BaseName.EnableWindow(FALSE);
- m_BaseName.SetWindowText("uses service URL");
- }
- return TRUE;
-}
-
-void COptMCache::OnMcacheUsename()
-{
- if (m_UseBase.GetCheck()) {
- m_BaseName.EnableWindow(TRUE);
- m_BaseName.SetWindowText("record");
- } else {
- m_BaseName.EnableWindow(FALSE);
- m_BaseName.SetWindowText("uses service URL");
- }
-}
-
-void COptMCache::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
-
- gf_cfg_set_key(gpac->m_user.config, "StreamingCache", "KeepExistingFiles", m_Overwrite.GetCheck() ? "no" : "yes");
- if (m_UseBase.GetCheck()) {
- m_BaseName.GetWindowText(szCacheDir, MAX_PATH);
- gf_cfg_set_key(gpac->m_user.config, "StreamingCache", "BaseFileName", szCacheDir);
- } else {
- gf_cfg_set_key(gpac->m_user.config, "StreamingCache", "BaseFileName", NULL);
- }
- m_RecDir.GetWindowText(szCacheDir, MAX_PATH);
- gf_cfg_set_key(gpac->m_user.config, "StreamingCache", "RecordDirectory", szCacheDir);
-}
-
-
-OptFiles::OptFiles(CWnd* pParent /*=NULL*/)
- : CDialog(OptFiles::IDD, pParent)
-{
- //{{AFX_DATA_INIT(OptFiles)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void OptFiles::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(OptFiles)
- DDX_Control(pDX, IDC_ASSOCIATE, m_DoAssociate);
- DDX_Control(pDX, IDC_FILES_PLUG, m_PlugName);
- DDX_Control(pDX, IDC_FILES_MIMES, m_mimes);
- DDX_Control(pDX, IDC_FILES_EXT, m_extensions);
- DDX_Control(pDX, IDC_FILELIST, m_FileDescs);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(OptFiles, CDialog)
- //{{AFX_MSG_MAP(OptFiles)
- ON_CBN_SELCHANGE(IDC_FILELIST, OnSelchangeFilelist)
- ON_BN_CLICKED(IDC_ASSOCIATE, OnAssociate)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// OptFiles message handlers
-
-BOOL OptFiles::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- Osmo4 *gpac = GetApp();
- u32 count, i;
-
- while (m_FileDescs.GetCount()) m_FileDescs.DeleteString(0);
- count = gf_cfg_get_key_count(gpac->m_user.config, "MimeTypes");
- for (i=0; i<count; i++) {
- char *sMime, *sKey, sDesc[200];
- const char *sOpt;
- sMime = (char *) gf_cfg_get_key_name(gpac->m_user.config, "MimeTypes", i);
- if (!sMime) continue;
- sOpt = gf_cfg_get_key(gpac->m_user.config, "MimeTypes", sMime);
- if (!sOpt) continue;
- sKey = (char *) strstr(sOpt, "\" \"");
- if (!sKey) continue;
- strcpy(sDesc, sKey+3);
- sKey = strchr(sDesc, '\"');
- if (!sKey) continue;
- sKey[0] = 0;
- m_FileDescs.AddString(sDesc);
- }
- m_FileDescs.SetCurSel(0);
- SetSelection(0);
- return TRUE;
-}
-
-void OptFiles::OnSelchangeFilelist()
-{
- SetSelection(m_FileDescs.GetCurSel());
-}
-
-void OptFiles::SetSelection(u32 sel)
-{
- Osmo4 *gpac = GetApp();
- char *sMime, *sKey, sDesc[200], sText[200];
- sMime = (char *) gf_cfg_get_key_name(gpac->m_user.config, "MimeTypes", sel);
- sprintf(sText, "Mime Type: %s", sMime);
- m_mimes.SetWindowText(sText);
- strcpy(cur_mime, sMime);
- sMime = (char *) gf_cfg_get_key(gpac->m_user.config, "MimeTypes", sMime);
- strcpy(sDesc, sMime+1);
- sKey = strchr(sDesc, '\"');
- sKey[0] = 0;
- sprintf(sText, "Extensions: %s", sDesc);
- strcpy(cur_ext, sDesc);
- m_extensions.SetWindowText(sText);
- sKey = strrchr(sMime, '\"');
- sprintf(sText, "Module: %s", sKey+2);
- m_PlugName.SetWindowText(sText);
-
- Bool has_asso, need_asso, go = GF_TRUE;
- sKey = cur_ext;
- need_asso = has_asso = GF_FALSE;
-
- HKEY hKey;
- DWORD dwSize;
- while (go) {
- Bool ok;
- char szExt[50], szReg[60], c;
- char *tmp = strchr(sKey, ' ');
- if (!tmp) {
- go = GF_FALSE;
- }
- else {
- c = tmp[0];
- tmp[0] = 0;
- }
- sprintf(szExt, ".%s", sKey);
- sprintf(szReg, "GPAC\\%s", sKey);
- if (tmp) {
- tmp[0] = c;
- tmp += 1;
- }
-
- if (RegOpenKeyEx(HKEY_CLASSES_ROOT, szExt, 0, KEY_READ, &hKey ) == ERROR_SUCCESS) {
- dwSize = 200;
- ok = GF_TRUE;
- if (RegQueryValueEx(hKey, "", NULL, NULL,(unsigned char*) sDesc, &dwSize) != ERROR_SUCCESS) ok = GF_FALSE;
- RegCloseKey(hKey);
- if (ok && !stricmp((char *)sDesc, szReg)) has_asso = GF_TRUE;
- else need_asso = GF_TRUE;
- } else need_asso = GF_TRUE;
- sKey = tmp;
-
- }
- m_DoAssociate.SetCheck(has_asso);
- if (need_asso && has_asso)
- OnAssociate();
-}
-
-
-void OptFiles::OnAssociate()
-{
- char *sKey, sDesc[200];
- unsigned char szApp[MAX_PATH];
- unsigned char szIco[MAX_PATH];
-
- strcpy((char *) szApp, GetApp()->szApplicationPath);
- strcpy((char *) szIco, (const char *) szApp);
- strcat((char *) szIco, "Osmo4.ico");
- strcat((char *) szApp, "Osmo4.exe \"%L\"");
-
- if (m_DoAssociate.GetCheck()) {
- Bool go = GF_TRUE;
- sKey = cur_ext;
-
- HKEY hKey;
- DWORD dwSize;
- while (go) {
- Bool ok;
- char szExt[50], szReg[60], szOld[80], szPath[1024], c;
- char *tmp = strchr(sKey, ' ');
- if (!tmp) {
- go = GF_FALSE;
- }
- else {
- c = tmp[0];
- tmp[0] = 0;
- }
- sprintf(szExt, ".%s", sKey);
- sprintf(szReg, "GPAC\\%s", sKey);
- if (tmp) {
- tmp[0] = c;
- tmp += 1;
- }
-
- RegOpenKeyEx(HKEY_CLASSES_ROOT, szExt, 0, 0, &hKey );
- dwSize = 200;
- ok = GF_TRUE;
- if (RegQueryValueEx(hKey, "", NULL, NULL,(unsigned char*) sDesc, &dwSize) != ERROR_SUCCESS) ok = GF_FALSE;
- RegCloseKey(hKey);
- strcpy(szOld, "");
- if (ok && stricmp((char *)sDesc, szReg)) strcpy(szOld, sDesc);
-
- strcpy(szPath, szReg);
- strcat(szPath, "\\DefaultIcon");
- RegCreateKeyEx(HKEY_CLASSES_ROOT, szPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
- RegSetValueEx(hKey, "", 0, REG_SZ, szIco, (DWORD) strlen((const char *) szIco)+1);
- RegCloseKey(hKey);
-
- strcpy(szPath, szReg);
- strcat(szPath, "\\Shell\\open\\command");
- RegCreateKeyEx(HKEY_CLASSES_ROOT, szPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
- RegSetValueEx(hKey, "", 0, REG_SZ, szApp, (DWORD) strlen((const char *) szApp)+1);
- RegCloseKey(hKey);
-
- if (strlen(szOld)) {
- strcpy(szPath, szReg);
- strcat(szPath, "\\Backup");
- RegCreateKeyEx(HKEY_CLASSES_ROOT, szPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
- RegSetValueEx(hKey, "", 0, REG_SZ, (unsigned char *) szOld, (DWORD) strlen((const char *) szIco)+1);
- RegCloseKey(hKey);
- }
-
- RegCreateKeyEx(HKEY_CLASSES_ROOT, szExt, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
- RegSetValueEx(hKey, "", 0, REG_SZ, (const unsigned char *) szReg, (DWORD) strlen(szReg)+1);
- RegCloseKey(hKey);
-
- sKey = tmp;
- }
- } else {
- Bool go = GF_TRUE;
- sKey = cur_ext;
-
- HKEY hKey;
- DWORD dwSize;
- while (go) {
- Bool ok;
- char szExt[50], szReg[60], szPath[1024], c;
- char *tmp = strchr(sKey, ' ');
- if (!tmp) {
- go = GF_FALSE;
- }
- else {
- c = tmp[0];
- tmp[0] = 0;
- }
- sprintf(szExt, ".%s", sKey);
- sprintf(szReg, "GPAC\\%s", sKey);
- if (tmp) {
- tmp[0] = c;
- tmp += 1;
- }
-
- strcpy(szPath, szReg);
- strcat(szPath, "\\Backup");
- RegOpenKeyEx(HKEY_CLASSES_ROOT, szPath, 0, 0, &hKey );
- dwSize = 200;
- ok = GF_TRUE;
- if (RegQueryValueEx(hKey, "", NULL, NULL,(unsigned char*) sDesc, &dwSize) != ERROR_SUCCESS) ok = GF_FALSE;
- RegCloseKey(hKey);
- if (ok && strlen((char *)sDesc)) {
- RegCreateKeyEx(HKEY_CLASSES_ROOT, szExt, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
- RegSetValueEx(hKey, "", 0, REG_SZ, (unsigned char*) sDesc, (DWORD) strlen((const char *) sDesc)+1);
- RegCloseKey(hKey);
- }
-
- RegOpenKeyEx(HKEY_CLASSES_ROOT, szReg, 0, 0, &hKey );
- RegDeleteKey(hKey, "Backup");
- RegDeleteKey(hKey, "DefaultIcon");
- RegDeleteKey(hKey, "Shell\\open\\command");
- RegDeleteKey(hKey, "Shell\\open");
- RegDeleteKey(hKey, "Shell");
- RegCloseKey(hKey);
- RegDeleteKey(HKEY_CLASSES_ROOT, szReg);
-
- sKey = tmp;
- }
- }
-}
-
-COptLogs::COptLogs(CWnd* pParent /*=NULL*/)
- : CDialog(COptLogs::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptLogs)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void COptLogs::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptLogs)
- DDX_Control(pDX, IDC_TOOL_SYNC, m_sync);
- DDX_Control(pDX, IDC_TOOL_SCRIPT, m_script);
- DDX_Control(pDX, IDC_TOOL_SCENE, m_scene);
- DDX_Control(pDX, IDC_TOOL_RTP, m_rtp);
- DDX_Control(pDX, IDC_TOOL_RENDER, m_render);
- DDX_Control(pDX, IDC_TOOL_PARSER, m_parser);
- DDX_Control(pDX, IDC_TOOL_NET, m_net);
- DDX_Control(pDX, IDC_TOOL_MMIO, m_mmio);
- DDX_Control(pDX, IDC_TOOL_MEDIA, m_media);
- DDX_Control(pDX, IDC_TOOL_CORE, m_core);
- DDX_Control(pDX, IDC_TOOL_CONTAINER, m_container);
- DDX_Control(pDX, IDC_TOOL_COMPOSE, m_compose);
- DDX_Control(pDX, IDC_TOOL_CODING, m_coding);
- DDX_Control(pDX, IDC_TOOL_CODEC, m_codec);
- DDX_Control(pDX, IDC_TOOL_AUTHOR, m_author);
- DDX_Control(pDX, IDC_LOG_LEVEL, m_Level);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptLogs, CDialog)
- //{{AFX_MSG_MAP(COptLogs)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptLogs message handlers
-
-BOOL COptLogs::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
-#if 0
- Osmo4 *gpac = GetApp();
- switch (gpac->m_log_level) {
- case GF_LOG_ERROR:
- m_Level.SetCurSel(1);
- break;
- case GF_LOG_WARNING:
- m_Level.SetCurSel(2);
- break;
- case GF_LOG_INFO:
- m_Level.SetCurSel(3);
- break;
- case GF_LOG_DEBUG:
- m_Level.SetCurSel(4);
- break;
- default:
- m_Level.SetCurSel(0);
- break;
- }
-
- m_sync.SetCheck(gpac->m_log_tools & GF_LOG_SYNC);
- m_script.SetCheck(gpac->m_log_tools & GF_LOG_SCRIPT);
- m_scene.SetCheck(gpac->m_log_tools & GF_LOG_SCENE);
- m_rtp.SetCheck(gpac->m_log_tools & GF_LOG_RTP);
- m_render.SetCheck(gpac->m_log_tools & GF_LOG_COMPOSE);
- m_parser.SetCheck(gpac->m_log_tools & GF_LOG_PARSER);
- m_net.SetCheck(gpac->m_log_tools & GF_LOG_NETWORK);
- m_mmio.SetCheck(gpac->m_log_tools & GF_LOG_MMIO);
- m_media.SetCheck(gpac->m_log_tools & GF_LOG_MEDIA);
- m_core.SetCheck(gpac->m_log_tools & GF_LOG_CORE);
- m_container.SetCheck(gpac->m_log_tools & GF_LOG_CONTAINER);
- m_compose.SetCheck(gpac->m_log_tools & GF_LOG_INTERACT);
- m_coding.SetCheck(gpac->m_log_tools & GF_LOG_CODING);
- m_codec.SetCheck(gpac->m_log_tools & GF_LOG_CODEC);
- m_author.SetCheck(gpac->m_log_tools & GF_LOG_AUTHOR);
-#endif
-
- return TRUE;
-}
-
-void COptLogs::SaveOptions()
-{
- Osmo4 *gpac = GetApp();
- CString str = "";
- const char *level = "error";
- u32 flags = 0;
-
- switch (m_Level.GetCurSel()) {
- case 1:
- level = "error";
- break;
- case 2:
- level = "warning";
- break;
- case 3:
- level = "info";
- break;
- case 4:
- level = "debug";
- break;
- default:
- level = "none";
- break;
- }
-
- if (m_sync.GetCheck()) {
- str +="sync:";
- }
- if (m_script.GetCheck()) {
- str +="script:";
- }
- if (m_scene.GetCheck()) {
- str +="scene:";
- }
- if (m_rtp.GetCheck()) {
- str +="rtp:";
- }
- if (m_render.GetCheck()) {
- str +="compose:";
- }
- if (m_parser.GetCheck()) {
- str +="parser:";
- }
- if (m_net.GetCheck()) {
- str +="network:";
- }
- if (m_mmio.GetCheck()) {
- str +="mmio:";
- }
- if (m_media.GetCheck()) {
- str +="media:";
- }
- if (m_core.GetCheck()) {
- str +="core:";
- }
- if (m_container.GetCheck()) {
- str +="container:";
- }
- if (m_compose.GetCheck()) {
- str +="interact:";
- }
- if (m_coding.GetCheck()) {
- str +="coding:";
- }
- if (m_codec.GetCheck()) {
- str +="codec:";
- }
- if (m_author.GetCheck()) {
- str +="author:";
- }
-
- gf_cfg_set_key(gpac->m_user.config, "General", "Logs", str);
- str += "@";
- str += level;
- gf_log_set_tools_levels(str);
-}
-
-void COptHTTP::OnBnClickedRestartCache()
-{
- // TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
-}
+++ /dev/null
-#if !defined(AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_)
-#define AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// Options.h : header file
-//
-
-
-class COptAudio : public CDialog
-{
-// Construction
-public:
- COptAudio(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptAudio)
- enum { IDD = IDD_OPT_AUDIO };
- CButton m_Notifs;
- CComboBox m_DriverList;
- CButton m_AudioResync;
- CButton m_AudioMultiCH;
- CEdit m_AudioDur;
- CSpinButtonCtrl m_SpinFPS;
- CButton m_ForceConfig;
- CSpinButtonCtrl m_AudioSpin;
- CEdit m_AudioEdit;
- //}}AFX_DATA
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptAudio)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptAudio)
- virtual BOOL OnInitDialog();
- afx_msg void OnForceAudio();
- afx_msg void OnSelchangeDriverList();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// OptDecoder dialog
-
-class OptDecoder : public CDialog
-{
-// Construction
-public:
- OptDecoder(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(OptDecoder)
- enum { IDD = IDD_OPT_DECODER };
- CComboBox m_Video;
- CComboBox m_Audio;
- //}}AFX_DATA
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(OptDecoder)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(OptDecoder)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class OptFiles : public CDialog
-{
-// Construction
-public:
- OptFiles(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(OptFiles)
- enum { IDD = IDD_OPT_FILETYPES };
- CButton m_DoAssociate;
- CStatic m_PlugName;
- CStatic m_mimes;
- CStatic m_extensions;
- CComboBox m_FileDescs;
- //}}AFX_DATA
-
- void SetSelection(u32 sel);
- char cur_ext[200], cur_mime[200];
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(OptFiles)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(OptFiles)
- virtual BOOL OnInitDialog();
- afx_msg void OnSelchangeFilelist();
- afx_msg void OnAssociate();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// COptFont dialog
-
-class COptFont : public CDialog
-{
-// Construction
-public:
- COptFont(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptFont)
- enum { IDD = IDD_OPT_FONT };
- CComboBox m_TextureModes;
- CComboBox m_Fonts;
- CButton m_BrowseFont;
- //}}AFX_DATA
-
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptFont)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptFont)
- virtual BOOL OnInitDialog();
- afx_msg void OnBrowseFont();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// COptGen dialog
-
-class COptGen : public CDialog
-{
-// Construction
-public:
- COptGen(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptGen)
- enum { IDD = IDD_OPT_GEN };
- CButton m_LookForSubs;
- CButton m_ViewXMT;
- CButton m_NoConsole;
- CButton m_Loop;
- CButton m_SingleInstance;
- //}}AFX_DATA
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptGen)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptGen)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-// COptHTTP dialog
-
-class COptHTTP : public CDialog
-{
-// Construction
-public:
- COptHTTP(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptHTTP)
- enum { IDD = IDD_OPT_HTTP };
- CEdit m_ProxyName;
- CButton m_useProxy;
- CEdit m_SAXDuration;
- CButton m_Progressive;
- CButton m_DisableCache;
- CButton m_CleanCache;
- CButton m_CacheDir;
- //}}AFX_DATA
-
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptHTTP)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptHTTP)
- afx_msg void OnBrowseCache();
- virtual BOOL OnInitDialog();
- afx_msg void OnSaxProgressive();
- afx_msg void OnUseProxy();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-public:
- afx_msg void OnBnClickedRestartCache();
-};
-
-
-class COptMCache : public CDialog
-{
-// Construction
-public:
- COptMCache(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptMCache)
- enum { IDD = IDD_OPT_MCACHE };
- CEdit m_BaseName;
- CButton m_UseBase;
- CButton m_Overwrite;
- CButton m_RecDir;
- //}}AFX_DATA
-
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptMCache)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptMCache)
- virtual BOOL OnInitDialog();
- afx_msg void OnBrowseMcache();
- afx_msg void OnMcacheUsename();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class COptRender : public CDialog
-{
-// Construction
-public:
- COptRender(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptRender)
- enum { IDD = IDD_OPT_RENDER };
- CComboBox m_DrawBounds;
- CComboBox m_Graphics;
- CButton m_Use3DRender;
- CComboBox m_AntiAlias;
- CButton m_ForceSize;
- CButton m_HighSpeed;
- CComboBox m_BIFSRate;
- //}}AFX_DATA
-
-
- Bool SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptRender)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptRender)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class COptRender2D : public CDialog
-{
-// Construction
-public:
- COptRender2D(CWnd* pParent = NULL); // standard constructor
-
- void SaveOptions();
- void SetYUV();
-
-// Dialog Data
- //{{AFX_DATA(COptRender2D)
- enum { IDD = IDD_OPT_RENDER2D };
- CStatic m_YUVFormat;
- CButton m_NoYUV;
- CButton m_Scalable;
- CButton m_DirectRender;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptRender2D)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptRender2D)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class COptRender3D : public CDialog
-{
-// Construction
-public:
- COptRender3D(CWnd* pParent = NULL); // standard constructor
-
- void SaveOptions();
-
-// Dialog Data
- //{{AFX_DATA(COptRender3D)
- enum { IDD = IDD_OPT_RENDER3D };
- CButton m_BitmapPixels;
- CButton m_DisableTXRect;
- CButton m_RasterOutlines;
- CButton m_EmulPow2;
- CButton m_PolyAA;
- CComboBox m_BackCull;
- CComboBox m_DrawNormals;
- CComboBox m_Wireframe;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptRender3D)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptRender3D)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class COptStream : public CDialog
-{
-// Construction
-public:
- COptStream(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptStream)
- enum { IDD = IDD_OPT_STREAM };
- CEdit m_RebufferLen;
- CButton m_Rebuffer;
- CEdit m_Buffer;
- CEdit m_Timeout;
- CButton m_Reorder;
- CButton m_UseRTSP;
- CComboBox m_Port;
- //}}AFX_DATA
-
-
- void SaveOptions();
-
- void CheckRebuffer();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptStream)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptStream)
- virtual BOOL OnInitDialog();
- afx_msg void OnSelchangePort();
- afx_msg void OnRtsp();
- afx_msg void OnRebuffer();
- afx_msg void OnUpdateRebufferLen();
- afx_msg void OnUpdateBuffer();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class COptSystems : public CDialog
-{
-// Construction
-public:
- COptSystems(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptSystems)
- enum { IDD = IDD_OPT_SYSTEMS };
- CButton m_ForceDuration;
- CComboBox m_Threading;
- CButton m_LateFramesAlwaysDrawn;
- CComboBox m_Lang;
- //}}AFX_DATA
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptSystems)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptSystems)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class COptVideo : public CDialog
-{
-// Construction
-public:
- COptVideo(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptVideo)
- enum { IDD = IDD_OPT_VIDEO };
- CButton m_SwitchRes;
- CButton m_UseHWMemory;
- CComboBox m_Videos;
- //}}AFX_DATA
-
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptVideo)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptVideo)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// COptLogs dialog
-
-class COptLogs : public CDialog
-{
-// Construction
-public:
- COptLogs(CWnd* pParent = NULL); // standard constructor
- void SaveOptions();
-
-// Dialog Data
- //{{AFX_DATA(COptLogs)
- enum { IDD = IDD_OPT_LOGS };
- CButton m_sync;
- CButton m_script;
- CButton m_scene;
- CButton m_rtp;
- CButton m_render;
- CButton m_parser;
- CButton m_net;
- CButton m_mmio;
- CButton m_media;
- CButton m_core;
- CButton m_container;
- CButton m_compose;
- CButton m_coding;
- CButton m_codec;
- CButton m_author;
- CComboBox m_Level;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptLogs)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptLogs)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions dialog
-
-class COptions : public CDialog
-{
-// Construction
-public:
- COptions(CWnd* pParent = NULL); // standard constructor
- BOOL Create(CWnd * pParent)
- {
- return CDialog::Create( COptions::IDD, pParent);
- }
-
-// Dialog Data
- //{{AFX_DATA(COptions)
- enum { IDD = IDD_OPTIONS };
- CComboBox m_Selector;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptions)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- COptGen m_general;
- COptSystems m_systems;
- COptRender m_render;
- COptRender2D m_render2d;
- COptRender3D m_render3d;
- COptAudio m_audio;
- OptDecoder m_decoder;
- COptVideo m_video;
- COptHTTP m_http;
- COptFont m_font;
- COptStream m_stream;
- COptMCache m_cache;
- OptFiles m_files;
- COptLogs m_logs;
-
- void HideAll();
-
- // Generated message map functions
- //{{AFX_MSG(COptions)
- virtual BOOL OnInitDialog();
- afx_msg void OnSaveopt();
- afx_msg void OnClose();
- afx_msg void OnDestroy();
- afx_msg void OnSelchangeSelect();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_)
+++ /dev/null
-// GPAC.cpp : Defines the class behaviors for the application.
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include <gpac/network.h>
-#include <direct.h>
-#include "MainFrm.h"
-#include "OpenUrl.h"
-#include "resource.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4
-
-BEGIN_MESSAGE_MAP(Osmo4, CWinApp)
- //{{AFX_MSG_MAP(Osmo4)
- ON_COMMAND(ID_OPEN_FILE, OnOpenFile)
- ON_COMMAND(ID_FILE_STEP, OnFileStep)
- ON_COMMAND(ID_OPEN_URL, OnOpenUrl)
- ON_COMMAND(ID_FILE_RELOAD, OnFileReload)
- ON_COMMAND(ID_CONFIG_RELOAD, OnConfigReload)
- ON_COMMAND(ID_FILE_PLAY, OnFilePlay)
- ON_UPDATE_COMMAND_UI(ID_FILE_PLAY, OnUpdateFilePlay)
- ON_UPDATE_COMMAND_UI(ID_FILE_STEP, OnUpdateFileStep)
- ON_COMMAND(ID_FILE_STOP, OnFileStop)
- ON_UPDATE_COMMAND_UI(ID_FILE_STOP, OnUpdateFileStop)
- ON_COMMAND(ID_SWITCH_RENDER, OnSwitchRender)
- ON_UPDATE_COMMAND_UI(ID_FILE_RELOAD, OnUpdateFileStop)
- ON_COMMAND(ID_H_ABOUT, OnAbout)
- ON_COMMAND(ID_FILE_MIGRATE, OnFileMigrate)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4 construction
-
-Osmo4::Osmo4()
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only Osmo4 object
-
-Osmo4 theApp;
-
-
-
-class UserPassDialog : public CDialog
-{
-// Construction
-public:
- UserPassDialog(CWnd* pParent = NULL); // standard constructor
-
- Bool GetPassword(const char *site_url, char *user, char *password);
-
-// Dialog Data
- //{{AFX_DATA(UserPassDialog)
- enum { IDD = IDD_PASSWD };
- CStatic m_SiteURL;
- CEdit m_User;
- CEdit m_Pass;
- //}}AFX_DATA
-
- void SetSelection(u32 sel);
- char cur_ext[200], cur_mime[200];
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(UserPassDialog)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
- const char *m_site_url;
- char *m_user, *m_password;
-
- // Generated message map functions
- //{{AFX_MSG(UserPassDialog)
- virtual BOOL OnInitDialog();
- afx_msg void OnClose();
- //}}AFX_MSG
-};
-
-UserPassDialog::UserPassDialog(CWnd* pParent /*=NULL*/)
- : CDialog(UserPassDialog::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptStream)
- //}}AFX_DATA_INIT
-}
-
-void UserPassDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(UserPassDialog)
- DDX_Control(pDX, IDC_TXT_SITE, m_SiteURL);
- DDX_Control(pDX, IDC_EDIT_USER, m_User);
- DDX_Control(pDX, IDC_EDIT_PASSWORD, m_Pass);
- //}}AFX_DATA_MAP
-}
-
-BOOL UserPassDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
- m_SiteURL.SetWindowText(m_site_url);
- m_User.SetWindowText(m_user);
- m_Pass.SetWindowText("");
- return TRUE;
-}
-
-void UserPassDialog::OnClose()
-{
- m_User.GetWindowText(m_user, 50);
- m_Pass.GetWindowText(m_password, 50);
-}
-
-Bool UserPassDialog::GetPassword(const char *site_url, char *user, char *password)
-{
- m_site_url = site_url;
- m_user = user;
- if (DoModal() != IDOK) return GF_FALSE;
- return GF_TRUE;
-}
-
-
-static void Osmo4_progress_cbk(const void *usr, const char *title, u64 done, u64 total)
-{
- if (!total) return;
- CMainFrame *pFrame = (CMainFrame *) ((Osmo4 *) usr)->m_pMainWnd;
- s32 prog = (s32) ( (100 * (u64)done) / total);
- if (pFrame->m_last_prog < prog) {
- pFrame->console_err = GF_OK;
- pFrame->m_last_prog = prog;
- pFrame->console_message.Format("%s %02d %%", title, prog);
- pFrame->PostMessage(WM_CONSOLEMSG, 0, 0);
- if (done==total) pFrame->m_last_prog = -1;
- }
-}
-
-#define W32_MIN_WIDTH 120
-
-static void log_msg(char *msg)
-{
- ::MessageBox(NULL, msg, "GPAC", MB_OK);
-}
-Bool Osmo4_EventProc(void *priv, GF_Event *evt)
-{
- u32 dur;
- Osmo4 *gpac = (Osmo4 *) priv;
- CMainFrame *pFrame = (CMainFrame *) gpac->m_pMainWnd;
- /*shutdown*/
- if (!pFrame) return GF_FALSE;
-
- switch (evt->type) {
- case GF_EVENT_DURATION:
- dur = (u32) (1000 * evt->duration.duration);
- //if (dur<1100) dur = 0;
- pFrame->m_pPlayList->SetDuration((u32) evt->duration.duration );
- gpac->max_duration = dur;
- gpac->can_seek = evt->duration.can_seek;
- if (!gpac->can_seek) {
- pFrame->m_Sliders.m_PosSlider.EnableWindow(FALSE);
- } else {
- pFrame->m_Sliders.m_PosSlider.EnableWindow(TRUE);
- pFrame->m_Sliders.m_PosSlider.SetRangeMin(0);
- pFrame->m_Sliders.m_PosSlider.SetRangeMax(dur);
- }
- break;
-
- case GF_EVENT_MESSAGE:
- if (!evt->message.service || !strcmp(evt->message.service, (LPCSTR) pFrame->m_pPlayList->GetURL() )) {
- pFrame->console_service = "main service";
- } else {
- pFrame->console_service = evt->message.service;
- }
- if (evt->message.error!=GF_OK) {
- if (evt->message.error<GF_OK || !gpac->m_NoConsole) {
- pFrame->console_err = evt->message.error;
- pFrame->console_message = evt->message.message;
- gpac->m_pMainWnd->PostMessage(WM_CONSOLEMSG, 0, 0);
-
- /*any error before connection confirm is a service connection error*/
- if (!gpac->m_isopen) pFrame->m_pPlayList->SetDead();
- }
- return GF_FALSE;
- }
- if (gpac->m_NoConsole) return GF_FALSE;
-
- /*process user message*/
- pFrame->console_err = GF_OK;
- pFrame->console_message = evt->message.message;
- gpac->m_pMainWnd->PostMessage(WM_CONSOLEMSG, 0, 0);
- break;
- case GF_EVENT_PROGRESS:
- char *szType;
- if (evt->progress.progress_type==0) szType = "Buffer ";
- else if (evt->progress.progress_type==1) szType = "Download ";
- else if (evt->progress.progress_type==2) szType = "Import ";
- gf_set_progress(szType, evt->progress.done, evt->progress.total);
- break;
- case GF_EVENT_NAVIGATE_INFO:
- pFrame->console_message = evt->navigate.to_url;
- gpac->m_pMainWnd->PostMessage(WM_CONSOLEMSG, 1000, 0);
- break;
-
- case GF_EVENT_SCENE_SIZE:
- if (evt->size.width && evt->size.height) {
- gpac->orig_width = evt->size.width;
- gpac->orig_height = evt->size.height;
- if (gpac->m_term && !pFrame->m_bFullScreen)
- pFrame->PostMessage(WM_SETSIZE, evt->size.width, evt->size.height);
- }
- break;
- /*don't resize on win32 msg notif*/
-#if 0
- case GF_EVENT_SIZE:
- if (/*gpac->m_term && !pFrame->m_bFullScreen && */gpac->orig_width && (evt->size.width < W32_MIN_WIDTH) )
- pFrame->PostMessage(WM_SETSIZE, W32_MIN_WIDTH, (W32_MIN_WIDTH*gpac->orig_height) / gpac->orig_width);
- else
- pFrame->PostMessage(WM_SETSIZE, evt->size.width, evt->size.height);
- break;
-#endif
-
- case GF_EVENT_CONNECT:
-// if (pFrame->m_bStartupFile) return 0;
-
- pFrame->BuildStreamList(GF_TRUE);
- if (evt->connect.is_connected) {
- pFrame->BuildChapterList(GF_FALSE);
- gpac->m_isopen = GF_TRUE;
- //resetting sliders when opening a new file creates a deadlock on the window thread which is disconnecting
- pFrame->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, gpac->m_isopen ? 4 : 3);
- pFrame->m_Sliders.m_PosSlider.SetPos(0);
- pFrame->SetProgTimer(GF_TRUE);
- } else {
- gpac->max_duration = 0;
- gpac->m_isopen = GF_FALSE;
- pFrame->BuildChapterList(GF_TRUE);
- }
- if (!pFrame->m_bFullScreen) {
- pFrame->SetFocus();
- pFrame->SetForegroundWindow();
- }
- break;
-
- case GF_EVENT_QUIT:
- pFrame->PostMessage(WM_CLOSE, 0L, 0L);
- break;
- case GF_EVENT_MIGRATE:
- {
- }
- break;
- case GF_EVENT_KEYDOWN:
- gf_term_process_shortcut(gpac->m_term, evt);
- /*update volume control*/
- pFrame->m_Sliders.SetVolume();
-
- switch (evt->key.key_code) {
- case GF_KEY_HOME:
- gf_term_set_option(gpac->m_term, GF_OPT_NAVIGATION_TYPE, 1);
- break;
- case GF_KEY_ESCAPE:
- pFrame->PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);
- break;
- case GF_KEY_MEDIANEXTTRACK:
- pFrame->m_pPlayList->PlayNext();
- break;
- case GF_KEY_MEDIAPREVIOUSTRACK:
- pFrame->m_pPlayList->PlayPrev();
- break;
- case GF_KEY_H:
- if ((evt->key.flags & GF_KEY_MOD_CTRL) && gpac->m_isopen)
- gf_term_switch_quality(gpac->m_term, GF_TRUE);
- break;
- case GF_KEY_L:
- if ((evt->key.flags & GF_KEY_MOD_CTRL) && gpac->m_isopen)
- gf_term_switch_quality(gpac->m_term, GF_FALSE);
- break;
- case GF_KEY_LEFT:
- case GF_KEY_RIGHT:
- if (gpac->m_isopen && (gf_term_get_option(gpac->m_term, GF_OPT_NAVIGATION) == GF_NAVIGATE_NONE)) {
- if (evt->key.flags & GF_KEY_MOD_CTRL) {
- if (evt->key.key_code==GF_KEY_LEFT) pFrame->m_pPlayList->PlayPrev();
- else if (evt->key.key_code==GF_KEY_RIGHT) pFrame->m_pPlayList->PlayNext();
- }
- else if (gpac->can_seek && (evt->key.flags & GF_KEY_MOD_ALT)) {
- u32 duration = gpac->max_duration;
- s32 current_time = gf_term_get_time_in_ms(gpac->m_term);
-
- if (evt->key.key_code==GF_KEY_LEFT) {
- current_time -= 5*duration/100;
- if (current_time<0) current_time=0;
- gf_term_play_from_time(gpac->m_term, (u64) current_time, 0);
- }
- else if (evt->key.key_code==GF_KEY_RIGHT) {
- current_time += 5*duration/100;
- if ((u32) current_time < duration) {
- gf_term_play_from_time(gpac->m_term, (u64) current_time, 0);
- }
- }
- }
- }
- break;
- }
- break;
- case GF_EVENT_NAVIGATE:
- /*fixme - a proper browser would require checking mime type & co*/
- /*store URL since it may be destroyed, and post message*/
- gpac->m_navigate_url = evt->navigate.to_url;
- pFrame->PostMessage(WM_NAVIGATE, NULL, NULL);
- return GF_TRUE;
- case GF_EVENT_VIEWPOINTS:
- pFrame->BuildViewList();
- return GF_FALSE;
- case GF_EVENT_STREAMLIST:
- pFrame->BuildStreamList(GF_FALSE);
- return GF_FALSE;
- case GF_EVENT_SET_CAPTION:
- pFrame->SetWindowText(evt->caption.caption);
- break;
- case GF_EVENT_DBLCLICK:
- pFrame->PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);
- return GF_FALSE;
- case GF_EVENT_AUTHORIZATION:
- {
- UserPassDialog passdlg;
- return passdlg.GetPassword(evt->auth.site_url, evt->auth.user, evt->auth.password);
- }
- }
- return GF_FALSE;
-}
-
-
-/*here's the trick: use a storage section shared among all processes for the wnd handle and for the command line
-NOTE: this has to be static memory of course, don't try to alloc anything there...*/
-#pragma comment(linker, "/SECTION:.shr,RWS")
-#pragma data_seg(".shr")
-HWND static_gpac_hwnd = NULL;
-char static_szCmdLine[MAX_PATH] = "";
-#pragma data_seg()
-
-const char *static_gpac_get_url()
-{
- return (const char *) static_szCmdLine;
-}
-
-static void osmo4_do_log(void *cbk, GF_LOG_Level level, GF_LOG_Tool tool, const char *fmt, va_list list)
-{
- FILE *logs = (FILE *) cbk;
- vfprintf(logs, fmt, list);
- fflush(logs);
-}
-
-BOOL Osmo4::InitInstance()
-{
- CCommandLineInfo cmdInfo;
-
- afxAmbientActCtx = FALSE;
-
- m_logs = NULL;
-
- m_term = NULL;
-
- memset(&m_user, 0, sizeof(GF_User));
-
- /*get Osmo4.exe path*/
- strcpy((char *) szApplicationPath, AfxGetApp()->m_pszHelpFilePath);
- while (szApplicationPath[strlen((char *) szApplicationPath)-1] != '\\') szApplicationPath[strlen((char *) szApplicationPath)-1] = 0;
- if (szApplicationPath[strlen((char *) szApplicationPath)-1] != '\\') strcat(szApplicationPath, "\\");
-
- gf_sys_init(GF_MemTrackerNone);
-
- /*setup user*/
- memset(&m_user, 0, sizeof(GF_User));
-
- Bool first_launch = GF_FALSE;
- /*init config and modules*/
- m_user.config = gf_cfg_init(NULL, &first_launch);
- if (!m_user.config) {
- MessageBox(NULL, "GPAC Configuration file not found", "Fatal Error", MB_OK);
- m_pMainWnd->PostMessage(WM_CLOSE);
- }
-
- char *name = gf_cfg_get_filename(m_user.config);
- char *sep = strrchr(name, '\\');
- if (sep) sep[0] = 0;
- strcpy(szUserPath, name);
- if (sep) sep[0] = '\\';
-
- const char *opt = gf_cfg_get_key(m_user.config, "General", "SingleInstance");
- m_SingleInstance = (opt && !stricmp(opt, "yes")) ? GF_TRUE : GF_FALSE;
-
- m_hMutex = NULL;
- if (m_SingleInstance) {
- m_hMutex = CreateMutex(NULL, FALSE, "Osmo4_GPAC_INSTANCE");
- if ( GetLastError() == ERROR_ALREADY_EXISTS ) {
- char szDIR[1024];
- if (m_hMutex) CloseHandle(m_hMutex);
- m_hMutex = NULL;
-
- if (!static_gpac_hwnd || !IsWindow(static_gpac_hwnd) ) {
- ::MessageBox(NULL, "Osmo4 ghost process detected", "Error at last shutdown" , MB_OK);
- } else {
- ::SetForegroundWindow(static_gpac_hwnd);
-
- if (m_lpCmdLine && strlen(m_lpCmdLine)) {
- DWORD_PTR res;
- size_t len;
- char *the_url, *cmd;
- GetCurrentDirectory(1024, szDIR);
- if (szDIR[strlen(szDIR)-1] != '\\') strcat(szDIR, "\\");
- cmd = (char *)(const char *) m_lpCmdLine;
- strcpy(static_szCmdLine, "");
- if (cmd[0]=='"') cmd+=1;
-
- if (!strnicmp(cmd, "-queue ", 7)) {
- strcat(static_szCmdLine, "-queue ");
- cmd += 7;
- }
- the_url = gf_url_concatenate(szDIR, cmd);
- if (!the_url) {
- strcat(static_szCmdLine, cmd);
- } else {
- strcat(static_szCmdLine, the_url);
- gf_free(the_url);
- }
- while ( (len = strlen(static_szCmdLine)) ) {
- char s = static_szCmdLine[len-1];
- if ((s==' ') || (s=='"')) static_szCmdLine[len-1]=0;
- else break;
- }
- ::SendMessageTimeout(static_gpac_hwnd, WM_NEWINSTANCE, 0, 0, 0, 1000, &res);
- }
- }
-
- return FALSE;
- }
- }
-
-#if 0
- // Standard initialization
-#ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
-#else
- Enable3dControlsStatic(); // Call this when linking to MFC statically
-#endif
-
-#endif
-
- SetRegistryKey(_T("GPAC"));
- CMainFrame* pFrame = new CMainFrame;
- m_pMainWnd = pFrame;
- pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL);
- pFrame->LoadAccelTable( MAKEINTRESOURCE(IDR_MAINACCEL));
-
- m_pMainWnd->DragAcceptFiles();
-
- if (m_SingleInstance) static_gpac_hwnd = m_pMainWnd->m_hWnd;
-
- m_user.modules = gf_modules_new(NULL, m_user.config);
- if (!m_user.modules || ! gf_modules_get_count(m_user.modules) ) {
- MessageBox(NULL, "No modules available - system cannot work", "Fatal Error", MB_OK);
- m_pMainWnd->PostMessage(WM_CLOSE);
- }
- else if (first_launch) {
- /*first launch, register all files ext*/
- u32 i;
- for (i=0; i<gf_modules_get_count(m_user.modules); i++) {
- GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(m_user.modules, i, GF_NET_CLIENT_INTERFACE);
- if (!ifce) continue;
- if (ifce) {
- ifce->CanHandleURL(ifce, "test.test");
- gf_modules_close_interface((GF_BaseInterface *)ifce);
- }
- }
- /*set some shortcuts*/
- gf_cfg_set_key(m_user.config, "Shortcuts", "VolumeUp", "ctrl+Up");
- gf_cfg_set_key(m_user.config, "Shortcuts", "VolumeDown", "ctrl+Down");
- gf_cfg_set_key(m_user.config, "Shortcuts", "FastRewind", "ctrl+Left");
- gf_cfg_set_key(m_user.config, "Shortcuts", "FastForward", "ctrl+Right");
- gf_cfg_set_key(m_user.config, "Shortcuts", "Play", "ctrl+ ");
- }
-
- /*check log file*/
- const char *str = gf_cfg_get_key(m_user.config, "General", "LogFile");
- if (str) {
- m_logs = gf_fopen(str, "wt");
- gf_log_set_callback(m_logs, osmo4_do_log);
- }
- else m_logs = NULL;
-
- /*set log level*/
- if (gf_log_set_tools_levels(gf_cfg_get_key(m_user.config, "General", "Logs")) != GF_OK)
- fprintf(stdout, "osmo4: invalid log level specified\n");
-
- m_user.opaque = this;
- m_user.os_window_handler = pFrame->m_pWndView->m_hWnd;
- m_user.EventProc = Osmo4_EventProc;
-
- m_reset = GF_FALSE;
- orig_width = 320;
- orig_height = 240;
-
- gf_set_progress_callback(this, Osmo4_progress_cbk);
-
- m_term = gf_term_new(&m_user);
- if (! m_term) {
- MessageBox(NULL, "Cannot load GPAC Terminal", "Fatal Error", MB_OK);
- m_pMainWnd->PostMessage(WM_CLOSE);
- return TRUE;
- }
- SetOptions();
- UpdateRenderSwitch();
-
- pFrame->SendMessage(WM_SETSIZE, orig_width, orig_height);
- pFrame->m_Address.ReloadURLs();
-
- pFrame->m_Sliders.SetVolume();
-
- m_reconnect_time = 0;
-
-
- ParseCommandLine(cmdInfo);
-
- start_mode = 0;
-
- if (! cmdInfo.m_strFileName.IsEmpty()) {
- pFrame->m_pPlayList->QueueURL(cmdInfo.m_strFileName);
- pFrame->m_pPlayList->RefreshList();
- pFrame->m_pPlayList->PlayNext();
- } else {
- char sPL[MAX_PATH];
- strcpy((char *) sPL, szUserPath);
- strcat(sPL, "gpac_pl.m3u");
- pFrame->m_pPlayList->OpenPlayList(sPL);
- const char *sOpt = gf_cfg_get_key(GetApp()->m_user.config, "General", "PLEntry");
- if (sOpt) {
- s32 count = (s32)gf_list_count(pFrame->m_pPlayList->m_entries);
- pFrame->m_pPlayList->m_cur_entry = atoi(sOpt);
- if (pFrame->m_pPlayList->m_cur_entry>=count)
- pFrame->m_pPlayList->m_cur_entry = count-1;
- } else {
- pFrame->m_pPlayList->m_cur_entry = -1;
- }
-#if 0
- if (pFrame->m_pPlayList->m_cur_entry>=0) {
- start_mode = 1;
- pFrame->m_pPlayList->Play();
- }
-#endif
-
- sOpt = gf_cfg_get_key(m_user.config, "General", "StartupFile");
- if (sOpt && !strstr(sOpt, "gui") ) gf_term_connect(m_term, sOpt);
-
- sOpt = gf_cfg_get_key(m_user.config, "General", "PlaylistLoop");
- m_Loop = (sOpt && !strcmp(sOpt, "yes")) ? GF_TRUE : GF_FALSE;
- }
- pFrame->SetFocus();
- pFrame->SetForegroundWindow();
- return TRUE;
-}
-
-int Osmo4::ExitInstance()
-{
- if (m_term) gf_term_del(m_term);
- if (m_user.modules) gf_modules_del(m_user.modules);
- if (m_user.config) gf_cfg_del(m_user.config);
- gf_sys_close();
- /*last instance*/
- if (m_hMutex) {
- CloseHandle(m_hMutex);
- static_gpac_hwnd = NULL;
- }
- if (m_logs) gf_fclose(m_logs);
- return CWinApp::ExitInstance();
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4 message handlers
-
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDlg dialog used for App About
-
-class CAboutDlg : public CDialog
-{
-public:
- CAboutDlg();
-
-// Dialog Data
- //{{AFX_DATA(CAboutDlg)
- enum { IDD = IDD_ABOUTBOX };
- //}}AFX_DATA
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CAboutDlg)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
- //{{AFX_MSG(CAboutDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnGogpac();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
-{
- //{{AFX_DATA_INIT(CAboutDlg)
- //}}AFX_DATA_INIT
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAboutDlg)
- //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- //{{AFX_MSG_MAP(CAboutDlg)
- ON_BN_CLICKED(IDC_GOGPAC, OnGogpac)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-void Osmo4::OnAbout()
-{
- CAboutDlg aboutDlg;
- aboutDlg.DoModal();
-}
-
-BOOL CAboutDlg::OnInitDialog()
-{
- CDialog::OnInitDialog();
- CString str = "GPAC/Osmo4 - version " GPAC_FULL_VERSION;
- SetWindowText(str);
- return TRUE;
-}
-
-void CAboutDlg::OnGogpac()
-{
- ShellExecute(NULL, "open", "http://gpac.io", NULL, NULL, SW_SHOWNORMAL);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4 message handlers
-
-
-void Osmo4::SetOptions()
-{
- const char *sOpt = gf_cfg_get_key(m_user.config, "General", "Loop");
- m_Loop = (sOpt && !stricmp(sOpt, "yes")) ? GF_TRUE : GF_FALSE;
- sOpt = gf_cfg_get_key(m_user.config, "General", "LookForSubtitles");
- m_LookForSubtitles = (sOpt && !stricmp(sOpt, "yes")) ? GF_TRUE : GF_FALSE;
- sOpt = gf_cfg_get_key(m_user.config, "General", "ConsoleOff");
- m_NoConsole = (sOpt && !stricmp(sOpt, "yes")) ? GF_TRUE : GF_FALSE;
- sOpt = gf_cfg_get_key(m_user.config, "General", "ViewXMT");
- m_ViewXMTA = (sOpt && !stricmp(sOpt, "yes")) ? GF_TRUE : GF_FALSE;
- sOpt = gf_cfg_get_key(m_user.config, "General", "NoMIMETypeFetch");
- m_NoMimeFetch = (!sOpt || !stricmp(sOpt, "yes")) ? GF_TRUE : GF_FALSE;
-}
-
-
-void Osmo4::OnOpenUrl()
-{
- COpenUrl url;
- if (url.DoModal() != IDOK) return;
-
- CMainFrame *pFrame = (CMainFrame *) m_pMainWnd;
- pFrame->m_pPlayList->Truncate();
- pFrame->m_pPlayList->QueueURL(url.m_url);
- pFrame->m_pPlayList->RefreshList();
- pFrame->m_pPlayList->PlayNext();
-}
-
-
-CString Osmo4::GetFileFilter()
-{
- u32 keyCount, i;
- CString sFiles;
- CString sExts;
- CString supportedFiles;
-
- /*force MP4 and 3GP files at beginning to make sure they are selected (Win32 bug with too large filters)*/
- supportedFiles = "All Known Files|*.m3u;*.pls;*.mp4;*.3gp;*.3g2";
-
- sExts = "";
- sFiles = "";
- keyCount = gf_cfg_get_key_count(m_user.config, "MimeTypes");
- for (i=0; i<keyCount; i++) {
- const char *sMime;
- Bool first;
- char *sKey;
- const char *opt;
- char szKeyList[1000], sDesc[1000];
- sMime = gf_cfg_get_key_name(m_user.config, "MimeTypes", i);
- if (!sMime) continue;
- CString sOpt;
- opt = gf_cfg_get_key(m_user.config, "MimeTypes", sMime);
- /*remove module name*/
- strcpy(szKeyList, opt+1);
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- sKey[0] = 0;
- /*get description*/
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- strcpy(sDesc, sKey+1);
- sKey[0] = 0;
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- sKey[0] = 0;
-
- /*if same description for # mime types skip (means an old mime syntax)*/
- if (sFiles.Find(sDesc)>=0) continue;
- /*if same extensions for # mime types skip (don't polluate the file list)*/
- if (sExts.Find(szKeyList)>=0) continue;
-
- sExts += szKeyList;
- sExts += " ";
- sFiles += sDesc;
- sFiles += "|";
-
- first = GF_TRUE;
-
- sOpt = CString(szKeyList);
- while (1) {
-
- int pos = sOpt.Find(' ');
- CString ext = (pos==-1) ? sOpt : sOpt.Left(pos);
- /*WATCHOUT: we do have some "double" ext , eg .wrl.gz - these are NOT supported by windows*/
- if (ext.Find(".")<0) {
- if (!first) {
- sFiles += ";";
- } else {
- first = GF_FALSE;
- }
- sFiles += "*.";
- sFiles += ext;
-
- CString sext = ext;
- sext += ";";
- if (supportedFiles.Find(sext)<0) {
- supportedFiles += ";*.";
- supportedFiles += ext;
- }
- }
-
- if (sOpt==ext) break;
- CString rem;
- rem.Format("%s ", (LPCTSTR) ext);
- sOpt.Replace((LPCTSTR) rem, "");
- }
- sFiles += "|";
- }
- supportedFiles += "|";
- supportedFiles += sFiles;
- supportedFiles += "M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|All Files |*.*|";
- return supportedFiles;
-}
-
-void Osmo4::OnOpenFile()
-{
- CString sFiles = GetFileFilter();
- u32 nb_items;
-
- /*looks like there's a bug here, main filter isn't used correctly while the others are*/
- CFileDialog fd(TRUE,NULL,NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST , sFiles);
- fd.m_ofn.nMaxFile = 25000;
- fd.m_ofn.lpstrFile = (char *) gf_malloc(sizeof(char) * fd.m_ofn.nMaxFile);
- fd.m_ofn.lpstrFile[0] = 0;
-
- if (fd.DoModal()!=IDOK) {
- gf_free(fd.m_ofn.lpstrFile);
- return;
- }
-
- CMainFrame *pFrame = (CMainFrame *) m_pMainWnd;
-
- nb_items = 0;
- POSITION pos = fd.GetStartPosition();
- while (pos) {
- CString file = fd.GetNextPathName(pos);
- nb_items++;
- }
- /*if several items, act as playlist (replace playlist), otherwise as browser (lost all "next" context)*/
- if (nb_items==1)
- pFrame->m_pPlayList->Truncate();
- else
- pFrame->m_pPlayList->Clear();
-
- pos = fd.GetStartPosition();
- while (pos) {
- CString file = fd.GetNextPathName(pos);
- pFrame->m_pPlayList->QueueURL(file);
- }
- gf_free(fd.m_ofn.lpstrFile);
- pFrame->m_pPlayList->RefreshList();
- pFrame->m_pPlayList->PlayNext();
-}
-
-
-void Osmo4::Pause()
-{
- if (!m_isopen) return;
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) ? GF_STATE_PAUSED : GF_STATE_PLAYING);
-}
-
-void Osmo4::OnMainPause()
-{
- Pause();
-}
-
-void Osmo4::OnFileStep()
-{
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_STEP_PAUSE);
- ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 3);
-}
-void Osmo4::OnUpdateFileStep(CCmdUI* pCmdUI)
-{
- pCmdUI->Enable(m_isopen && !m_reset);
-}
-
-void Osmo4::PlayFromTime(u32 time)
-{
- Bool do_pause;
- if (start_mode==1) do_pause = GF_TRUE;
- else if (start_mode==2) do_pause = GF_FALSE;
- else do_pause = /*!m_AutoPlay*/GF_FALSE;
- gf_term_play_from_time(m_term, time, do_pause);
- m_reset = GF_FALSE;
-}
-
-
-void Osmo4::OnFileReload()
-{
- gf_term_disconnect(m_term);
- m_pMainWnd->PostMessage(WM_OPENURL);
-}
-
-void Osmo4::OnFileMigrate()
-{
-}
-
-void Osmo4::OnConfigReload()
-{
- gf_term_set_option(m_term, GF_OPT_RELOAD_CONFIG, 1);
-}
-
-void Osmo4::UpdatePlayButton(Bool force_play)
-{
- if (!force_play && gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
- ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 4);
- } else {
- ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 3);
- }
-}
-
-void Osmo4::OnFilePlay()
-{
- if (m_isopen) {
- if (m_reset) {
- m_reset = GF_FALSE;
- PlayFromTime(0);
- ((CMainFrame *)m_pMainWnd)->SetProgTimer(GF_TRUE);
- } else {
- Pause();
- }
- UpdatePlayButton();
- } else {
- ((CMainFrame *) m_pMainWnd)->m_pPlayList->Play();
- }
-}
-
-void Osmo4::OnUpdateFilePlay(CCmdUI* pCmdUI)
-{
- if (m_isopen) {
- pCmdUI->Enable(TRUE);
- if (pCmdUI->m_nID==ID_FILE_PLAY) {
- if (!m_isopen) {
- pCmdUI->SetText("Play/Pause\tCtrl+P");
- } else if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
- pCmdUI->SetText("Pause\tCtrl+P");
- } else {
- pCmdUI->SetText("Resume\tCtrl+P");
- }
- }
- } else {
- pCmdUI->Enable(((CMainFrame *)m_pMainWnd)->m_pPlayList->HasValidEntries() );
- pCmdUI->SetText("Play\tCtrl+P");
- }
-}
-
-void Osmo4::OnFileStop()
-{
- CMainFrame *pFrame = (CMainFrame *) m_pMainWnd;
- if (m_reset) return;
- if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) Pause();
- m_reset = GF_TRUE;
- pFrame->m_Sliders.m_PosSlider.SetPos(0);
- pFrame->SetProgTimer(GF_FALSE);
- pFrame->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 3);
- start_mode = 2;
-}
-
-void Osmo4::OnUpdateFileStop(CCmdUI* pCmdUI)
-{
-// pCmdUI->Enable(m_isopen);
-}
-
-void Osmo4::OnSwitchRender()
-{
- const char *opt = gf_cfg_get_key(m_user.config, "Compositor", "OpenGLMode");
- Bool use_gl = (opt && !stricmp(opt, "always")) ? GF_TRUE : GF_FALSE;
- gf_cfg_set_key(m_user.config, "Compositor", "OpenGLMode", use_gl ? "disable" : "always");
-
- gf_term_set_option(m_term, GF_OPT_USE_OPENGL, !use_gl);
-
- UpdateRenderSwitch();
-}
-
-void Osmo4::UpdateRenderSwitch()
-{
- const char *opt = gf_cfg_get_key(m_user.config, "Compositor", "OpenGLMode");
- if (opt && !stricmp(opt, "disable"))
- ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(12, ID_SWITCH_RENDER, TBBS_BUTTON, 10);
- else
- ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(12, ID_SWITCH_RENDER, TBBS_BUTTON, 9);
-}
+++ /dev/null
-// GPAC.h : main header file for the GPAC application
-//
-
-#if !defined(AFX_GPAC_H__8B06A368_E142_47E3_ABE7_0B459FC0E853__INCLUDED_)
-#define AFX_GPAC_H__8B06A368_E142_47E3_ABE7_0B459FC0E853__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#ifndef __AFXWIN_H__
-#error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "resource.h" // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4:
-// See GPAC.cpp for the implementation of this class
-//
-
-
-/*GPAC terminal*/
-#include <gpac/terminal.h>
-/*GPAC terminal info (OD browsing)*/
-#include <gpac/term_info.h>
-
-enum {
- WM_SCENE_DONE = WM_USER + 1,
- WM_NAVIGATE,
- WM_SETSIZE,
- WM_OPENURL,
- WM_RESTARTURL,
- WM_CONSOLEMSG,
- WM_NEWINSTANCE,
-};
-
-const char *static_gpac_get_url();
-
-class Osmo4 : public CWinApp
-{
-public:
- Osmo4();
-
- GF_Terminal *m_term;
- GF_User m_user;
-
- Bool m_isopen, m_reset;
- u32 max_duration;
- Bool can_seek;
- u32 orig_width,orig_height, m_reconnect_time;
-
- CString m_navigate_url;
- void Pause();
- void PlayFromTime(u32 time);
-
- void SetOptions();
- void UpdateRenderSwitch();
- void UpdatePlayButton(Bool force_play = GF_FALSE);
-
- /*general options*/
- Bool m_Loop, m_LookForSubtitles, m_NoConsole, m_ViewXMTA, m_SingleInstance, m_NoMimeFetch;
- u32 start_mode;
-
- CString GetFileFilter();
-
- char szApplicationPath[GF_MAX_PATH];
- char szUserPath[GF_MAX_PATH];
-
- FILE *m_logs;
-
- HANDLE m_hMutex;
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(Osmo4)
-public:
- virtual BOOL InitInstance();
- virtual int ExitInstance();
- //}}AFX_VIRTUAL
-
-// Implementation
-
-public:
- //{{AFX_MSG(Osmo4)
- afx_msg void OnOpenFile();
- afx_msg void OnMainPause();
- afx_msg void OnFileStep();
- afx_msg void OnOpenUrl();
- afx_msg void OnFileReload();
- afx_msg void OnFileMigrate();
- afx_msg void OnConfigReload();
- afx_msg void OnFilePlay();
- afx_msg void OnUpdateFilePlay(CCmdUI* pCmdUI);
- afx_msg void OnUpdateFileStep(CCmdUI* pCmdUI);
- afx_msg void OnFileStop();
- afx_msg void OnUpdateFileStop(CCmdUI* pCmdUI);
- afx_msg void OnSwitchRender();
- afx_msg void OnAbout();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-inline Osmo4 *GetApp() {
- return (Osmo4 *)AfxGetApp();
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_GPAC_H__8B06A368_E142_47E3_ABE7_0B459FC0E853__INCLUDED_)
+++ /dev/null
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (United States) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_MAINFRAME MENU
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "&Open File\tCtrl+O", ID_OPEN_FILE
- MENUITEM "Open &URL\tCtrl+U", ID_OPEN_URL
- MENUITEM SEPARATOR
- MENUITEM "File Propert&ies\tCtrl+I", ID_FILE_PROP
- POPUP "Streaming Cache"
- BEGIN
- MENUITEM "&Enable", ID_REC_ENABLE
- MENUITEM "&Stop and Save", ID_REC_STOP
- MENUITEM "&Abort", ID_REC_ABORT
- END
- MENUITEM SEPARATOR
- MENUITEM "Copy", ID_FILE_COPY
- MENUITEM "Paste", ID_FILE_PASTE
- MENUITEM SEPARATOR
- MENUITEM "Exit", ID_FILE_EXIT
- END
- POPUP "View"
- BEGIN
- POPUP "Viewpoint"
- BEGIN
- MENUITEM "", ID_VIEWPORT_EMPTY
- END
- POPUP "&Navigation"
- BEGIN
- MENUITEM "Headlight", ID_HEADLIGHT
- MENUITEM SEPARATOR
- MENUITEM "&None", ID_NAVIGATE_NONE
- MENUITEM "&Walk", ID_NAVIGATE_WALK
- MENUITEM "&Fly", ID_NAVIGATE_FLY
- MENUITEM "&Examine", ID_NAVIGATE_EXAM
- MENUITEM "&Pan", ID_NAVIGATE_PAN
- MENUITEM "&Slide", ID_NAVIGATE_SLIDE
- MENUITEM "&Orbit", ID_NAVIGATE_ORBIT
- MENUITEM "&VR", ID_NAVIGATE_VR
- MENUITEM "&Game", ID_NAVIGATE_GAME
- MENUITEM SEPARATOR
- POPUP "Collision"
- BEGIN
- MENUITEM "Off", ID_COLLIDE_NONE
- MENUITEM "Regular", ID_COLLIDE_REG
- MENUITEM "Displacement", ID_COLLIDE_DISP
- END
- MENUITEM "Gravity", ID_GRAVITY
- MENUITEM SEPARATOR
- MENUITEM "&Reset", ID_NAV_RESET
- END
- MENUITEM SEPARATOR
- MENUITEM "&Fullscreen", ID_VIEW_FULLSCREEN
- MENUITEM "Original &Aspect", ID_VIEW_ORIGINAL
- POPUP "Aspect &Ratio"
- BEGIN
- MENUITEM "&Keep Original", ID_AR_KEEP
- MENUITEM "&Fill Screen", ID_AR_FILL
- MENUITEM "Ratio 4/3", ID_AR_43
- MENUITEM "Ratio 16/9", ID_AR_169
- END
- MENUITEM SEPARATOR
- MENUITEM "Resource Usage", ID_VIEW_CPU
- MENUITEM SEPARATOR
- MENUITEM "&Options", IDD_CONFIGURE
- END
- POPUP "Play"
- BEGIN
- POPUP "Stream &Selection"
- BEGIN
- POPUP "Audio"
- BEGIN
- MENUITEM "", ID_AUDIO_EMPTY
- END
- POPUP "Video"
- BEGIN
- MENUITEM "", ID_VIDEO_EMPTY
- END
- POPUP "Subtitle"
- BEGIN
- MENUITEM "", ID_SUBS_EMPTY
- END
- MENUITEM SEPARATOR
- MENUITEM "Add Subtitle", ID_ADD_SUBTITLE
- END
- POPUP "&Chapters"
- BEGIN
- MENUITEM "", ID_SETCHAP_FIRST
- END
- MENUITEM SEPARATOR
- MENUITEM "Playlist\tF3", ID_VIEW_PL, CHECKED
- MENUITEM "&Loop Playlist", ID_PLAYLIST_LOOP
- MENUITEM SEPARATOR
- MENUITEM "Play/Pause\tCtrl+P", ID_FILE_PLAY
- MENUITEM "Step-by-Step\tCtrl+S", ID_FILE_STEP
- MENUITEM "Stop", ID_FILE_STOP
- MENUITEM SEPARATOR
- MENUITEM "Reload File\tF5", ID_FILE_RELOAD
- MENUITEM SEPARATOR
- MENUITEM "Clear History", ID_CLEAR_NAV
- MENUITEM "Reload Config", ID_CONFIG_RELOAD
- END
- POPUP "?"
- BEGIN
- MENUITEM "Shortcut List", ID_SHORTCUTS
- MENUITEM "Navigation Keys", ID_NAV_INFO
- MENUITEM SEPARATOR
- MENUITEM "&About ...", ID_H_ABOUT
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOGEX 0, 0, 209, 137
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_CLIENTEDGE
-CAPTION "Osmo4 / GPAC version X.X.X"
-FONT 8, "MS Sans Serif", 0, 0, 0x1
-BEGIN
- ICON IDR_MAINFRAME,IDC_STATIC,8,4,20,20
- CTEXT "Osmo4 Player - GPAC Multimedia Framework",IDC_STATIC,31,10,150,10,SS_NOPREFIX
- CTEXT "(c) 2000-2013 Telecom ParisTech\nAll Rights Reserved",IDC_STATIC,4,64,201,18
- CTEXT "This program is free software and may be distributed according to the terms of the GNU Lesser General Public License",IDC_STATIC,4,26,200,18
- PUSHBUTTON "http://gpac.io",IDC_GOGPAC,43,47,121,13,BS_FLAT,WS_EX_STATICEDGE
- GROUPBOX "With Many Thanks To:",IDC_STATIC,3,82,203,53
- CTEXT "The FreeType Project\nMozilla SpiderMonkey (JavaScript support)\n\nZLIB, the PNG Group, the I.J.G.\nFFMPEG, FAAD, XVID, MAD",IDC_STATIC,9,92,189,41
-END
-
-IDD_PASSWD DIALOG 0, 0, 134, 71
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Enter user name and password"
-FONT 8, "MS Sans Serif"
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,4,56,50,12
- PUSHBUTTON "Cancel",IDCANCEL,80,56,50,12
- LTEXT "Static__________________________",IDC_TXT_SITE,25,4,105,8
- LTEXT "Login",IDC_STATIC,7,21,18,8
- LTEXT "Password",IDC_STATIC,7,37,32,8
- EDITTEXT IDC_EDIT_USER,47,18,55,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT_PASSWORD,47,34,55,14,ES_PASSWORD | ES_AUTOHSCROLL
- LTEXT "Site",IDC_STATIC,7,4,13,8
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "FileDescription", "Osmo4-GPAC"
- VALUE "FileVersion", "0.8.0"
- VALUE "InternalName", "Osmo4"
- VALUE "LegalCopyright", "Copyright (C) Telecom ParisTech 2005-2012"
- VALUE "OriginalFilename", "Osmo4.EXE"
- VALUE "ProductName", "Osmo4-GPAC"
- VALUE "ProductVersion", "0.8.0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_ABOUTBOX, DIALOG
- BEGIN
- BOTTOMMARGIN, 136
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Toolbar
-//
-
-IDR_MAINTOOLS TOOLBAR 16, 15
-BEGIN
- BUTTON ID_OPEN_FILE
- BUTTON ID_NAV_PREV
- BUTTON ID_NAV_NEXT
- BUTTON ID_FILE_PLAY
- BUTTON ID_FILE_PLAY
- BUTTON ID_FILE_STEP
- BUTTON ID_FILE_STOP
- BUTTON ID_FILE_PROPS
- BUTTON IDD_CONFIGURE
- BUTTON ID_SWITCH_RENDER
- BUTTON ID_SWITCH_RENDER
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDR_MAINTOOLS BITMAP "res\\maintool.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
- IDR_MAINFRAME "Osmo4"
-END
-
-STRINGTABLE
-BEGIN
- AFX_IDS_APP_TITLE "Osmo4"
- AFX_IDS_IDLEMESSAGE "Ready"
-END
-
-STRINGTABLE
-BEGIN
- ID_FILE_EXIT "Quit the application; prompts to save documents\nExit"
- ID_H_ABOUT "Display program information, version number and copyright\nAbout"
- ID_PLAYLIST_LOOP "Restarts playlist from beginning when playlist is over"
- ID_OPEN_FILE "Opens local file"
- ID_VIEW_ORIGINAL "restore Original Aspect of presentation"
-END
-
-STRINGTABLE
-BEGIN
- ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
-END
-
-STRINGTABLE
-BEGIN
- AFX_IDS_SCSIZE "Change the window size"
- AFX_IDS_SCMOVE "Change the window position"
- AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
- AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
- AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
- AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
- AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
-END
-
-STRINGTABLE
-BEGIN
- AFX_IDS_SCRESTORE "Restore the window to normal size"
- AFX_IDS_SCTASKLIST "Activate Task List"
-END
-
-STRINGTABLE
-BEGIN
- ID_FILE_STOP "Stops current presentation"
- ID_SWITCH_RENDER "Switch between 2D and 3D renderers"
- ID_COLLIDE_NONE "Turns collision detection off"
- ID_COLLIDE_REG "Turns collision detection on"
- ID_COLLIDE_DISP "Collision with camera displacement"
- ID_HEADLIGHT "Turns headlight on/off"
-END
-
-STRINGTABLE
-BEGIN
- ID_CLEAR_NAV "Clears navigation history"
- ID_TIMER " "
- ID_FPS " "
- ID_VIEW_PL "View navigation history as a playlist"
-END
-
-STRINGTABLE
-BEGIN
- ID_VIEW_FULLSCREEN "Move to Full Screen mode (Esc to exit)"
- ID_AR_KEEP "Keep Aspect Ratio of presentation"
- ID_SHORTCUTS "List of available shortcuts"
- ID_FILE_PROP "Show presentation properties"
- ID_FILE_STEP "Step one frame into presentation"
- IDD_CONFIGURE "Configure Player"
- ID_VIEW_SCALABLE "Uses vectorial zooming when resizing the window"
- ID_OPEN_URL "Open remote presentation"
- ID_FILE_RELOAD "Reload current presentation"
- ID_FILE_PLAY "Play/Pause presentation"
- ID_NAVIGATE_NONE "Disable navigation"
-END
-
-STRINGTABLE
-BEGIN
- ID_NAVIGATE_WALK "Turn walk navigation on"
- ID_AR_FILL "Ignores Aspect Ratio and always fill screen"
- ID_AR_43 "Forces Aspect Ratio of 4/3"
- ID_AR_169 "Forces Aspect Ratio of 16/9"
- ID_NAV_RESET "Restore last viewpoint"
-END
-
-STRINGTABLE
-BEGIN
- ID_NAVIGATE_VR "QT-VR like navigation"
- ID_REC_ENABLE "Enable recording of streaming data"
- ID_REC_STOP "Stops recording and save to file"
- ID_REC_ABORT "Stops recording and discard data"
-END
-
-STRINGTABLE
-BEGIN
- ID_FILE_COPY "Copy selected text to clipboard"
- ID_FILE_PASTE "Paste clipboard"
-END
-
-#endif // English (United States) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// French (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_OPENFILE DIALOG 0, 0, 301, 23
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Select Location"
-FONT 8, "MS Sans Serif"
-BEGIN
- COMBOBOX IDC_COMBOURL,3,5,273,67,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- DEFPUSHBUTTON "OK",IDC_BUTGO,279,5,19,13
-END
-
-IDD_OPTIONS DIALOG 0, 0, 174, 106
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Osmo4 Options"
-FONT 8, "MS Sans Serif"
-BEGIN
- PUSHBUTTON "Apply",IDC_SAVEOPT,147,2,26,12
- COMBOBOX IDC_SELECT,42,2,99,173,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Category",IDC_STATIC,7,4,29,8
-END
-
-IDD_OPT_GEN DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- CONTROL "Loop At End",IDC_LOOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,4,55,10
- CONTROL "Look for subtitles",IDC_LOOKFORSUB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,42,69,10
- CONTROL "Disable console messages",IDC_NO_CONSOLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,17,99,10
- CONTROL "View Graph in XMT-A format",IDC_DUMP_XMT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,30,105,10
- CONTROL "Single Instance",IDC_SINGLE_INSTANCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,54,65,10
-END
-
-IDD_OPT_RENDER DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "Rendering Frame Rate",IDC_STATIC,5,4,72,8
- COMBOBOX IDC_BIFS_RATE,81,2,84,55,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Fast Rendering",IDC_FAST_RENDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,49,64,10
- CONTROL "Force Scene Size",IDC_FORCE_SIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,49,72,10
- LTEXT "Anti-Aliasing Level",IDC_STATIC,7,20,58,8
- COMBOBOX IDC_AA_LIST,81,17,84,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Use 3D Renderer",IDC_USE_RENDER3D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,63,71,10
- LTEXT "2D Rasterizer",IDC_STATIC,7,35,44,8
- COMBOBOX IDC_GD_LIST,81,33,84,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_DRAW_BOUNDS,109,60,56,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Bounds",IDC_STATIC,82,64,25,8
-END
-
-IDD_OPT_AUDIO DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_THICKFRAME
-FONT 8, "MS Sans Serif"
-BEGIN
- CONTROL "Spin1",IDC_SPIN_AUDIO,"msctls_updown32",UDS_SETBUDDYINT | UDS_ARROWKEYS,27,15,11,14
- EDITTEXT IDC_EDIT_AUDIO,5,15,19,14,ES_READONLY | ES_NUMBER
- CONTROL "Force Audio Config",IDC_FORCE_AUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,3,73,10
- LTEXT "buffers",IDC_STATIC,43,18,23,8
- CONTROL "Spin1",IDC_SPIN_FPS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ARROWKEYS,104,15,11,14
- EDITTEXT IDC_AUDIO_FPS,77,15,24,14,ES_NUMBER
- LTEXT "Audio Driver",IDC_STATIC,7,63,40,8
- CONTROL "No Resynchronization",IDC_AUDIO_RESYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,46,82,10
- COMBOBOX IDC_DRIVER_LIST,63,60,103,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Disable Notifications",IDC_AUDIO_NOTIFS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,47,79,10
- CONTROL "Disable Multichannel",IDC_AUDIO_MULTICH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,34,81,10
- LTEXT "ms total length",IDC_STATIC,118,18,49,8
-END
-
-IDD_OPT_VIDEO DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "Video Driver",IDC_STATIC,6,7,40,8
- COMBOBOX IDC_VIDEO_LIST,55,5,111,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Change video resolution in fullscreen",IDC_SWITCH_RES,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,29,131,10
- CONTROL "Use Hardware Video Memory in 2D mode",IDC_HWMEMORY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,44,143,10
-END
-
-IDD_OPT_HTTP DIALOGEX 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
- PUSHBUTTON "...",IDC_BROWSE_CACHE,57,4,109,12
- CONTROL "Clean cache at exit",IDC_CLEAN_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,87,23,77,10
- CONTROL "Disable Cache",IDC_RESTART_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,22,62,10
- LTEXT "Cache Directory",IDC_STATIC,5,5,52,8
- CONTROL "XML progressive load",IDC_SAX_PROGRESSIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,42,84,10
- EDITTEXT IDC_SAX_DELAY,142,41,22,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "TimeSlice (ms)",IDC_STATIC,91,43,46,8
- EDITTEXT IDC_HTTP_PROXY,54,58,111,12,ES_AUTOHSCROLL
- CONTROL "Use proxy",IDC_HTTP_USE_PROXY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,59,47,10
-END
-
-IDD_OPT_FONT DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "Font Engine",IDC_STATIC,6,11,39,8
- COMBOBOX IDC_FONT_LIST,60,8,105,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "...",IDC_BROWSE_FONT,2,40,164,12
- LTEXT "System Font Directory",IDC_STATIC,46,29,70,8
- COMBOBOX IDC_TEXTURE_MODE,101,58,64,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Text Texturing Mode",IDC_STATIC,7,60,69,8
-END
-
-IDD_OPT_SYSTEMS DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- COMBOBOX IDC_LANG,75,4,92,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Prefered Language for stream selection",IDC_STATIC,3,3,61,17
- LTEXT "Decoder Threading",IDC_STATIC,4,28,62,8
- COMBOBOX IDC_DEC_THREAD,75,25,92,57,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Always draw late BIFS frames",IDC_BIFSDROP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,43,109,10
- CONTROL "Force Single Timeline",IDC_FORCE_DURATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,58,83,10
-END
-
-IDD_OPT_STREAM DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "Default Port",IDC_STATIC,6,6,40,8
- COMBOBOX IDC_PORT,52,3,113,61,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "RTP over RTSP",IDC_RTSP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,19,68,10
- CONTROL "use RTP reordering",IDC_REORDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,81,19,76,10
- LTEXT "milliseconds before control timeout",IDC_STATIC,38,34,108,8
- EDITTEXT IDC_TIMEOUT,3,32,30,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "milliseconds of Media Buffering ",IDC_STATIC,38,48,100,8
- EDITTEXT IDC_BUFFER,3,47,30,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
- EDITTEXT IDC_REBUFFER_LEN,83,60,30,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "Rebuffer if less than",IDC_REBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,63,79,10
- LTEXT "milliseconds",IDC_STATIC,117,63,41,8
-END
-
-IDD_PROPERTIES DIALOGEX 0, 0, 338, 150
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Presentation Properties"
-FONT 8, "MS Sans Serif", 0, 0, 0x1
-BEGIN
- CONTROL "Tree1",IDC_ODTREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_SINGLEEXPAND | WS_BORDER | WS_TABSTOP,2,2,120,114
- EDITTEXT IDC_ODINFO,123,17,213,130,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_NOHIDESEL | ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_HSCROLL,WS_EX_DLGMODALFRAME | WS_EX_STATICEDGE
- PUSHBUTTON "Get World Info",IDC_WORLD,2,118,119,13
- PUSHBUTTON "View Scene Graph",IDC_VIEWSG,2,134,119,13
- CONTROL "Tab1",IDC_VIEWSEL,"SysTabControl32",TCS_BUTTONS,124,2,208,14
-END
-
-IDD_OPT_DECODER DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "Prefered Audio Module",-1,46,5,69,8
- COMBOBOX IDC_AUDEC_LIST,26,17,111,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Prefered Video Module",-1,48,40,69,8
- COMBOBOX IDC_VIDEC_LIST,25,52,113,55,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
-END
-
-IDD_OPT_RENDER2D DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- CONTROL "Disable YUV Hardware",IDC_YUV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,54,89,10
- LTEXT "Static",IDC_FORMAT_YUV,97,57,67,8
- CONTROL "Direct Rendering",IDC_DIRECTRENDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,32,72,10
- CONTROL "Scalable Zoom",IDC_ZOOM_SCALABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,10,77,10
-END
-
-IDD_OPT_RENDER3D DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- CONTROL "Use OpenGL Outlines",IDC_RASTER_OUTLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,2,84,10
- CONTROL "Emulate power-of-two textures for video",IDC_EMUL_POW2,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,45,140,10
- CONTROL "Polygon Anti-Aliasing",IDC_DISABLE_POLY_AA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,90,2,78,10
- CONTROL "Disable rectangular texture extensions",IDC_DISABLE_TX_RECT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,55,135,10
- CONTROL "Bitmap node uses direct pixel copy",IDC_BITMAP_USE_PIXEL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,65,125,10
- LTEXT "Draw Normals",IDC_STATIC,4,17,45,8
- COMBOBOX IDC_DRAW_NORMALS,4,25,48,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Backface Cull",IDC_STATIC,57,17,55,8
- COMBOBOX IDC_BACK_CULL,57,25,47,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Draw Mode",IDC_STATIC,113,17,55,8
- COMBOBOX IDC_DRAW_MODE,111,25,53,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
-END
-
-IDD_SLIDERS DIALOGEX 0, 0, 218, 18
-STYLE DS_SETFONT | WS_CHILD
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
- CONTROL "Slider1",ID_SLIDER,"msctls_trackbar32",TBS_TOP | TBS_NOTICKS,0,3,185,12
- CONTROL "Slider1",ID_AUDIO_VOL,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_BORDER | WS_TABSTOP,187,3,30,13
-END
-
-IDD_NAVBAR DIALOGEX 0, 0, 279, 15
-STYLE DS_SETFONT | WS_CHILD
-FONT 8, "MS Sans Serif", 0, 0, 0x1
-BEGIN
- COMBOBOX IDC_ADDRESS,29,1,130,196,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP,WS_EX_ACCEPTFILES
- LTEXT "Address",IDC_DUMTXT,1,4,26,8
-END
-
-IDD_PLAYLIST DIALOGEX 0, 0, 186, 54
-STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
-EXSTYLE WS_EX_TOOLWINDOW
-CAPTION "Osmo4 Playlist"
-FONT 8, "MS Sans Serif", 0, 0, 0x1
-BEGIN
- CONTROL "List4",IDC_FILELIST,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,1,0,182,51
-END
-
-IDD_OPT_MCACHE DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- PUSHBUTTON "...",IDC_BROWSE_MCACHE,41,2,126,12
- CONTROL "Overwrite existing files",IDC_MCACHE_OVERWRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,18,85,10
- CONTROL "Use filename",IDC_MCACHE_USENAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,31,57,10
- LTEXT "Record To",IDC_STATIC,4,4,35,8
- EDITTEXT IDC_BASEPRES,81,31,82,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
-END
-
-IDD_OPT_FILETYPES DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- COMBOBOX IDC_FILELIST,59,6,108,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Supported Files",IDC_STATIC,6,8,50,8
- LTEXT "Extension",IDC_FILES_EXT,7,25,154,8
- LTEXT "Mime Type",IDC_FILES_MIMES,7,37,156,8
- CONTROL "Associate with Osmo4",IDC_ASSOCIATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,60,84,10
- LTEXT "Plugin",IDC_FILES_PLUG,8,49,154,8
-END
-
-IDD_OPT_LOGS DIALOG 0, 20, 169, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "Level",IDC_STATIC,6,7,18,8
- COMBOBOX IDC_LOG_LEVEL,30,4,64,74,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "core",IDC_TOOL_CORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,23,30,10
- CONTROL "coding",IDC_TOOL_CODING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,33,37,10
- CONTROL "container",IDC_TOOL_CONTAINER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,43,45,10
- CONTROL "network",IDC_TOOL_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,53,41,10
- CONTROL "rtp",IDC_TOOL_RTP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,63,24,10
- CONTROL "author",IDC_TOOL_AUTHOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,24,36,10
- CONTROL "sync",IDC_TOOL_SYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,34,31,10
- CONTROL "codec",IDC_TOOL_CODEC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,44,36,10
- CONTROL "parser",IDC_TOOL_PARSER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,54,35,10
- CONTROL "media",IDC_TOOL_MEDIA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,64,35,10
- CONTROL "scene",IDC_TOOL_SCENE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,24,35,10
- CONTROL "script",IDC_TOOL_SCRIPT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,34,33,10
- CONTROL "compose",IDC_TOOL_COMPOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,44,45,10
- CONTROL "render",IDC_TOOL_RENDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,54,36,10
- CONTROL "mmio",IDC_TOOL_MMIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,64,32,10
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_OPT_VIDEO, DIALOG
- BEGIN
- RIGHTMARGIN, 168
- END
-
- IDD_OPT_FONT, DIALOG
- BEGIN
- LEFTMARGIN, 1
- RIGHTMARGIN, 168
- BOTTOMMARGIN, 74
- END
-
- IDD_OPT_SYSTEMS, DIALOG
- BEGIN
- RIGHTMARGIN, 167
- TOPMARGIN, 1
- BOTTOMMARGIN, 75
- END
-
- IDD_OPT_STREAM, DIALOG
- BEGIN
- LEFTMARGIN, 1
- RIGHTMARGIN, 167
- TOPMARGIN, 1
- END
-
- IDD_PROPERTIES, DIALOG
- BEGIN
- RIGHTMARGIN, 335
- TOPMARGIN, 1
- END
-
- IDD_OPT_DECODER, DIALOG
- BEGIN
- RIGHTMARGIN, 168
- END
-
- IDD_OPT_RENDER3D, DIALOG
- BEGIN
- RIGHTMARGIN, 168
- END
-
- IDD_NAVBAR, DIALOG
- BEGIN
- RIGHTMARGIN, 167
- END
-
- IDD_OPT_FILETYPES, DIALOG
- BEGIN
- RIGHTMARGIN, 168
- END
-
- IDD_OPT_LOGS, DIALOG
- BEGIN
- RIGHTMARGIN, 168
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Toolbar
-//
-
-IDR_PLAYLIST TOOLBAR 16, 15
-BEGIN
- BUTTON ID_PL_OPEN
- BUTTON ID_PL_SAVE
- BUTTON ID_PL_ADD_FILE
- BUTTON ID_PL_REM_FILE
- BUTTON ID_PL_UP
- BUTTON ID_PL_DOWN
- BUTTON ID_PL_SORT_FILE
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDR_PLAYLIST BITMAP "res\\playlist.bmp"
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
- "#define _AFX_NO_OLE_RESOURCES\r\n"
- "#define _AFX_NO_TRACKER_RESOURCES\r\n"
- "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
- "\r\n"
- "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
- "#ifdef _WIN32\r\n"
- "LANGUAGE 9, 1\r\n"
- "#pragma code_page(1252)\r\n"
- "#endif //_WIN32\r\n"
- "#include ""res\\Osmo4.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
- "#include ""afxres.rc"" // Standard components\r\n"
- "#endif\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDR_MAINFRAME ICON "..\\..\\doc\\osmo4.ico"
-IDI_PLAY ICON "res\\play.ico"
-IDI_STOP ICON "res\\stop.ico"
-IDI_PAUSE ICON "res\\pause.ico"
-IDI_MESSAGE ICON "res\\message.ico"
-IDI_ERR ICON "res\\error.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog Info
-//
-
-IDD_OPT_RENDER DLGINIT
-BEGIN
- IDC_BIFS_RATE, 0x403, 4, 0
-0x2e35, 0x0030,
- IDC_BIFS_RATE, 0x403, 4, 0
-0x2e37, 0x0035,
- IDC_BIFS_RATE, 0x403, 5, 0
-0x3031, 0x302e, "\000"
- IDC_BIFS_RATE, 0x403, 5, 0
-0x3231, 0x352e, "\000"
- IDC_BIFS_RATE, 0x403, 5, 0
-0x3531, 0x302e, "\000"
- IDC_BIFS_RATE, 0x403, 5, 0
-0x3432, 0x302e, "\000"
- IDC_BIFS_RATE, 0x403, 5, 0
-0x3532, 0x302e, "\000"
- IDC_BIFS_RATE, 0x403, 5, 0
-0x3033, 0x302e, "\000"
- 0
-END
-
-IDD_OPT_SYSTEMS DLGINIT
-BEGIN
- IDC_LANG, 0x403, 8, 0
-0x6e45, 0x6c67, 0x7369, 0x0068,
- IDC_LANG, 0x403, 7, 0
-0x7246, 0x6e65, 0x6863, "\000"
- IDC_LANG, 0x403, 7, 0
-0x6547, 0x6d72, 0x6e61, "\000"
- IDC_LANG, 0x403, 8, 0
-0x7449, 0x6c61, 0x6169, 0x006e,
- IDC_LANG, 0x403, 8, 0
-0x7053, 0x6e61, 0x7369, 0x0068,
- IDC_LANG, 0x403, 9, 0
-0x6843, 0x6e69, 0x6565, 0x6573, "\000"
- IDC_LANG, 0x403, 10, 0
-0x614a, 0x6170, 0x656e, 0x7365, 0x0065,
- IDC_DEC_THREAD, 0x403, 14, 0
-0x6953, 0x676e, 0x656c, 0x5420, 0x7268, 0x6165, 0x0064,
- IDC_DEC_THREAD, 0x403, 13, 0
-0x754d, 0x6c74, 0x2069, 0x6854, 0x6572, 0x6461, "\000"
- IDC_DEC_THREAD, 0x403, 5, 0
-0x7246, 0x6565, "\000"
- 0
-END
-
-IDD_OPT_LOGS DLGINIT
-BEGIN
- IDC_LOG_LEVEL, 0x403, 9, 0
-0x6944, 0x6173, 0x6c62, 0x6465, "\000"
- IDC_LOG_LEVEL, 0x403, 6, 0
-0x7245, 0x6f72, 0x0072,
- IDC_LOG_LEVEL, 0x403, 8, 0
-0x6157, 0x6e72, 0x6e69, 0x0067,
- IDC_LOG_LEVEL, 0x403, 5, 0
-0x6e49, 0x6f66, "\000"
- IDC_LOG_LEVEL, 0x403, 6, 0
-0x6544, 0x7562, 0x0067,
- 0
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDR_MAINACCEL ACCELERATORS
-BEGIN
- "^P", ID_FILE_PLAY, ASCII, NOINVERT
- "\t", ID_FILE_PROP, ASCII, NOINVERT
- VK_F5, ID_FILE_RELOAD, VIRTKEY, NOINVERT
- "^S", ID_FILE_STEP, ASCII, NOINVERT
- "^O", ID_OPEN_FILE, ASCII, NOINVERT
- "^U", ID_OPEN_URL, ASCII, NOINVERT
- VK_F3, ID_VIEW_PL, VIRTKEY, NOINVERT
-END
-
-#endif // French (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE 9, 1
-#pragma code_page(1252)
-#endif //_WIN32
-#include "res\Osmo4.rc2" // non-Microsoft Visual C++ edited resources
-#include "afxres.rc" // Standard components
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{C79C2D73-06E9-4622-92CE-F166B1B51792}</ProjectGuid>\r
- <RootNamespace>Osmo4</RootNamespace>\r
- <Keyword>MFCProj</Keyword>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>Dynamic</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>Dynamic</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>Dynamic</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>Dynamic</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>\r
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>\r
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</EmbedManifest>\r
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</EmbedManifest>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Midl>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TargetEnvironment>Win32</TargetEnvironment>\r
- <TypeLibraryName>.\obj/osmo4_w32_rel/Osmo4.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>MaxSpeed</Optimization>\r
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <StackReserveSize>8388608</StackReserveSize>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <Midl>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TypeLibraryName>.\obj/osmo4_w32_rel/Osmo4.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <InlineFunctionExpansion>Default</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <StackReserveSize>8388608</StackReserveSize>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Midl>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TargetEnvironment>Win32</TargetEnvironment>\r
- <TypeLibraryName>.\obj/osmo4_w32_deb/Osmo4.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <Midl>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TypeLibraryName>.\obj/osmo4_w32_deb/Osmo4.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\applications\osmo4_w32\AddressBar.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\osmo4_w32\FileProps.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\osmo4_w32\MainFrm.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\osmo4_w32\OpenUrl.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\osmo4_w32\Options.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\osmo4_w32\Osmo4.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\osmo4_w32\Playlist.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\osmo4_w32\Sliders.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\osmo4_w32\StdAfx.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ResourceCompile Include="..\..\applications\osmo4_w32\Osmo4.rc">\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\gpac\applications\osmo4_w32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\gpac\applications\osmo4_w32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\gpac\applications\osmo4_w32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\gpac\applications\osmo4_w32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\applications\osmo4_w32\AddressBar.h" />\r
- <ClInclude Include="..\..\applications\osmo4_w32\FileProps.h" />\r
- <ClInclude Include="..\..\applications\osmo4_w32\MainFrm.h" />\r
- <ClInclude Include="..\..\applications\osmo4_w32\OpenUrl.h" />\r
- <ClInclude Include="..\..\applications\osmo4_w32\Options.h" />\r
- <ClInclude Include="..\..\applications\osmo4_w32\Osmo4.h" />\r
- <ClInclude Include="..\..\applications\osmo4_w32\Playlist.h" />\r
- <ClInclude Include="..\..\applications\osmo4_w32\Resource.h" />\r
- <ClInclude Include="..\..\applications\osmo4_w32\Sliders.h" />\r
- <ClInclude Include="..\..\applications\osmo4_w32\StdAfx.h" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="..\..\applications\osmo4_w32\res\error.ico" />\r
- <None Include="..\..\applications\osmo4_w32\res\maintool.bmp" />\r
- <None Include="..\..\applications\osmo4_w32\res\message.ico" />\r
- <None Include="..\..\applications\osmo4_w32\res\osmo4.ico" />\r
- <None Include="..\..\applications\osmo4_w32\res\pause.ico" />\r
- <None Include="..\..\applications\osmo4_w32\res\play.ico" />\r
- <None Include="..\..\applications\osmo4_w32\res\playlist.bmp" />\r
- <None Include="..\..\applications\osmo4_w32\res\stop.ico" />\r
- <None Include="..\..\doc\osmo4.ico" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="libgpac_dll.vcxproj">\r
- <Project>{d3540754-e0cf-4604-ac11-82de9bd4d814}</Project>\r
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-// Playlist.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "osmo4.h"
-#include "MainFrm.h"
-#include "OpenURL.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// Playlist dialog
-
-PLEntry::PLEntry(CString url, char *path)
-{
- if (!path || strrchr(url, '\\') || strstr(url, "://")) {
- m_url = gf_strdup(url);
- } else {
- char szPath[MAX_PATH];
- strcpy(szPath, path);
- strcat(szPath, url);
- m_url = gf_strdup(szPath);
- }
- char *str = (char *) strrchr(url, '\\');
- if (!str) str = (char *) strrchr(url, '/');
- if (str && strlen(str+1)) {
- m_disp_name = gf_strdup(str+1);
- str = strrchr(m_disp_name, '.');
- if (str) str[0] = 0;
- } else {
- str = (char *) strstr(url, "://");
- if (str) {
- str += 3;
- m_disp_name = gf_strdup(str);
- } else {
- m_disp_name = gf_strdup(url);
- str = strrchr(m_disp_name, '.');
- if (str) str[0] = 0;
- }
- }
- m_duration = 0;
- m_bIsDead = GF_FALSE;
- m_bIsPlaying = GF_FALSE;
- m_bIsSelected = GF_FALSE;
-}
-
-PLEntry::~PLEntry()
-{
- if (m_url) gf_free(m_url);
- if (m_disp_name) gf_free(m_disp_name);
-
-}
-
-
-static char szCacheDir[MAX_PATH];
-
-Playlist::Playlist()
- : CDialog(Playlist::IDD, NULL)
-{
- //{{AFX_DATA_INIT(Playlist)
- //}}AFX_DATA_INIT
-
- m_entries = gf_list_new();
- m_cur_entry = -1;
- m_all_dead_entries=-1;
- GetCurrentDirectory(MAX_PATH, szCacheDir);
-}
-
-Playlist::~Playlist()
-{
- Clear();
- gf_list_del(m_entries);
-}
-
-void Playlist::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(Playlist)
- DDX_Control(pDX, IDC_FILELIST, m_FileList);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(Playlist, CDialog)
- //{{AFX_MSG_MAP(Playlist)
- ON_WM_SIZE()
- ON_COMMAND(ID_PL_ADD_FILE, OnPlAddFile)
- ON_COMMAND(ID_PL_REM_FILE, OnPlRemFile)
- ON_COMMAND(ID_PL_UP, OnSelUp)
- ON_COMMAND(ID_PL_DOWN, OnSelDown)
- ON_COMMAND(ID_PL_SAVE, OnPlSave)
- ON_WM_DROPFILES()
- ON_WM_CLOSE()
- ON_WM_DESTROY()
- ON_COMMAND(ID_PL_REM_DEAD, OnPlRemDead)
- ON_COMMAND(ID_PL_REM_ALL, OnPlRemAll)
- ON_COMMAND(ID_PL_ADD_DIR, OnPlAddDir)
- ON_COMMAND(ID_PL_ADD_DIR_REC, OnPlAddDirRec)
- ON_COMMAND(ID_PL_ADD_URL, OnPlAddUrl)
- ON_COMMAND(ID_PL_OPEN, OnPlOpen)
- ON_COMMAND(ID_PL_PLAY, OnPlPlay)
- ON_COMMAND(ID_PL_SEL_REV, OnReverseSelection)
- ON_COMMAND(ID_PL_SORT_REV, OnReverseList)
- ON_COMMAND(ID_PL_RANDOM, OnRandomize)
- ON_COMMAND(ID_PL_SORT_TITLE, OnSortTitle)
- ON_COMMAND(ID_PL_SORT_FILE, OnSortFile)
- ON_COMMAND(ID_PL_SORT_DUR, OnSortDuration)
- ON_NOTIFY(NM_RCLICK, IDC_FILELIST, OnRclickFilelist)
- ON_NOTIFY(NM_DBLCLK, IDC_FILELIST, OnDblclkFilelist)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// Playlist message handlers
-
-BOOL Playlist::OnInitDialog()
-{
- UINT buttonArray[50];
- TBBUTTONINFO bi;
- u32 *ba;
- CDialog::OnInitDialog();
-
-
- SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE);
- SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);
-
- if (!m_toolBar.CreateEx(this, WS_CHILD | CBRS_TOP | CBRS_FLYBY) ||
- !m_toolBar.LoadBitmap(IDR_PLAYLIST))
- {
- TRACE0("Failed to create toolbar\n");
- return 0;
- }
-
- ba = &buttonArray[0];
- *ba = ID_PL_OPEN;
- ba++;
- *ba = ID_PL_SAVE;
- ba++;
- *ba = ID_SEPARATOR;
- ba++;
- *ba = ID_PL_ADD_FILE;
- ba++;
- *ba = ID_PL_REM_FILE;
- ba++;
- *ba = ID_SEPARATOR;
- ba++;
- *ba = ID_PL_UP;
- ba++;
- *ba = ID_PL_DOWN;
- ba++;
- *ba = ID_SEPARATOR;
- ba++;
- *ba = ID_PL_SORT_FILE;
- ba++;
- m_toolBar.SetButtons(buttonArray, 9);
- m_toolBar.SetButtonInfo(0, ID_PL_OPEN, TBBS_BUTTON, 0);
- m_toolBar.SetButtonInfo(1, ID_PL_SAVE, TBBS_BUTTON, 1);
- m_toolBar.SetButtonInfo(2, ID_SEPARATOR, TBBS_SEPARATOR, 0);
- m_toolBar.SetButtonInfo(3, ID_PL_ADD_FILE, TBBS_DROPDOWN | TBBS_BUTTON, 2);
- m_toolBar.SetButtonInfo(4, ID_PL_REM_FILE, TBBS_DROPDOWN | TBBS_BUTTON, 3);
- m_toolBar.SetButtonInfo(5, ID_SEPARATOR, TBBS_SEPARATOR, 0);
- m_toolBar.SetButtonInfo(6, ID_PL_UP, TBBS_BUTTON, 4);
- m_toolBar.SetButtonInfo(7, ID_PL_DOWN, TBBS_BUTTON, 5);
-// m_toolBar.SetButtonInfo(8, ID_SEPARATOR, TBBS_SEPARATOR, 0);
- m_toolBar.SetButtonInfo(8, ID_PL_SORT_FILE, TBBS_DROPDOWN | TBBS_BUTTON, 6);
-
- CToolBarCtrl &ctrl = m_toolBar.GetToolBarCtrl();
- ctrl.SetStyle(TBSTYLE_FLAT | TBSTYLE_DROPDOWN);
- ctrl.SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
-
- memset(&bi, 0, sizeof(bi));
- bi.cbSize = sizeof(bi);
- ctrl.GetButtonInfo(3, &bi);
- bi.fsStyle |= TBSTYLE_DROPDOWN;
- ctrl.SetButtonInfo(ID_PL_ADD_FILE, &bi);
-
- memset(&bi, 0, sizeof(bi));
- bi.cbSize = sizeof(bi);
- ctrl.GetButtonInfo(4, &bi);
- bi.fsStyle |= TBBS_DROPDOWN | TBSTYLE_DROPDOWN;
- ctrl.SetButtonInfo(ID_PL_REM_FILE, &bi);
-
- memset(&bi, 0, sizeof(bi));
- bi.cbSize = sizeof(bi);
- ctrl.GetButtonInfo(9, &bi);
- bi.fsStyle |= TBSTYLE_DROPDOWN;
- ctrl.SetButtonInfo(ID_PL_SORT_FILE, &bi);
-
- m_FileList.InsertColumn(0, "", LVCFMT_LEFT, 30, 0);
- m_FileList.InsertColumn(1, "Title", LVCFMT_LEFT, 200, 1);
- m_FileList.InsertColumn(2, "Duration", LVCFMT_LEFT, 200, 2);
-
-
- m_toolBar.UpdateWindow();
- m_toolBar.ShowWindow(SW_SHOW);
-
- SetWindowPos(NULL, 0, 0, 400, 600, SWP_NOZORDER | SWP_NOMOVE);
-
- PostMessage(WM_NULL);
- DragAcceptFiles();
-
- return TRUE;
-}
-
-void Playlist::OnSize(UINT nType, int cx, int cy)
-{
- u32 tool_h;
- CDialog::OnSize(nType, cx, cy);
- RECT rc;
- if (!m_toolBar.m_hWnd) return;
- if (!m_FileList.m_hWnd) return;
-
- m_toolBar.GetClientRect(&rc);
- tool_h = rc.bottom - rc.top;
- m_toolBar.SetWindowPos(this, 0, 0, cx, tool_h, SWP_NOZORDER);
- m_FileList.SetWindowPos(this, 0, tool_h, cx, cy-tool_h, SWP_NOZORDER);
-
- m_FileList.SetExtendedStyle(m_FileList.GetExtendedStyle() | LVS_EX_FULLROWSELECT);
-
- m_FileList.SetColumnWidth(0, 30);
- m_FileList.SetColumnWidth(2, 60);
- m_FileList.SetColumnWidth(1, cx-95);
-
-}
-
-void Playlist::OnDropFiles(HDROP hDropInfo)
-{
- u32 i, count;
- Osmo4 *app = GetApp();
- char fileName[MAX_PATH];
- count = ::DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0);
- if (!count) return;
- for (i=0; i<count; i++) {
- ::DragQueryFile (hDropInfo, i, fileName, MAX_PATH);
- QueueURL(fileName);
- }
- RefreshList();
-}
-
-
-BOOL Playlist::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
-{
-
- if (((LPNMHDR)lParam)->code == TBN_DROPDOWN) {
- RECT rc;
- POINT pt;
- CMenu *pPopup = new CMenu();
- pPopup->CreatePopupMenu();
-
- m_toolBar.GetWindowRect(&rc);
- pt.y = rc.bottom;
- pt.x = rc.left;
-
- if ( ((LPNMTOOLBAR)lParam)->iItem == ID_PL_ADD_FILE) {
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_ADD_DIR, "Directory...");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_ADD_DIR_REC, "Directory and subfolders...");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_ADD_URL, "URL...");
- m_toolBar.GetToolBarCtrl().GetItemRect(3, &rc);
- pt.x += rc.left;
- } else if ( ((LPNMTOOLBAR)lParam)->iItem == ID_PL_REM_FILE) {
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_REM_ALL, "Clear");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_REM_DEAD, "Remove dead entries");
-
- m_toolBar.GetToolBarCtrl().GetItemRect(4, &rc);
- pt.x += rc.left;
- } else if ( ((LPNMTOOLBAR)lParam)->iItem == ID_PL_SORT_FILE) {
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_TITLE, "Sort Files by title");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_FILE, "Sort Files by filename");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_DUR, "Sort Files by duration");
- pPopup->AppendMenu(MF_SEPARATOR,0);
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_REV, "Reverse Playlist");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_RANDOM, "Shuffle Playlist");
-
- m_toolBar.GetToolBarCtrl().GetItemRect(8, &rc);
- pt.x += rc.left;
- }
- pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, this);
- delete pPopup;
-
- return FALSE;
- }
- return CDialog::OnNotify(wParam, lParam, pResult);
-}
-
-void Playlist::Clear()
-{
- m_FileList.DeleteAllItems();
- while (gf_list_count(m_entries)) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, 0);
- gf_list_rem(m_entries, 0);
- delete ple;
- }
- m_cur_entry = -1;
-}
-
-void Playlist::ClearButPlaying()
-{
- PLEntry *p=NULL;
- if (m_cur_entry>=0) p = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (p) gf_list_rem(m_entries, m_cur_entry);
-
- Clear();
- if (p) {
- gf_list_add(m_entries, p);
- m_cur_entry = 0;
- }
- RefreshList();
-}
-
-void Playlist::UpdateEntry(u32 i)
-{
- char szText[20];
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- if (i+1<10) sprintf(szText, "00%d", i+1);
- else if (i+1<100) sprintf(szText, "0%d", i+1);
- else sprintf(szText, "%d", i+1);
- m_FileList.SetItem(i, 0, LVIF_TEXT, szText, 0, 0, 0, 0);
-
- CString str;
- if (ple->m_bIsDead) {
- str = "!! DEAD !! ";
- str += ple->m_disp_name;
- }
- else if (ple->m_bIsPlaying) {
- str = ">> ";
- str += ple->m_disp_name;
- str += " >>";
- }
- else str = ple->m_disp_name;
- m_FileList.SetItem(i, 1, LVIF_TEXT, str, 0, 0, 0, 0);
-
- if (ple->m_duration) {
- u32 h = (u32) (ple->m_duration / 3600);
- u32 m = (u32) (ple->m_duration / 60) - h*60;
- u32 s = (u32) (ple->m_duration) - h*3600 - m*60;
- sprintf(szText, "%02d:%02d:%02d", h, m, s);
- m_FileList.SetItem(i, 2, LVIF_TEXT, szText, 0, 0, 0, 0);
- } else {
- m_FileList.SetItem(i, 2, LVIF_TEXT, "Unknown", 0, 0, 0, 0);
- }
-
-}
-
-void Playlist::RefreshList()
-{
- u32 i, top_idx;
- char szPath[GF_MAX_PATH];
-
- top_idx = m_FileList.GetTopIndex();
- m_FileList.DeleteAllItems();
-
- for (i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- m_FileList.InsertItem(i, "");
- m_FileList.SetItemData(i, (u32) ple);
-
- UpdateEntry(i);
- /*in case of sorting*/
- if (ple->m_bIsPlaying) m_cur_entry = i;
-
- if (ple->m_bIsSelected) {
- m_FileList.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
- ple->m_bIsSelected = GF_FALSE;
- }
- }
-
- if (m_cur_entry >= (s32)gf_list_count(m_entries)) m_cur_entry = gf_list_count(m_entries);
- else {
- s32 last_idx = top_idx + m_FileList.GetCountPerPage();
- m_FileList.EnsureVisible(top_idx, 0);
- if (gf_list_count(m_entries)<(u32) last_idx) last_idx = gf_list_count(m_entries);
- m_FileList.EnsureVisible(last_idx, 1);
- }
-
-
- strcpy((char *) szPath, GetApp()->szUserPath);
- strcat(szPath, "gpac_pl.m3u");
- Save(szPath, GF_TRUE);
-}
-
-void Playlist::OnPlAddFile()
-{
- Osmo4 *app = GetApp();
- CString sFiles = app->GetFileFilter();
-
- CFileDialog fd(TRUE,NULL,NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST , sFiles);
- fd.m_ofn.nMaxFile = 25000;
- fd.m_ofn.lpstrFile = (char *) gf_malloc(sizeof(char) * fd.m_ofn.nMaxFile);
- fd.m_ofn.lpstrFile[0] = 0;
-
- if (fd.DoModal() == IDOK) {
- s32 cur = m_FileList.GetItemCount();
- POSITION pos = fd.GetStartPosition();
- while (pos) {
- QueueURL(fd.GetNextPathName(pos));
- }
- }
- gf_free(fd.m_ofn.lpstrFile);
- m_all_dead_entries=-1;
- RefreshList();
-}
-
-void Playlist::OnClose()
-{
- ShowWindow(SW_HIDE);
-}
-
-void Playlist::OnPlRemFile()
-{
- if (!m_FileList.GetSelectedCount()) return;
- POSITION pos = m_FileList.GetFirstSelectedItemPosition();
- while (pos != NULL) {
- int nItem = m_FileList.GetNextSelectedItem(pos);
- PLEntry *ple = (PLEntry *) m_FileList.GetItemData(nItem);
- gf_list_del_item(m_entries, ple);
- delete ple;
- }
- m_all_dead_entries=-1;
- RefreshList();
-}
-
-void Playlist::OnSelUp()
-{
- s32 i;
- if (!m_FileList.GetSelectedCount()) return;
- POSITION pos = m_FileList.GetFirstSelectedItemPosition();
- int nItem = m_FileList.GetNextSelectedItem(pos);
- if (nItem==0) return;
-
- pos = m_FileList.GetFirstSelectedItemPosition();
- while (pos != NULL) {
- nItem = m_FileList.GetNextSelectedItem(pos);
- PLEntry *ple = (PLEntry *) m_FileList.GetItemData(nItem);
- i = gf_list_del_item(m_entries, ple);
- assert(i>=1);
- gf_list_insert(m_entries, ple, i-1);
- ple->m_bIsSelected = GF_TRUE;
- }
- RefreshList();
-}
-
-void Playlist::OnSelDown()
-{
- s32 i, nItem;
- if (!m_FileList.GetSelectedCount()) return;
- POSITION pos = m_FileList.GetFirstSelectedItemPosition();
- while (pos != NULL) nItem = m_FileList.GetNextSelectedItem(pos);
-
- if ((u32) nItem + 1 == gf_list_count(m_entries)) return;
-
- pos = m_FileList.GetFirstSelectedItemPosition();
- while (pos != NULL) {
- nItem = m_FileList.GetNextSelectedItem(pos);
- PLEntry *ple = (PLEntry *) m_FileList.GetItemData(nItem);
- i = gf_list_del_item(m_entries, ple);
- gf_list_insert(m_entries, ple, i+1);
- ple->m_bIsSelected = GF_TRUE;
- }
- RefreshList();
-}
-
-void Playlist::OnPlRemAll()
-{
- Clear();
- RefreshList();
- m_cur_entry = -1;
-}
-
-void Playlist::OnPlRemDead()
-{
- for (u32 i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- if (!ple->m_bIsDead) continue;
- gf_list_rem(m_entries, i);
- i--;
- delete ple;
- }
- m_all_dead_entries=-1;
- RefreshList();
-}
-
-
-static int CALLBACK LocCbck(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
-{
- char dir[MAX_PATH];
- if (uMsg == BFFM_INITIALIZED) {
- strcpy(dir, szCacheDir);
- SendMessage(hwnd, BFFM_SETSELECTION, TRUE,(LPARAM) dir);
- }
- return 0;
-}
-static Bool pl_enum_dir_item(void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info)
-{
- Osmo4 *gpac = GetApp();
- Playlist *_this = (Playlist *)cbck;
-
- if (gf_term_is_supported_url(gpac->m_term, item_name, GF_FALSE, GF_TRUE)) {
- _this->QueueURL(item_path);
- }
- return GF_FALSE;
-}
-
-static Bool pl_enum_dir_dirs(void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info)
-{
- gf_enum_directory(item_path, GF_FALSE, pl_enum_dir_item, cbck, NULL);
- gf_enum_directory(item_path, GF_TRUE, pl_enum_dir_dirs, cbck, NULL);
- return GF_FALSE;
-}
-
-
-void Playlist::AddDir(Bool do_recurse)
-{
- BROWSEINFO brw;
- LPMALLOC pMalloc;
- LPITEMIDLIST ret;
- char dir[MAX_PATH];
-
- Bool res = GF_FALSE;
- if (NOERROR == ::SHGetMalloc(&pMalloc) ) {
- memset(&brw, 0, sizeof(BROWSEINFO));
- brw.hwndOwner = this->GetSafeHwnd();
- brw.pszDisplayName = dir;
- brw.lpszTitle = "Select Directory...";
- brw.ulFlags = 0L;
- brw.lpfn = LocCbck;
-
- ret = SHBrowseForFolder(&brw);
- if (ret != NULL) {
- if (::SHGetPathFromIDList(ret, dir)) res = GF_TRUE;
- pMalloc->Free(ret);
- }
- pMalloc->Release();
- }
- if (!res) return;
- strcpy(szCacheDir, dir);
-
- gf_enum_directory(dir, GF_FALSE, pl_enum_dir_item, this, NULL);
- if (do_recurse) gf_enum_directory(dir, GF_FALSE, pl_enum_dir_dirs, this, NULL);
- m_all_dead_entries=-1;
- RefreshList();
-}
-void Playlist::OnPlAddDir()
-{
- AddDir(GF_FALSE);
-}
-void Playlist::OnPlAddDirRec()
-{
- AddDir(GF_TRUE);
-}
-
-void Playlist::OnPlAddUrl()
-{
- COpenUrl url;
- if (url.DoModal() != IDOK) return;
- PLEntry *ple = new PLEntry(url.m_url);
- gf_list_add(m_entries, ple);
- m_all_dead_entries=-1;
- RefreshList();
-}
-
-void Playlist::OnPlSave()
-{
- Bool save_m3u;
- char szPath[GF_MAX_PATH];
- if (!gf_list_count(m_entries)) return;
- CFileDialog fd(FALSE,NULL,NULL, OFN_OVERWRITEPROMPT, "M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|");
- if (fd.DoModal() != IDOK) return;
-
- strcpy(szPath, fd.GetPathName());
- strlwr(szPath);
- save_m3u = (fd.m_ofn.nFilterIndex==1) ? GF_TRUE : GF_FALSE;
- if (save_m3u) {
- if (!strstr(szPath, ".m3u")) {
- strcpy(szPath, fd.GetPathName());
- strcat(szPath, ".m3u");
- } else {
- strcpy(szPath, fd.GetPathName());
- }
- } else {
- if (!strstr(szPath, ".pls")) {
- strcpy(szPath, fd.GetPathName());
- strcat(szPath, ".pls");
- } else {
- strcpy(szPath, fd.GetPathName());
- }
- }
- Save(szPath, save_m3u);
-}
-
-void Playlist::Save(char *szPath, Bool save_m3u)
-{
- FILE *out = gf_fopen(szPath, "wt");
- if (!save_m3u)
- fprintf(out, "[playlist]\nNumberOfEntries=%d\n", gf_list_count(m_entries));
-
- for (u32 i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- if (save_m3u) {
- fprintf(out, "%s\n", ple->m_url);
- } else {
- fprintf(out, "File%d=%s\n", i+1, ple->m_url);
- fprintf(out, "Title%d=%s\n", i+1, ple->m_disp_name);
- fprintf(out, "Length%d=%d\n", i+1, ple->m_duration ? ple->m_duration : -1);
-
- }
- }
- if (!save_m3u) fprintf(out, "Version=2\n");
-
- fprintf(out, "\n");
- gf_fclose(out);
-}
-
-void Playlist::OnPlOpen()
-{
- CFileDialog fd(TRUE,NULL,NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, "M3U & PLS Playlists|*.m3u;*.pls|M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|");
- if (fd.DoModal() != IDOK) return;
-
- Clear();
- OpenPlayList(fd.GetPathName());
- m_cur_entry = 0;
- Play();
-}
-
-void Playlist::OpenPlayList(CString fileName)
-{
- FILE *pl;
- PLEntry *ple;
- Bool load_m3u, go;
- char szLine[GF_MAX_PATH], *sep;
- char szPath[GF_MAX_PATH];
-
- strcpy(szPath, fileName);
- sep = strrchr(szPath, '\\');
- if (sep) sep[1] = 0;
- else szPath[0] = 0;
-
- pl = gf_fopen(fileName, "rt");
- if (!pl) return;
- ple = NULL;
- load_m3u = GF_TRUE;
- while (!feof(pl)) {
- fgets(szLine, GF_MAX_PATH, pl);
- go = GF_TRUE;
- while (go) {
- switch (szLine[strlen(szLine)-1]) {
- case '\n':
- case '\r':
- case ' ':
- szLine[strlen(szLine)-1] = 0;
- break;
- default:
- go = GF_FALSE;
- break;
- }
- }
- if (!strlen(szLine)) continue;
- if (!stricmp(szLine, "[playlist]")) {
- load_m3u = GF_FALSE;
- } else if (load_m3u) {
- ple = new PLEntry(szLine, szPath);
- gf_list_add(m_entries, ple);
- } else if (!strnicmp(szLine, "file", 4)) {
- char *st = strchr(szLine, '=');
- if (!st) ple = NULL;
- else {
- ple = new PLEntry(st + 1, szPath);
- gf_list_add(m_entries, ple);
- }
- } else if (ple && !strnicmp(szLine, "Length", 6)) {
- char *st = strchr(szLine, '=');
- s32 d = atoi(st + 1);
- if (d>0) ple->m_duration = d;
- } else if (ple && !strnicmp(szLine, "Title", 5)) {
- char *st = strchr(szLine, '=');
- gf_free(ple->m_disp_name);
- ple->m_disp_name = gf_strdup(st + 6);
- }
- }
- gf_fclose(pl);
- m_all_dead_entries=-1;
- m_cur_entry = -1;
- RefreshList();
-}
-
-
-void Playlist::OnRclickFilelist(NMHDR* pNMHDR, LRESULT* pResult)
-{
- if (!m_FileList.GetItemCount()) return;
-
- CMenu *pPopup = new CMenu();
- pPopup->CreatePopupMenu();
-
- if (m_FileList.GetSelectedCount()==1) {
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_PLAY, "Play");
- pPopup->AppendMenu(MF_SEPARATOR, 0, "");
- }
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SEL_REV, "Inverse Selection");
- if (m_FileList.GetSelectedCount()) pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_REM_FILE, "Remove File(s)");
- if (m_FileList.GetItemCount()>1) {
- pPopup->AppendMenu(MF_SEPARATOR, 0, "");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_TITLE, "Sort By Title");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_FILE, "Sort By File Name");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_DUR, "Sort By Duration");
- pPopup->AppendMenu(MF_SEPARATOR, 0, "");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_REV, "Reverse List");
- pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_RANDOM, "Randomize");
- }
-
- POINT pt;
- GetCursorPos(&pt);
- pPopup->TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this);
- delete pPopup;
-
- *pResult = 0;
-}
-
-void Playlist::OnReverseSelection()
-{
- u32 i;
- POSITION pos = m_FileList.GetFirstSelectedItemPosition();
- while (pos != NULL) {
- int nItem = m_FileList.GetNextSelectedItem(pos);
- PLEntry *ple = (PLEntry *) m_FileList.GetItemData(nItem);
- ple->m_bIsSelected = GF_TRUE;
- }
-
- for (i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- ple->m_bIsSelected = (Bool) !ple->m_bIsSelected;
- }
- RefreshList();
-}
-
-void Playlist::OnReverseList()
-{
- u32 count = gf_list_count(m_entries);
- u32 hcount = count / 2;
- count--;
- for (u32 i=0; i<hcount; i++) {
- PLEntry *ple1 = (PLEntry *) gf_list_get(m_entries, i);
- PLEntry *ple2 = (PLEntry *) gf_list_get(m_entries, count-i);
- gf_list_rem(m_entries, i);
- gf_list_insert(m_entries, ple2, i);
- gf_list_rem(m_entries, count-i);
- gf_list_insert(m_entries, ple1, count-i);
- }
- RefreshList();
-}
-
-void Playlist::OnRandomize()
-{
- GF_List *new_entries = gf_list_new();
-
- gf_rand_init(GF_FALSE);
-
- while (gf_list_count(m_entries)>1) {
- u32 pos = gf_rand() % (gf_list_count(m_entries)-1);
- PLEntry *ple = (PLEntry *)gf_list_get(m_entries, pos);
- gf_list_rem(m_entries, pos);
- gf_list_add(new_entries, ple);
- }
- PLEntry *ple = (PLEntry *)gf_list_get(m_entries, 0);
- gf_list_rem(m_entries, 0);
- gf_list_add(new_entries, ple);
-
- gf_list_del(m_entries);
- m_entries = new_entries;
- m_cur_entry = -1;
- RefreshList();
-}
-
-void Playlist::Sort(u32 type)
-{
- u32 i, j, smallest;
- if (gf_list_count(m_entries)<=1) return;
-
- for (i=0; i<gf_list_count(m_entries)-1; i++) {
- smallest = i;
- for (j=i+1; j<gf_list_count(m_entries); j++) {
- PLEntry *ple2 = (PLEntry *) gf_list_get(m_entries, smallest);
- PLEntry *ple1 = (PLEntry *) gf_list_get(m_entries, j);
- s32 test = 0;
- switch (type) {
- case 0:
- test = stricmp(ple1->m_url, ple2->m_url);
- break;
- case 1:
- test = stricmp(ple1->m_disp_name, ple2->m_disp_name);
- break;
- case 2:
- test = ple1->m_duration - ple2->m_duration;
- break;
- }
- if (test<0) smallest = j;
- }
- PLEntry *ple = (PLEntry *)gf_list_get(m_entries, smallest);
- gf_list_rem(m_entries, smallest);
- gf_list_insert(m_entries, ple, i);
- }
- m_cur_entry = -1;
- RefreshList();
-}
-
-void Playlist::OnSortFile() {
- Sort(0);
-}
-void Playlist::OnSortTitle() {
- Sort(1);
-}
-void Playlist::OnSortDuration() {
- Sort(2);
-}
-
-
-Bool Playlist::HasValidEntries()
-{
- u32 nb_dead = 0;
- if (m_all_dead_entries==-1) {
- for (u32 i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- ple->m_bIsPlaying = GF_FALSE;
- if (ple->m_bIsDead) nb_dead ++;
- }
- m_all_dead_entries = (nb_dead==gf_list_count(m_entries)) ? 1 : 0;
- }
- if (m_all_dead_entries==1) return GF_FALSE;
- return GF_TRUE;
-}
-
-void Playlist::RefreshCurrent()
-{
- if (m_cur_entry==-1) return;
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple && ple->m_bIsPlaying) {
- ple->m_bIsPlaying = GF_FALSE;
- UpdateEntry(m_cur_entry);
- }
-}
-
-void Playlist::Play()
-{
- PLEntry *ple;
-
- if (!HasValidEntries()) return;
-
- RefreshCurrent();
- if (m_cur_entry==-1) m_cur_entry = 0;
-
- if (m_cur_entry >= (s32)gf_list_count(m_entries)) {
- if (!GetApp()->m_Loop) return;
- m_cur_entry = 0;
- }
-
- ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- assert(ple);
- if (ple->m_bIsDead) {
- m_cur_entry++;
- Play();
- } else {
- char szPLE[20];
- ple->m_bIsPlaying = GF_TRUE;
- UpdateEntry(m_cur_entry);
- sprintf(szPLE, "%d", m_cur_entry);
- gf_cfg_set_key(GetApp()->m_user.config, "General", "PLEntry", szPLE);
- GetApp()->m_pMainWnd->PostMessage(WM_OPENURL);
- }
-}
-
-void Playlist::OnDblclkFilelist(NMHDR* pNMHDR, LRESULT* pResult)
-{
- POSITION pos = m_FileList.GetFirstSelectedItemPosition();
- RefreshCurrent();
- m_cur_entry = m_FileList.GetNextSelectedItem(pos);
- Play();
- *pResult = 0;
-}
-
-void Playlist::OnPlPlay()
-{
- POSITION pos = m_FileList.GetFirstSelectedItemPosition();
-
- RefreshCurrent();
- m_cur_entry = m_FileList.GetNextSelectedItem(pos);
- Play();
-}
-
-void Playlist::Truncate()
-{
- while (m_cur_entry+1 < (s32)gf_list_count(m_entries)) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry+1);
- gf_list_rem(m_entries, m_cur_entry+1);
- delete ple;
- }
- RefreshList();
-}
-
-
-void Playlist::QueueURL(CString filename)
-{
- char *ext = (char *) strrchr(filename, '.');
- if (ext && (!stricmp(ext, ".m3u") || !stricmp(ext, ".pls")) ) {
- OpenPlayList(filename);
- } else {
- PLEntry *ple = new PLEntry(filename);
- gf_list_add(m_entries, ple);
- }
- m_all_dead_entries=-1;
-}
-
-void Playlist::PlayNext()
-{
- s32 count = (s32)gf_list_count(m_entries);
-
- RefreshCurrent();
- if (1+m_cur_entry < count) {
- m_cur_entry++;
- Play();
- } else if ((1+m_cur_entry == count) && GetApp()->m_Loop) {
- m_cur_entry=0;
- Play();
- }
-}
-
-void Playlist::PlayPrev()
-{
- RefreshCurrent();
- if (m_cur_entry>0) {
- m_cur_entry--;
- Play();
- }
-}
-
-void Playlist::SetDead()
-{
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple) {
- ple->m_bIsDead = GF_TRUE;
- UpdateEntry(m_cur_entry);
- m_all_dead_entries=-1;
- if (ple->m_bIsPlaying) PlayNext();
- }
-}
-void Playlist::SetDuration(u32 duration)
-{
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple) {
- ple->m_duration = duration;
- UpdateEntry(m_cur_entry);
- }
-}
-
-CString Playlist::GetDisplayName()
-{
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple) return CString(ple->m_disp_name);
- return CString("");
-}
-
-CString Playlist::GetURL()
-{
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple) return CString(ple->m_url);
- return CString("");
-}
-
+++ /dev/null
-#if !defined(AFX_PLAYLIST_H__EA74376A_83DF_435E_8484_A15BF5B77A32__INCLUDED_)
-#define AFX_PLAYLIST_H__EA74376A_83DF_435E_8484_A15BF5B77A32__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// Playlist.h : header file
-//
-
-
-class PLEntry
-{
-public:
- PLEntry(CString url, char *path = NULL);
- ~PLEntry();
-
- char *m_url;
- char *m_disp_name;
- u32 m_duration;
-
- Bool m_bIsSelected;
- Bool m_bIsDead;
- Bool m_bIsPlaying;
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Playlist dialog
-
-class Playlist : public CDialog
-{
-// Construction
-public:
- Playlist();
- virtual ~Playlist();
-
- virtual BOOL Create() {
- /*use desktop window to enable playlist behind player*/
- return CDialog::Create(IDD_PLAYLIST, GetDesktopWindow());
- }
-
- CToolBar m_toolBar;
- GF_List *m_entries;
-
- void Clear();
- void ClearButPlaying();
- void RefreshList();
- void AddDir(Bool do_recurse);
- void Truncate();
- void SetDead();
- void SetDuration(u32 duration);
-
- void Play();
- void PlayNext();
- void PlayPrev();
- Bool HasValidEntries();
- CString GetDisplayName();
- CString GetURL();
-
- void OpenPlayList(CString fileName);
-
- void QueueURL(CString filename);
- s32 m_cur_entry;
-
-// Dialog Data
- //{{AFX_DATA(Playlist)
- enum { IDD = IDD_PLAYLIST};
- CListCtrl m_FileList;
- //}}AFX_DATA
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(Playlist)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX);
- virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
- s32 m_all_dead_entries;
- void UpdateEntry(u32 idx);
- void RefreshCurrent();
- void Sort(u32 type);
- void Save(char *szPath, Bool save_m3u);
-
- // Generated message map functions
- //{{AFX_MSG(Playlist)
- virtual BOOL OnInitDialog() ;
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnDropFiles(HDROP hDropInfo);
- afx_msg void OnPlAddFile();
- afx_msg void OnPlRemFile();
- afx_msg void OnSelUp();
- afx_msg void OnSelDown();
- afx_msg void OnPlSave();
- afx_msg void OnClose();
- afx_msg void OnPlRemDead();
- afx_msg void OnPlRemAll();
- afx_msg void OnPlAddDir();
- afx_msg void OnPlAddDirRec();
- afx_msg void OnPlAddUrl();
- afx_msg void OnPlOpen();
- afx_msg void OnReverseSelection();
- afx_msg void OnReverseList();
- afx_msg void OnRandomize();
- afx_msg void OnSortTitle();
- afx_msg void OnSortFile();
- afx_msg void OnSortDuration();
- afx_msg void OnPlPlay();
- afx_msg void OnRclickFilelist(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnDblclkFilelist(NMHDR* pNMHDR, LRESULT* pResult);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PLAYLIST_H__EA74376A_83DF_435E_8484_A15BF5B77A32__INCLUDED_)
+++ /dev/null
-// Sliders.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "osmo4.h"
-#include "Sliders.h"
-#include <gpac/options.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// Sliders dialog
-
-Sliders::Sliders(CWnd* pParent /*=NULL*/)
- : CDialog(Sliders::IDD, pParent)
-{
- //{{AFX_DATA_INIT(Sliders)
- //}}AFX_DATA_INIT
-
- m_grabbed = GF_FALSE;
-}
-
-
-void Sliders::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(Sliders)
- DDX_Control(pDX, ID_AUDIO_VOL, m_AudioVol);
- DDX_Control(pDX, ID_SLIDER, m_PosSlider);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(Sliders, CDialog)
- //{{AFX_MSG_MAP(Sliders)
- ON_WM_HSCROLL()
- ON_WM_SIZE()
- ON_WM_CLOSE()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// Sliders message handlers
-
-void Sliders::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
-{
-
- Osmo4 *app = GetApp();
- if (pScrollBar->GetDlgCtrlID() == ID_SLIDER) {
- switch (nSBCode) {
- case TB_PAGEUP:
- case TB_PAGEDOWN:
- case TB_LINEUP:
- case TB_LINEDOWN:
- case TB_TOP:
- case TB_BOTTOM:
-// m_grabbed = GF_TRUE;
- break;
- case TB_THUMBPOSITION:
- case TB_THUMBTRACK:
- m_grabbed = GF_TRUE;
- break;
- case TB_ENDTRACK:
- if (m_grabbed) {
- if (!app->can_seek || !app->m_isopen) {
- m_PosSlider.SetPos(0);
- } else {
- u32 range = m_PosSlider.GetRangeMax() - m_PosSlider.GetRangeMin();
- u32 seek_to = m_PosSlider.GetPos();
- app->PlayFromTime(seek_to);
- }
- m_grabbed = GF_FALSE;
- }
- break;
- }
- }
- if (pScrollBar->GetDlgCtrlID() == ID_AUDIO_VOL) {
- u32 vol = m_AudioVol.GetPos();
- gf_term_set_option(app->m_term, GF_OPT_AUDIO_VOLUME, vol);
- }
- CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
-}
-
-void Sliders::OnSize(UINT nType, int cx, int cy)
-{
- CDialog::OnSize(nType, cx, cy);
-
- if (!m_PosSlider.m_hWnd) return;
- RECT rc, rc2;
-
- u32 tw = 40;
- //m_PosSlider.GetClientRect(&rc);
- //rc.right = rc.left + cx;
- //m_PosSlider.SetWindowPos(this, rc.left, rc.top, rc.right, rc.bottom, SWP_NOZORDER | SWP_NOMOVE);
-
- m_PosSlider.GetClientRect(&rc);
- rc.right = rc.left + cx - tw;
- rc.top += 10;
- rc.bottom += 10;
- m_PosSlider.SetWindowPos(this, rc.left, rc.top, rc.right, rc.bottom, SWP_NOZORDER | SWP_NOMOVE);
-
- const UINT nPixelsLength = 24;
- m_PosSlider.ModifyStyle(0,TBS_FIXEDLENGTH,FALSE);
- m_PosSlider.SendMessage(TBM_SETTHUMBLENGTH,nPixelsLength,0);
-
- m_AudioVol.GetClientRect(&rc2);
- rc2.top = rc2.bottom = cy/2;
- rc2.top -= cy/3;
- rc2.bottom += cy/3;
- rc2.left = rc.right;
- rc2.right = rc.right+tw;
- m_AudioVol.MoveWindow(&rc2);
-
-}
-
-/*we sure don't want to close this window*/
-void Sliders::OnClose()
-{
- u32 i = 0;
- return;
-}
-
-BOOL Sliders::PreTranslateMessage(MSG* pMsg)
-{
- if (pMsg->message == WM_KEYDOWN) {
- GetApp()->m_pMainWnd->SetFocus();
- GetApp()->m_pMainWnd->PostMessage(pMsg->message, pMsg->wParam, pMsg->lParam);
- return TRUE;
- }
- return CDialog::PreTranslateMessage(pMsg);
-}
-
-
-BOOL Sliders::OnInitDialog()
-{
- CDialog::OnInitDialog();
- m_AudioVol.SetRange(0, 100);
- return TRUE;
-}
-
-void Sliders::SetVolume()
-{
- m_AudioVol.SetPos(gf_term_get_option(GetApp()->m_term, GF_OPT_AUDIO_VOLUME));
-}
+++ /dev/null
-#if !defined(AFX_SLIDERS_H__3542255E_1376_4FB7_91E7_B4841BB4F173__INCLUDED_)
-#define AFX_SLIDERS_H__3542255E_1376_4FB7_91E7_B4841BB4F173__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// Sliders.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// Sliders dialog
-class MySliderCtrl : public CSliderCtrl
-{
-public:
- MySliderCtrl () {} // standard constructor
-
-protected:
- afx_msg virtual void OnLButtonDown(UINT nFlags, CPoint point);
-};
-
-class Sliders : public CDialog
-{
-// Construction
-public:
- Sliders(CWnd* pParent = NULL); // standard constructor
-
- void SetVolume();
- Bool m_grabbed;
-
-// Dialog Data
- //{{AFX_DATA(Sliders)
- enum { IDD = IDD_SLIDERS };
- CSliderCtrl m_AudioVol;
- CSliderCtrl m_PosSlider;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(Sliders)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(Sliders)
- afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnClose();
- virtual BOOL OnInitDialog();
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_SLIDERS_H__3542255E_1376_4FB7_91E7_B4841BB4F173__INCLUDED_)
+++ /dev/null
-// stdafx.cpp : source file that includes just the standard includes
-// GPAC.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-
-
+++ /dev/null
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__1EEB44C5_1152_4872_8CA7_BD2994085EDC__INCLUDED_)
-#define AFX_STDAFX_H__1EEB44C5_1152_4872_8CA7_BD2994085EDC__INCLUDED_
-
-#ifndef WINVER
-#define WINVER 0x0501
-#endif
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-
-#include <afxwin.h> // MFC core and standard components
-#include <afxext.h> // MFC extensions
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__1EEB44C5_1152_4872_8CA7_BD2994085EDC__INCLUDED_)
+++ /dev/null
-//
-// Osmo4.RC2 - resources Microsoft Visual C++ does not edit directly
-//
-
-#ifdef APSTUDIO_INVOKED
- #error this file is not editable by Microsoft Visual C++
-#endif //APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Add manually edited resources here...
-
-/////////////////////////////////////////////////////////////////////////////
+++ /dev/null
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by Osmo4.rc
-//
-#define IDD_ABOUTBOX 100
-#define IDR_MAINFRAME 128
-#define IDR_GPACTYPE 129
-#define IDD_CONTROL 132
-#define IDI_PLAY 141
-#define IDI_STOP 142
-#define IDI_PAUSE 143
-#define IDI_MESSAGE 144
-#define IDI_ERR 145
-#define IDD_OPTIONS 152
-#define IDD_OPT_GEN 154
-#define IDD_OPT_RENDER 155
-#define IDD_OPT_AUDIO 157
-#define IDD_OPT_VIDEO 158
-#define IDD_OPT_HTTP 159
-#define IDD_OPT_FONT 161
-#define IDD_OPT_SYSTEMS 162
-#define IDD_OPT_STREAM 164
-#define IDD_PROPERTIES 166
-#define IDD_OPT_DECODER 167
-#define IDD_OPT_RENDER2D 168
-#define IDD_OPT_RENDER3D 169
-#define IDR_MAINTOOLS 170
-#define ID_MAINSLIDER 171
-#define IDD_SLIDERS 173
-#define IDD_NAVBAR 176
-#define IDD_PLAYLIST 177
-#define IDR_PLAYLIST 178
-#define IDD_OPT_FILETYPES 179
-#define IDR_MENUPL 182
-#define IDD_PASSWD 188
-#define IDR_MAINACCEL 190
-#define IDC_FILES_MIMES 1000
-#define IDC_FILES_PLUG 1001
-#define ID_AUDIO_VOL 1002
-#define IDC_TXT_SITE 1003
-#define IDC_EDIT_USER 1004
-#define IDC_EDIT_PASSWORD 1005
-#define IDC_PLAY 1006
-#define IDC_STOP 1007
-#define IDC_COMBOURL 1008
-#define IDC_BROWSE 1009
-#define IDC_BUTGO 1010
-#define IDC_SPIN_OPT 1011
-#define IDC_OPT_SET_NAME 1012
-#define IDC_LANG 1013
-#define IDC_LOOP 1014
-#define IDC_AUTOSTART 1015
-#define IDC_FILEASSOC 1016
-#define IDC_NO_CONSOLE 1017
-#define IDC_BIFS_RATE 1018
-#define IDC_DEC_THREAD 1019
-#define IDC_DIRECTRENDER 1020
-#define IDC_HWMEMORY 1021
-#define IDC_BIFSDROP 1023
-#define IDC_SPIN_AUDIO 1024
-#define IDC_EDIT_AUDIO 1025
-#define IDC_FORCE_AUDIO 1026
-#define IDC_SPIN_FPS 1027
-#define IDC_AUDIO_FPS 1028
-#define IDC_AUDIO_MULTICH 1029
-#define IDC_GD_LIST 1031
-#define IDC_FAST_RENDER 1032
-#define IDC_FORCE_DURATION 1033
-#define IDC_YUV 1034
-#define IDC_AUDIO_RESYNC 1035
-#define IDC_AUDIO_NOTIFS 1036
-#define IDC_STOPATEND 1037
-#define IDC_CLEAN_CACHE 1038
-#define IDC_RESTART_CACHE 1039
-#define IDC_NOTIFY_PROG 1040
-#define IDC_BROWSE_CACHE 1041
-#define IDC_LOOKFORSUB 1042
-#define IDD_OPT_MCACHE 1043
-#define IDC_DRIVER_LIST 1044
-#define IDC_AA_LIST 1045
-#define IDC_ZOOM_SCALABLE 1046
-#define IDD_OPENFILE 1047
-#define IDC_SINGLE_INSTANCE 1048
-#define IDC_VIDEO_LIST 1049
-#define IDC_FONT_LIST 1050
-#define IDC_BROWSE_FONT 1051
-#define IDC_USE_FONT 1052
-#define IDC_SAVEOPT 1053
-#define IDC_PORT 1054
-#define IDC_RTSP 1055
-#define IDC_TIMEOUT 1056
-#define IDC_BUFFER 1057
-#define IDC_REBUFFER_LEN 1058
-#define IDC_REBUFFER 1059
-#define IDC_ODTREE 1060
-#define IDC_VIEWSG 1061
-#define IDC_FORCE_SIZE 1062
-#define IDC_USE_RENDER3D 1063
-#define IDC_ODINFO 1064
-#define IDC_WORLD 1065
-#define IDC_GOGPAC 1066
-#define IDC_GOOSMO4 1067
-#define IDC_DUMP_XMT 1068
-#define IDC_OBJECT_TIME 1069
-#define IDC_FORMAT_YUV 1070
-#define IDC_DRAW_BOUNDS 1071
-#define IDC_REORDER 1072
-#define IDC_TEXTURE_MODE 1073
-#define IDC_SWITCH_RES 1074
-#define IDC_AUDEC_LIST 1075
-#define IDC_VIDEC_LIST 1076
-#define IDC_ASSOCIATE 1077
-#define IDC_RASTER_OUTLINE 1078
-#define IDC_EMUL_POW2 1079
-#define IDC_DISABLE_POLY_AA 1080
-#define IDC_WIRE_NONE 1081
-#define IDC_WIRE_ONLY 1082
-#define IDC_WIRE_BOTH 1083
-#define IDC_DISABLE_TX_RECT 1084
-#define IDC_BITMAP_USE_PIXEL 1085
-#define IDC_TEXTURE_TEXT 1086
-#define IDC_SLIDER 1087
-#define ID_SLIDER 1088
-#define IDC_SELECT 1089
-#define IDC_NO_BACKCULL 1090
-#define IDC_FILES_EXT 1091
-#define IDC_VIEWSEL 1094
-#define IDC_ADDRESS 1096
-#define IDC_DUMTXT 1097
-#define IDC_FILELIST 1109
-#define IDC_BROWSE_MCACHE 1110
-#define IDC_MCACHE_OVERWRITE 1111
-#define IDC_MCACHE_USENAME 1112
-#define IDC_BASEPRES 1113
-#define ID_FILE_EXIT 1114
-#define ID_H_ABOUT 1115
-#define ID_PLAYLIST_LOOP 1116
-#define ID_OPEN_FILE 1117
-#define ID_VIEW_CONTROL 1118
-#define ID_VIEW_ORIGINAL 1119
-#define ID_VIEW_FULLSCREEN 1120
-#define ID_AR_KEEP 1121
-#define IDC_DRAW_NORMALS 1122
-#define IDC_BACK_CULL 1123
-#define IDC_DRAW_MODE 1124
-#define ID_SHORTCUTS 1125
-#define ID_FILE_RESTART 1126
-#define ID_OPT_QUALITY 1127
-#define ID_FILE_PROP 1128
-#define ID_FILE_STEP 1129
-#define IDD_CONFIGURE 1130
-#define ID_VIEW_SCALABLE 1131
-#define ID_OPEN_URL 1132
-#define ID_FILE_RELOAD 1133
-#define ID_FILE_PLAY 1134
-#define ID_NAVIGATE_NONE 1135
-#define ID_NAVIGATE_WALK 1136
-#define ID_NAVIGATE_FLY 1137
-#define ID_NAVIGATE_EXAM 1138
-#define ID_NAVIGATE_PAN 1139
-#define ID_NAVIGATE_SLIDE 1140
-#define ID_NAVIGATE_GAME 1141
-#define ID_AR_FILL 1142
-#define ID_AR_43 1143
-#define ID_AR_169 1144
-#define ID_FILE_MIGRATE 1145
-#define ID_NAV_RESET 1151
-#define ID_FILE_STOP 1152
-#define ID_FILE_PREV 1155
-#define ID_FILE_NEXT 1156
-#define ID_FILE_PROPS 1157
-#define ID_SWITCH_RENDER 1158
-#define ID_RELOAD_TERMINAL 1159
-#define ID_VIEW_PLAYLIST 1160
-#define ID_NAVIGATE_ORBIT 1161
-#define ID_COLLIDE_NONE 1162
-#define ID_COLLIDE_REG 1163
-#define ID_COLLIDE_DISP 1164
-#define ID_GRAVITY 1165
-#define ID_HEADLIGHT 1166
-#define ID_NAV_INFO 1167
-#define ID_NAV_PREV 1168
-#define ID_NAV_NEXT 1169
-#define ID_CLEAR_NAV 1170
-#define ID_TIMER 1171
-#define ID_FPS 1172
-#define ID_VIEWPORT_EMPTY 1173
-#define ID_PL_REM_ALL 1174
-#define ID_PL_REM_DEAD 1175
-#define ID_PL_ADD_DIR_REC 1176
-#define ID_PL_ADD_FILE 1177
-#define ID_PL_REM_FILE 1178
-#define ID_PL_OPEN 1179
-#define ID_PL_SAVE 1180
-#define ID_PL_UP 1181
-#define ID_PL_DOWN 1182
-#define ID_VIEW_PL 1183
-#define ID_PL_ADD_DIR 1184
-#define ID_PL_ADD_URL 1185
-#define ID_PL_PLAY 1186
-#define ID_PL_SEL_REV 1187
-#define ID_PL_SORT_TITLE 1188
-#define ID_PL_SORT_FILE 1189
-#define ID_PL_SORT_DUR 1190
-#define ID_PL_SORT_REV 1191
-#define ID_PL_RANDOM 1192
-#define ID_ADD_SUBTITLE 1193
-#define ID_NAVIGATE_VR 1194
-#define ID_REC_ENABLE 1195
-#define ID_REC_STOP 1196
-#define ID_REC_ABORT 1197
-#define ID_AUDIO_EMPTY 1198
-#define ID_VIDEO_EMPTY 1199
-#define ID_SUBS_EMPTY 1200
-#define ID_VIEW_CPU 1201
-#define IDC_SAX_PROGRESSIVE 1202
-#define IDC_SAX_DELAY 1203
-#define IDC_HTTP_PROXY 1204
-#define IDC_HTTP_USE_PROXY 1205
-#define IDC_LOG_LEVEL 1210
-#define IDC_TOOL_CORE 1211
-#define IDC_TOOL_CODING 1212
-#define IDC_TOOL_CONTAINER 1213
-#define IDC_TOOL_NET 1214
-#define IDC_TOOL_RTP 1215
-#define IDC_TOOL_AUTHOR 1216
-#define IDC_TOOL_CODEC 1217
-#define IDC_TOOL_PARSER 1218
-#define IDC_TOOL_MEDIA 1219
-#define IDC_TOOL_SCENE 1220
-#define IDC_TOOL_SCRIPT 1221
-#define IDC_TOOL_COMPOSE 1222
-#define IDC_TOOL_RENDER 1223
-#define IDC_TOOL_MMIO 1224
-#define IDC_TOOL_SYNC 1225
-#define IDD_OPT_LOGS 1226
-#define ID_VP_0 1300
-#define ID_VP_1 1301
-#define ID_VP_2 1302
-#define ID_VP_3 1303
-#define ID_VP_4 1304
-#define ID_VP_5 1305
-#define ID_VP_6 1306
-#define ID_VP_7 1307
-#define ID_VP_8 1308
-#define ID_VP_9 1309
-#define ID_VP_10 1310
-#define ID_VP_11 1311
-#define ID_VP_12 1312
-#define ID_VP_13 1313
-#define ID_VP_14 1314
-#define ID_VP_15 1315
-#define ID_VP_16 1316
-#define ID_VP_17 1317
-#define ID_VP_18 1318
-#define ID_VP_19 1319
-#define ID_NAV_PREV_0 1320
-#define ID_NAV_PREV_1 1321
-#define ID_NAV_PREV_2 1322
-#define ID_NAV_PREV_3 1323
-#define ID_NAV_PREV_4 1324
-#define ID_NAV_PREV_5 1325
-#define ID_NAV_PREV_6 1326
-#define ID_NAV_PREV_7 1327
-#define ID_NAV_PREV_8 1328
-#define ID_NAV_PREV_9 1329
-#define ID_NAV_NEXT_0 1330
-#define ID_NAV_NEXT_1 1331
-#define ID_NAV_NEXT_2 1332
-#define ID_NAV_NEXT_3 1333
-#define ID_NAV_NEXT_4 1334
-#define ID_NAV_NEXT_5 1335
-#define ID_NAV_NEXT_6 1336
-#define ID_NAV_NEXT_7 1337
-#define ID_NAV_NEXT_8 1338
-#define ID_NAV_NEXT_9 1339
-#define ID_SELOBJ_0 1340
-#define ID_SELOBJ_1 1341
-#define ID_SELOBJ_2 1342
-#define ID_SELOBJ_3 1343
-#define ID_SELOBJ_4 1344
-#define ID_SELOBJ_5 1345
-#define ID_SELOBJ_6 1346
-#define ID_SELOBJ_7 1347
-#define ID_SELOBJ_8 1348
-#define ID_SELOBJ_9 1349
-#define ID_SELOBJ_10 1350
-#define ID_SELOBJ_11 1351
-#define ID_SELOBJ_12 1352
-#define ID_SELOBJ_13 1353
-#define ID_SELOBJ_14 1354
-#define ID_SELOBJ_15 1355
-#define ID_SELOBJ_16 1356
-#define ID_SELOBJ_17 1357
-#define ID_SELOBJ_18 1358
-#define ID_SELOBJ_19 1359
-#define ID_SELOBJ_20 1360
-#define ID_SELOBJ_21 1361
-#define ID_SELOBJ_22 1362
-#define ID_SELOBJ_23 1363
-#define ID_SELOBJ_24 1364
-#define ID_SELOBJ_25 1365
-#define ID_SELOBJ_26 1366
-#define ID_SELOBJ_27 1367
-#define ID_SELOBJ_28 1368
-#define ID_SELOBJ_29 1369
-#define ID_SETCHAP_FIRST 2000
-#define ID_SETCHAP_LAST 2200
-#define ID_FILE_COPY 32961
-#define ID_FILE_PASTE 32962
-#define ID_CONFIG_RELOAD 32963
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 192
-#define _APS_NEXT_COMMAND_VALUE 32981
-#define _APS_NEXT_CONTROL_VALUE 1131
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+++ /dev/null
-// MainFrm.cpp : implementation of the CMainFrame class
-//
-
-#ifdef _DEBUG
-#include "stdafx.h"
-#else
-#include "stdafx.h"
-#undef _DEBUG
-#endif
-
-#include "Osmo4.h"
-
-#include <gpac/options.h>
-#include <gpac/network.h>
-
-#include "MainFrm.h"
-#include <gx.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-
-
-CChildView::CChildView()
-{
-}
-
-CChildView::~CChildView()
-{
- /*since the wndproc is overwritten by the terminal, we detach the handle otherwise we get a nice assertion
- failure from windows*/
- HWND hWnd = Detach();
- ::PostMessage(hWnd, WM_QUIT, 0, 0);
-}
-
-
-BEGIN_MESSAGE_MAP(CChildView,CWnd )
- //{{AFX_MSG_MAP(CChildView)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildView message handlers
-
-BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
-{
- if (!CWnd::PreCreateWindow(cs))
- return FALSE;
-
- cs.style &= ~WS_BORDER;
- cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
- NULL, HBRUSH(COLOR_WINDOW+1), NULL);
-
- return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame
-
-IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
-
-BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- ON_WM_CREATE()
- ON_WM_SETFOCUS()
- ON_COMMAND(ID_APP_EXIT, OnAppExit)
- ON_MESSAGE(WM_OPENURL, Open)
- ON_MESSAGE(WM_SETTINGCHANGE, OnSIPChange)
- ON_MESSAGE(WM_SETSIZE,OnSetSize)
- ON_MESSAGE(WM_NAVIGATE,OnNavigate)
- ON_WM_SIZE()
- ON_COMMAND(ID_FILE_STEP, OnFileStep)
- ON_UPDATE_COMMAND_UI(ID_FILE_STEP, OnUpdateFileStep)
- ON_COMMAND(ID_FILE_PAUSE, OnFilePause)
- ON_UPDATE_COMMAND_UI(ID_FILE_PAUSE, OnUpdateFilePause)
- ON_COMMAND(ID_FILE_STOP, OnFileStop)
- ON_UPDATE_COMMAND_UI(ID_FILE_STOP, OnUpdateFileStop)
- ON_COMMAND(ID_VIEW_FULLSCREEN, OnViewFullscreen)
- ON_UPDATE_COMMAND_UI(ID_VIEW_FULLSCREEN, OnUpdateViewFullscreen)
- ON_WM_CLOSE()
- ON_COMMAND(ID_VIEW_FIT, OnViewFit)
- ON_UPDATE_COMMAND_UI(ID_VIEW_FIT, OnUpdateViewFit)
- ON_COMMAND(ID_VIEW_AR_ORIG, OnViewArOrig)
- ON_COMMAND(ID_VIEW_AR_FILL, OnViewArFill)
- ON_COMMAND(ID_VIEW_AR_43, OnViewAr43)
- ON_COMMAND(ID_VIEW_AR_169, OnViewAr169)
- ON_COMMAND(ID_NAV_NONE, OnNavNone)
- ON_COMMAND(ID_NAV_SLIDE, OnNavSlide)
- ON_COMMAND(ID_NAV_RESET, OnNaveReset)
- ON_COMMAND_RANGE(ID_NAV_NONE, ID_NAV_EXAMINE, OnSetNavigation)
- ON_WM_KEYDOWN()
- ON_WM_KEYUP()
- ON_COMMAND(ID_VIEW_TIMING, OnViewTiming)
- ON_UPDATE_COMMAND_UI(ID_VIEW_TIMING, OnUpdateViewTiming)
- ON_WM_INITMENUPOPUP()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame construction/destruction
-
-CMainFrame::CMainFrame()
-{
- GXOpenInput();
- m_view_timing = 0;
- m_restore_fs = 0;
-}
-
-CMainFrame::~CMainFrame()
-{
- GXCloseInput();
-}
-
-void CMainFrame::OnSetFocus(CWnd* pOldWnd)
-{
- if (m_restore_fs) {
- m_restore_fs = 0;
- GetApp()->ShowTaskBar(0);
- OnViewFullscreen();
- }
-}
-
-int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- COsmo4 *app = GetApp();
-
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- // create a view to occupy the client area of the frame
- if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW | WS_BORDER,
- CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
- {
- TRACE0("Failed to create view window\n");
- return -1;
- }
- m_wndView.ShowWindow(SW_HIDE);
-
-
- if (!m_dumbWnd.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW | WS_BORDER,
- CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
- {
- TRACE0("Failed to create dumb window\n");
- return -1;
- }
- m_dumbWnd.SetWindowPos(this, 0, 0, app->m_screen_width, app->m_screen_height-app->m_menu_height, 0L);
- m_dumbWnd.ShowWindow(SW_HIDE);
-
- if (!m_progBar.Create(IDD_CONTROL , this) ) {
- TRACE0("Failed to create status bar\n");
- return -1; // fail to create
- }
- m_progBar.UpdateWindow();
- m_progBar.SetWindowPos(this, 0, 0, app->m_screen_width, app->m_menu_height, 0L);
- m_progBar.ShowWindow(SW_SHOWNORMAL);
-
-
-// m_wndCommandBar.m_bShowSharedNewButton = FALSE;
-
- if (!m_wndCommandBar.Create(this)
- || !m_wndCommandBar.InsertMenuBar(IDR_MENU)
- || !m_wndCommandBar.AddAdornments()
- || !m_wndCommandBar.LoadBitmap(IDR_MAINFRAME)
- )
- {
- TRACE0("Failed to create CommandBar\n");
- return -1; // fail to create
- }
-
- CToolBarCtrl & toolBar = m_wndCommandBar.GetToolBarCtrl();
- TBBUTTON tb;
- memset(&tb, 0, sizeof(tb));
- tb.idCommand = ID_OPEN_FILE;
- tb.iBitmap = 0;
- tb.fsStyle = TBSTYLE_BUTTON;
- toolBar.AddButtons(1, &tb);
- tb.idCommand = 0;
- tb.iBitmap = 0;
- tb.fsStyle = TBSTYLE_SEP;
- toolBar.AddButtons(1, &tb);
- tb.idCommand = ID_FILE_PAUSE;
- tb.iBitmap = 1;
- tb.fsStyle = TBSTYLE_BUTTON;
- toolBar.AddButtons(1, &tb);
- tb.idCommand = ID_FILE_STEP;
- tb.iBitmap = 2;
- tb.fsStyle = TBSTYLE_BUTTON;
- toolBar.AddButtons(1, &tb);
- tb.idCommand = ID_FILE_STOP;
- tb.iBitmap = 3;
- tb.fsStyle = TBSTYLE_BUTTON;
- toolBar.AddButtons(1, &tb);
- tb.idCommand = 0;
- tb.iBitmap = 0;
- tb.fsStyle = TBSTYLE_SEP;
- toolBar.AddButtons(1, &tb);
-
- SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE);
- SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);
- SetWindowPos(NULL, 0, 0, app->m_screen_width, app->m_screen_height, 0L);
-
- SetWindowText(_T("Osmo4"));
- return 0;
-}
-
-void CMainFrame::SetPauseButton(Bool force_play_button)
-{
- CToolBarCtrl & toolBar = m_wndCommandBar.GetToolBarCtrl();
- TBBUTTON tb;
- memset(&tb, 0, sizeof(tb));
- tb.idCommand = ID_FILE_PAUSE;
- tb.fsStyle = TBSTYLE_BUTTON;
-
- if (force_play_button || GetApp()->m_stopped || gf_term_get_option(GetApp()->m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) {
- tb.iBitmap = 4;
- } else {
- tb.iBitmap = 1;
- }
- toolBar.DeleteButton(5);
- toolBar.InsertButton(5, &tb);
-}
-
-
-BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
-{
- if( !CFrameWnd::PreCreateWindow(cs) )
- return FALSE;
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
-
-
- cs.lpszClass = AfxRegisterWndClass(0);
- return TRUE;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame diagnostics
-
-/*
-#ifdef _DEBUG
-void CMainFrame::AssertValid() const
-{
- CFrameWnd::AssertValid();
-}
-
-void CMainFrame::Dump(CDumpContext& dc) const
-{
- CFrameWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-*/
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame message handlers
-BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
-{
- // let the view have first crack at the command
- if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
- return TRUE;
-
- // otherwise, do default handling
- return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
-}
-
-#define PROGRESS_TIMER 20
-#define PROGRESS_REFRESH_MS 500
-
-void CALLBACK EXPORT ProgressTimer(HWND , UINT , UINT nID , DWORD )
-{
- if (nID != PROGRESS_TIMER) return;
- ((CMainFrame *) GetApp()->m_pMainWnd)->UpdateTime();
-}
-
-void CMainFrame::UpdateTime()
-{
- u32 now;
-
- COsmo4 *app = GetApp();
- if (!app->m_open || app->m_stopped) return;
- now = gf_term_get_time_in_ms(app->m_term);
- if (!now) return;
-
- if (app->m_can_seek && (now>=app->m_duration + 100)) {
- if (gf_term_get_option(app->m_term, GF_OPT_IS_FINISHED)) {
- if (app->m_Loop && m_full_screen) {
- gf_term_play_from_time(app->m_term, 0, 0);
- } else {
- OnFileStop();
- if (app->m_Loop) OnFilePause();
- }
- return;
- }
- }
-
- if (!m_full_screen) m_progBar.SetPosition(now);
-}
-
-void CMainFrame::CloseURL()
-{
- COsmo4 *app = GetApp();
- if (!app->m_open) return;
- if (m_view_timing) KillTimer(PROGRESS_TIMER);
- gf_term_disconnect(app->m_term);
- app->m_open = 0;
- app->m_can_seek = 0;
- app->m_duration = (u32) -1;
- m_progBar.m_prev_time = 0;
- m_progBar.SetPosition(0);
-}
-
-void CMainFrame::OnAppExit()
-{
- CloseURL();
- PostMessage(WM_QUIT);
-}
-
-void CMainFrame::OnSize(UINT nType, int cx, int cy)
-{
- COsmo4 *app = GetApp();
- u32 disp_w, disp_h, c_w, c_h, x, y;
-
- if (m_full_screen) return;
-
- disp_w = app->m_screen_width;
- disp_h = app->m_screen_height;
- CFrameWnd::OnSize(nType, disp_w, disp_h);
-
- x = y = 0;
- disp_h -= app->m_menu_height;
-
- if (m_view_timing) {
- disp_h -= app->m_menu_height;
- y = app->m_menu_height;
- m_progBar.SetWindowPos(this, 0, 0, app->m_screen_width, app->m_menu_height, 0L);
- m_progBar.ShowWindow(SW_SHOWNORMAL);
- } else {
- m_progBar.ShowWindow(SW_HIDE);
- }
- m_dumbWnd.SetWindowPos(this, 0, y, disp_w, disp_h, 0L);
- m_dumbWnd.ShowWindow(SW_SHOW);
-
- if (m_view_timing)
- SetTimer(PROGRESS_TIMER, PROGRESS_REFRESH_MS, ProgressTimer);
-
- if (!app->m_scene_width || !app->m_scene_height) {
- m_wndView.SetWindowPos(this, 0, y, disp_w, disp_h, SWP_SHOWWINDOW);
- gf_term_set_size(app->m_term, disp_w, disp_h);
- return;
- }
-
- if (!app->m_fit_screen && (app->m_scene_width < disp_w) && (app->m_scene_height < disp_h)) {
- c_w = app->m_scene_width;
- c_h = app->m_scene_height;
- x = (disp_w - c_w) / 2;
- y = (disp_h - c_h) / 2;
- } else {
- c_w = disp_w;
- c_h = disp_h;
- }
- m_wndView.SetWindowPos(this, x, y, c_w, c_h, SWP_SHOWWINDOW | SWP_NOZORDER);
- gf_term_set_size(app->m_term, c_w, c_h);
-}
-
-
-void CMainFrame::OnViewFullscreen()
-{
- COsmo4 *app = GetApp();
- if (!app->m_open) return;
- u32 disp_w = app->m_screen_width;
- u32 disp_h = app->m_screen_height;
-
- Bool is_full_screen = !m_full_screen;
-
- /*prevent resize messages*/
- m_full_screen = 1;
-
- HWND hWnd = GetSafeHwnd();
- ::SetForegroundWindow(hWnd);
- ::CommandBar_Show(m_wndCommandBar.GetSafeHwnd(), is_full_screen ? FALSE : TRUE);
- SHFullScreen(hWnd, SHFS_HIDESTARTICON | SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
-
- if (is_full_screen) {
- m_dumbWnd.ShowWindow(SW_HIDE);
-
- ::MoveWindow(m_hWnd, 0, 0, disp_w, disp_h, 0);
- m_wndView.GetWindowRect(&m_view_rc);
- m_wndView.SetWindowPos(this, 0, 0, disp_w, disp_h, SWP_NOZORDER);
- gf_term_set_option(app->m_term, GF_OPT_FULLSCREEN, is_full_screen);
- m_full_screen = 1;
- } else {
- gf_term_set_option(app->m_term, GF_OPT_FULLSCREEN, is_full_screen);
- m_full_screen = 0;
- OnSetSize(0,0);
- m_dumbWnd.ShowWindow(SW_SHOW);
- gf_term_set_option(app->m_term, GF_OPT_REFRESH, 0);
- }
-}
-
-
-void CMainFrame::OnUpdateViewFullscreen(CCmdUI* pCmdUI)
-{
- pCmdUI->Enable(GetApp()->m_open ? TRUE : FALSE);
-}
-
-LONG CMainFrame::OnSetSize(WPARAM wParam, LPARAM lParam)
-{
- RECT rc;
- if (m_full_screen) return 0;
- GetWindowRect(&rc);
- SetWindowPos(NULL, 0, 0, rc.right-rc.left, rc.bottom-rc.top, SWP_NOZORDER | SWP_NOMOVE);
- return 1;
-}
-
-LONG CMainFrame::Open(WPARAM wParam, LPARAM lParam)
-{
- COsmo4 *app = GetApp();
- CloseURL();
- char filename[5000];
- CE_WideToChar((u16 *) (LPCTSTR) app->m_filename, filename);
- app->m_stopped = 0;
-
- if (app->m_reconnect_time) {
- gf_term_connect_from_time(app->m_term, filename, app->m_reconnect_time, 0);
- app->m_reconnect_time = 0;
- } else {
- gf_term_connect(app->m_term, filename);
- }
- app->SetBacklightState(1);
- return 1;
-}
-
-
-
-
-LONG CMainFrame::OnNavigate(WPARAM /*wParam*/, LPARAM /*lParam*/)
-{
- COsmo4 *app = GetApp();
- char to_url[MAX_PATH];
- CE_WideToChar((u16 *) (LPCTSTR) app->m_navigate_url, to_url);
-
- if (gf_term_is_supported_url(app->m_term, to_url, 1, app->m_no_mime_fetch)) {
- char fileName[MAX_PATH];
- TCHAR w_to_url[MAX_PATH];
- CE_WideToChar((u16 *) (LPCTSTR) app->m_filename, fileName);
- char *str = gf_url_concatenate(fileName, to_url);
- if (!str) str = gf_strdup(to_url);
- CE_CharToWide(str, (u16 *)w_to_url);
- gf_free(str);
- app->m_filename = w_to_url;
- Open(0, 0);
- } else {
- SHELLEXECUTEINFO info;
- console_message = app->m_navigate_url;
- console_err = GF_OK;
- PostMessage(WM_CONSOLEMSG);
-
-
- if (m_full_screen) {
- OnViewFullscreen();
- app->ShowTaskBar(1);
- m_restore_fs = 1;
- }
-
- memset(&info, 0, sizeof(SHELLEXECUTEINFO));
- info.cbSize = sizeof(SHELLEXECUTEINFO);
- info.lpVerb = L"open";
- info.fMask = SEE_MASK_NOCLOSEPROCESS;
- info.lpFile = L"iexplore";
- info.lpParameters = (LPCTSTR) app->m_navigate_url;
- info.nShow = SW_SHOWNORMAL;
- ShellExecuteEx(&info);
- }
- return 1;
-}
-
-void CMainFrame::OnFilePause()
-{
- COsmo4 *app = GetApp();
- if (app->m_stopped) {
- char filename[5000];
- CE_WideToChar((u16 *) (LPCTSTR) app->m_filename, filename);
- app->m_stopped = 0;
- gf_term_connect(app->m_term, filename);
- app->SetBacklightState(1);
-
- if (m_view_timing)
- SetTimer(PROGRESS_TIMER, PROGRESS_REFRESH_MS, ProgressTimer);
-
- SetPauseButton();
- } else {
- app->Pause();
- }
-}
-void CMainFrame::OnUpdateFilePause(CCmdUI* pCmdUI)
-{
- COsmo4 *app = GetApp();
- pCmdUI->Enable((app->m_open || app->m_stopped) ? TRUE : FALSE);
-}
-void CMainFrame::OnFileStop()
-{
- COsmo4 *app = GetApp();
- if (!app->m_open) return;
- if (m_full_screen) OnViewFullscreen();
- app->m_stopped = 1;
- if (m_view_timing) KillTimer(PROGRESS_TIMER);
- gf_term_disconnect(app->m_term);
- m_progBar.SetPosition(0);
- app->SetBacklightState(0);
- SetPauseButton();
-}
-
-void CMainFrame::OnUpdateFileStop(CCmdUI* pCmdUI)
-{
- pCmdUI->Enable( GetApp()->m_open ? TRUE : FALSE);
-}
-
-void CMainFrame::OnFileStep()
-{
- COsmo4 *app = GetApp();
- gf_term_set_option(app->m_term, GF_OPT_PLAY_STATE, GF_STATE_STEP_PAUSE);
- app->SetBacklightState(0);
- SetPauseButton(1);
-}
-void CMainFrame::OnUpdateFileStep(CCmdUI* pCmdUI)
-{
- pCmdUI->Enable(GetApp()->m_open ? TRUE : FALSE);
-}
-
-void CMainFrame::OnClose()
-{
- PostMessage(WM_DESTROY);
-}
-
-LONG CMainFrame::OnSIPChange(WPARAM wParam, LPARAM lParam)
-{
- if (wParam == SPI_SETSIPINFO) GetApp()->ShowTaskBar(0);
- return 1;
-}
-
-void CMainFrame::OnViewFit()
-{
- COsmo4 *app = GetApp();
- app->m_fit_screen = !app->m_fit_screen;
- if (app->m_open) OnSetSize(0, 0);
-}
-
-void CMainFrame::OnUpdateViewFit(CCmdUI* pCmdUI)
-{
- pCmdUI->SetCheck(GetApp()->m_fit_screen ? TRUE : FALSE);
-}
-
-void CMainFrame::OnViewArOrig()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
-}
-void CMainFrame::OnViewArFill()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN);
-}
-void CMainFrame::OnViewAr43()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3);
-}
-void CMainFrame::OnViewAr169()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);
-}
-
-void CMainFrame::OnNavNone()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE);
-}
-
-void CMainFrame::OnNavSlide()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE);
-}
-
-void CMainFrame::OnNaveReset()
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_NAVIGATION_TYPE, 0);
-}
-
-void CMainFrame::ForwardMessage()
-{
- const MSG *msg = GetCurrentMessage();
- m_wndView.SendMessage(msg->message, msg->wParam, msg->lParam);
-}
-void CMainFrame::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
-{
- ForwardMessage();
-}
-void CMainFrame::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
-{
- ForwardMessage();
-}
-
-
-void CMainFrame::OnViewTiming()
-{
- if (m_full_screen) return;
- if (m_view_timing) KillTimer(PROGRESS_TIMER);
- m_view_timing = !m_view_timing;
- OnSetSize(0, 0);
-}
-
-void CMainFrame::OnUpdateViewTiming(CCmdUI* pCmdUI)
-{
- pCmdUI->SetCheck(m_view_timing ? TRUE : FALSE);
-}
-
-void CMainFrame::OnSetNavigation(UINT nID)
-{
- gf_term_set_option(GetApp()->m_term, GF_OPT_NAVIGATION, nID - ID_NAV_NONE);
-}
-
-
-void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
-{
- COsmo4 *app = GetApp();
- CFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
-
- u32 opt = gf_term_get_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO);
- CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_AR_ORIG, MF_BYCOMMAND| (opt==GF_ASPECT_RATIO_KEEP) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_AR_FILL, MF_BYCOMMAND| (opt==GF_ASPECT_RATIO_FILL_SCREEN) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_AR_43, MF_BYCOMMAND| (opt==GF_ASPECT_RATIO_4_3) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_AR_169, MF_BYCOMMAND| (opt==GF_ASPECT_RATIO_16_9) ? MF_CHECKED : MF_UNCHECKED);
-
- CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_FIT, MF_BYCOMMAND| app->m_fit_screen ? MF_CHECKED : MF_UNCHECKED);
-
- u32 type;
- if (!app->m_open) type = GF_NAVIGATE_TYPE_NONE;
- else type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION_TYPE);
-
- EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_NONE, MF_BYCOMMAND | ((type==GF_NAVIGATE_TYPE_NONE) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_SLIDE, MF_BYCOMMAND | ((type==GF_NAVIGATE_TYPE_NONE) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_RESET, MF_BYCOMMAND | ((type==GF_NAVIGATE_TYPE_NONE) ? MF_GRAYED : MF_ENABLED) );
-
- EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_WALK, MF_BYCOMMAND | ( (type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_FLY, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_EXAMINE, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem(pPopupMenu->m_hMenu, ID_COLLIDE_OFF, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem(pPopupMenu->m_hMenu, ID_COLLIDE_REG, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem(pPopupMenu->m_hMenu, ID_COLLIDE_DISP, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_GRAVITY, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-
- if (type==GF_NAVIGATE_TYPE_NONE) {
- u32 mode = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION);
- CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_NONE, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_NONE) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_SLIDE, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_SLIDE) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_WALK, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_WALK) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_FLY, MF_BYCOMMAND | ((mode==GF_NAVIGATE_FLY) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_EXAMINE, MF_BYCOMMAND | ((mode==GF_NAVIGATE_EXAMINE) ? MF_CHECKED : MF_UNCHECKED) );
- }
-}
+++ /dev/null
-// MainFrm.h : interface of the CMainFrame class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_MAINFRM_H__1DEE4BC7_6B56_48A8_BDD7_5DC14EF6AD3E__INCLUDED_)
-#define AFX_MAINFRM_H__1DEE4BC7_6B56_48A8_BDD7_5DC14EF6AD3E__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#include "ProgressBar.h"
-
-
-class CChildView : public CWnd
-{
-// Construction
-public:
- CChildView();
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CChildView)
-protected:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CChildView();
- // Generated message map functions
-protected:
- //{{AFX_MSG(CChildView)
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class CMainFrame : public CFrameWnd
-{
-public:
- CMainFrame();
-
-
-
-protected:
- DECLARE_DYNAMIC(CMainFrame)
-
-// Attributes
-public:
-
- ProgressBar m_progBar;
- Bool m_full_screen, m_restore_fs, m_view_timing;
- u32 m_timer_on;
- CString console_message;
- GF_Err console_err;
- u32 m_aspect_ratio;
-
-// Operations
-public:
- void SetPauseButton(Bool force_play_button = 0);
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMainFrame)
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- afx_msg void OnSetFocus(CWnd *pOldWnd);
- virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CMainFrame();
-
- /*
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- */
-
-protected: // control bar embedded members
-
-#if (_MSC_VER >= 1300)
- CCommandBar m_wndCommandBar;
-#else
- CCeCommandBar m_wndCommandBar;
-#endif
-
- void CloseURL();
- void ForwardMessage();
-
-private:
- RECT m_view_rc;
-
-public:
- /*m_dumbWnd is used to clean the screen...*/
- CChildView m_wndView, m_dumbWnd;
- void UpdateTime();
-
-// Generated message map functions
-protected:
- //{{AFX_MSG(CMainFrame)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnAppExit();
- afx_msg LONG Open(WPARAM wParam, LPARAM lParam);
- afx_msg LONG OnSIPChange(WPARAM wParam, LPARAM lParam);
- afx_msg LONG OnSetSize(WPARAM wParam, LPARAM lParam);
- afx_msg LONG OnNavigate(WPARAM wParam, LPARAM lParam);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnFileStep();
- afx_msg void OnUpdateFileStep(CCmdUI* pCmdUI);
- afx_msg void OnFilePause();
- afx_msg void OnUpdateFilePause(CCmdUI* pCmdUI);
- afx_msg void OnFileStop();
- afx_msg void OnUpdateFileStop(CCmdUI* pCmdUI);
- afx_msg void OnViewFullscreen();
- afx_msg void OnUpdateViewFullscreen(CCmdUI* pCmdUI);
- afx_msg void OnClose();
- afx_msg void OnViewFit();
- afx_msg void OnUpdateViewFit(CCmdUI* pCmdUI);
- afx_msg void OnViewArOrig();
- afx_msg void OnViewArFill();
- afx_msg void OnViewAr43();
- afx_msg void OnViewAr169();
- afx_msg void OnNavNone();
- afx_msg void OnNavSlide();
- afx_msg void OnNaveReset();
- afx_msg void OnSetNavigation(UINT nID);
-
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnViewTiming();
- afx_msg void OnUpdateViewTiming(CCmdUI* pCmdUI);
- afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
- //}}AFX_MSG
-
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MAINFRM_H__1DEE4BC7_6B56_48A8_BDD7_5DC14EF6AD3E__INCLUDED_)
+++ /dev/null
-// OpenDlg.cpp : implementation file
-//
-#include "stdafx.h"
-#include "resource.h"
-#include "OpenDlg.h"
-#include "Osmo4.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// OpenDlg dialog
-
-
-OpenDlg::OpenDlg(CWnd* pParent /*=NULL*/)
- : CDialog(OpenDlg::IDD, pParent)
-{
- //{{AFX_DATA_INIT(OpenDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void OpenDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(OpenDlg)
- DDX_Control(pDX, IDC_FILELIST, m_URLs);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(OpenDlg, CDialog)
- //{{AFX_MSG_MAP(OpenDlg)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-void OpenDlg::OnOK()
-{
- CString URL;
- char szUrl[5000];
-
- int sel = m_URLs.GetCurSel();
- if (sel == CB_ERR) {
- m_URLs.GetWindowText(URL);
- } else {
- m_URLs.GetLBText(sel, URL);
- }
- if (!URL.GetLength()) {
- EndDialog(IDCANCEL);
- return;
- }
- COsmo4 *app = GetApp();
- u32 nb_entries;
-
- app->m_filename = URL;
-
- CE_WideToChar((unsigned short *) (LPCTSTR) URL, szUrl);
-
- gf_cfg_set_key(app->m_user.config, "RecentFiles", szUrl, NULL);
- gf_cfg_insert_key(app->m_user.config, "RecentFiles", szUrl, "", 0);
- /*remove last entry if needed*/
- nb_entries = gf_cfg_get_key_count(app->m_user.config, "RecentFiles");
- if (nb_entries>20) {
- gf_cfg_set_key(app->m_user.config, "RecentFiles", gf_cfg_get_key_name(app->m_user.config, "RecentFiles", nb_entries-1), NULL);
- }
- EndDialog(IDOK);
-}
-
-BOOL OpenDlg::OnInitDialog()
-{
- TCHAR w_str[5000];
- CDialog::OnInitDialog();
- COsmo4 *app = GetApp();
- const char *sOpt;
- u32 i=0;
-
- while (m_URLs.GetCount()) m_URLs.DeleteString(0);
- while (1) {
- sOpt = gf_cfg_get_key_name(app->m_user.config, "RecentFiles", i);
- if (!sOpt) break;
- CE_CharToWide((char *) sOpt, (u16 *)w_str);
- m_URLs.AddString(w_str);
- i++;
- }
-
- SetFocus();
- return TRUE;
-}
+++ /dev/null
-#if !defined(AFX_OPENDLG_H__DD903B38_EA45_4251_A8C9_4E4B08BECCCC__INCLUDED_)
-#define AFX_OPENDLG_H__DD903B38_EA45_4251_A8C9_4E4B08BECCCC__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// OpenDlg.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// OpenDlg dialog
-
-class OpenDlg : public CDialog
-{
-// Construction
-public:
- OpenDlg(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(OpenDlg)
- enum { IDD = IDD_OPENFILE };
- CComboBox m_URLs;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(OpenDlg)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(OpenDlg)
- virtual void OnOK();
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OPENDLG_H__DD903B38_EA45_4251_A8C9_4E4B08BECCCC__INCLUDED_)
+++ /dev/null
-// Options.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include <gpac/options.h>
-#include <gpac/modules/audio_out.h>
-#include <gpac/modules/codec.h>
-#include <gpac/modules/font.h>
-#include <gpac/constants.h>
-#include <gpac/iso639.h>
-
-#include "Options.h"
-#include <gx.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions dialog
-
-
-COptions::COptions(CWnd* pParent /*=NULL*/)
- : CDialog(COptions::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptions)
- //}}AFX_DATA_INIT
-
-}
-
-
-void COptions::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptions)
- DDX_Control(pDX, IDC_COMBOSEL, m_Selection);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptions, CDialog)
- //{{AFX_MSG_MAP(COptions)
- ON_BN_CLICKED(IDC_SAVEOPT, OnSaveopt)
- ON_CBN_SELCHANGE(IDC_COMBOSEL, OnSelchangeCombosel)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions message handlers
-
-
-void COptions::OnSelchangeCombosel()
-{
- HideAll();
- switch (m_Selection.GetCurSel()) {
- case 0:
- m_general.ShowWindow(SW_SHOW);
- break;
- case 1:
- m_systems.ShowWindow(SW_SHOW);
- break;
- case 2:
- m_decoder.ShowWindow(SW_SHOW);
- break;
- case 3:
- m_render.ShowWindow(SW_SHOW);
- break;
- case 4:
- m_render3D.ShowWindow(SW_SHOW);
- break;
- case 5:
- m_audio.ShowWindow(SW_SHOW);
- break;
- case 6:
- m_font.ShowWindow(SW_SHOW);
- break;
- case 7:
- m_http.ShowWindow(SW_SHOW);
- break;
- case 8:
- m_stream.ShowWindow(SW_SHOW);
- break;
- }
-}
-
-void COptions::HideAll()
-{
- m_general.ShowWindow(SW_HIDE);
- m_systems.ShowWindow(SW_HIDE);
- m_render.ShowWindow(SW_HIDE);
- m_render3D.ShowWindow(SW_HIDE);
- m_audio.ShowWindow(SW_HIDE);
- m_http.ShowWindow(SW_HIDE);
- m_font.ShowWindow(SW_HIDE);
- m_stream.ShowWindow(SW_HIDE);
- m_decoder.ShowWindow(SW_HIDE);
-}
-
-BOOL COptions::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- m_general.Create(IDD_OPT_GEN, this);
- m_systems.Create(IDD_OPT_SYSTEMS, this);
- m_decoder.Create(IDD_OPT_DECODER, this);
- m_render.Create(IDD_OPT_RENDER, this);
- m_render3D.Create(IDD_OPT_RENDER3D, this);
- m_audio.Create(IDD_OPT_AUDIO, this);
- m_http.Create(IDD_OPT_HTTP, this);
- m_font.Create(IDD_OPT_FONT, this);
- m_stream.Create(IDD_OPT_STREAM, this);
-
- m_Selection.AddString(_T("General"));
- m_Selection.AddString(_T("MPEG-4 Systems"));
- m_Selection.AddString(_T("Decoders"));
- m_Selection.AddString(_T("Compositor"));
- m_Selection.AddString(_T("3D Rendering"));
- m_Selection.AddString(_T("Audio"));
- m_Selection.AddString(_T("Text"));
- m_Selection.AddString(_T("Download"));
- m_Selection.AddString(_T("Streaming"));
- HideAll();
-
- const char *sOpt = gf_cfg_get_key(GetApp()->m_user.config, "General", "ConfigPanel");
- u32 sel = sOpt ? atoi(sOpt) : 0;
- if (sel>8) sel=8;
- m_Selection.SetCurSel(sel);
- OnSelchangeCombosel();
-
- SetFocus();
- return TRUE;
-}
-
-void COptions::OnSaveopt()
-{
- m_general.SaveOptions();
- m_systems.SaveOptions();
- m_render.SaveOptions();
- m_render3D.SaveOptions();
- m_audio.SaveOptions();
- m_http.SaveOptions();
- m_font.SaveOptions();
- m_stream.SaveOptions();
- m_decoder.SaveOptions();
-
- COsmo4 *gpac = GetApp();
- gf_term_set_option(gpac->m_term, GF_OPT_RELOAD_CONFIG, 1);
-}
-
-void COptions::OnOK()
-{
- char str[20];
- sprintf(str, "%d", m_Selection.GetCurSel());
- gf_cfg_set_key(GetApp()->m_user.config, "General", "ConfigPanel", str);
-
- EndDialog(IDCANCEL);
-}
-
-
-
-COptAudio::COptAudio(CWnd* pParent /*=NULL*/)
- : CDialog(COptAudio::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptAudio)
- //}}AFX_DATA_INIT
-}
-
-
-void COptAudio::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptAudio)
- DDX_Control(pDX, IDC_DRIVER_LIST, m_DriverList);
- DDX_Control(pDX, IDC_AUDIO_RESYNC, m_AudioResync);
- DDX_Control(pDX, IDC_AUDIO_DUR, m_AudioDur);
- DDX_Control(pDX, IDC_SPIN_DUR, m_SpinDur);
- DDX_Control(pDX, IDC_FORCE_AUDIO, m_ForceConfig);
- DDX_Control(pDX, IDC_SPIN_AUDIO, m_AudioSpin);
- DDX_Control(pDX, IDC_EDIT_AUDIO, m_AudioEdit);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptAudio, CDialog)
- //{{AFX_MSG_MAP(COptAudio)
- ON_BN_CLICKED(IDC_FORCE_AUDIO, OnForceAudio)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptAudio message handlers
-
-BOOL COptAudio::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- m_AudioSpin.SetBuddy(& m_AudioEdit);
- m_SpinDur.SetBuddy(& m_AudioDur);
- m_SpinDur.SetRange(0, 1000);
-
- COsmo4 *gpac = GetApp();
- const char *sOpt;
- TCHAR wTmp[500];
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "ForceConfig");
- m_ForceConfig.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "NumBuffers");
- if (sOpt) {
- CE_CharToWide((char *)sOpt, (u16 *)wTmp);
- m_AudioEdit.SetWindowText(wTmp);
- } else {
- m_AudioEdit.SetWindowText(_T("2"));
- }
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "TotalDuration");
- if (sOpt) {
- CE_CharToWide((char *)sOpt, (u16 *)wTmp);
- m_AudioDur.SetWindowText(wTmp);
- } else {
- m_AudioDur.SetWindowText(_T("200"));
- }
-
- OnForceAudio();
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "NoResync");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_AudioResync.SetCheck(1);
- } else {
- m_AudioResync.SetCheck(0);
- }
-
- /*driver enum*/
- while (m_DriverList.GetCount()) m_DriverList.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "core", "audio-output");
- u32 count = gf_modules_get_count(gpac->m_user.modules);
- GF_BaseInterface *ifce;
- s32 select = 0;
- s32 to_sel = 0;
- for (u32 i=0; i<count; i++) {
- ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_AUDIO_OUTPUT_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
- CE_CharToWide((char *) ((GF_BaseInterface *)ifce)->module_name, (u16 *)wTmp);
- m_DriverList.AddString(wTmp);
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_DriverList.SetCurSel(select);
-
-
- return TRUE;
-}
-
-
-void COptAudio::SaveOptions()
-{
- COsmo4 *gpac = GetApp();
- TCHAR wstr[50];
- char str[50];
-
- gf_cfg_set_key(gpac->m_user.config, "Audio", "ForceConfig", m_ForceConfig.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Audio", "NoResync", m_AudioResync.GetCheck() ? "yes" : "no");
-
- m_AudioEdit.GetWindowText(wstr, 20);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "Audio", "NumBuffers", str);
- m_AudioDur.GetWindowText(wstr, 20);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "Audio", "TotalDuration", str);
-
- m_DriverList.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "core", "audio-output", str);
-
-}
-
-void COptAudio::OnForceAudio()
-{
- BOOL en = m_ForceConfig.GetCheck();
-
- m_AudioSpin.EnableWindow(en);
- m_AudioEdit.EnableWindow(en);
- m_SpinDur.EnableWindow(en);
- m_AudioDur.EnableWindow(en);
-}
-
-
-COptDecoder::COptDecoder(CWnd* pParent /*=NULL*/)
- : CDialog(COptDecoder::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptDecoder)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void COptDecoder::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptDecoder)
- DDX_Control(pDX, IDC_VIDEC_LIST, m_Video);
- DDX_Control(pDX, IDC_AUDEC_LIST, m_Audio);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptDecoder, CDialog)
- //{{AFX_MSG_MAP(COptDecoder)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptDecoder message handlers
-
-BOOL COptDecoder::OnInitDialog()
-{
- u32 i;
- CDialog::OnInitDialog();
-
- COsmo4 *gpac = GetApp();
- const char *sOpt;
-
- /*audio dec enum*/
- while (m_Audio.GetCount()) m_Audio.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "DefAudioDec");
- u32 count = gf_modules_get_count(gpac->m_user.modules);
- GF_BaseDecoder *ifce;
- s32 select = 0;
- s32 to_sel = 0;
- for (i=0; i<count; i++) {
- ifce = (GF_BaseDecoder *) gf_modules_load_interface(gpac->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
- if (!ifce) continue;
- if (ifce->CanHandleStream(ifce, GF_STREAM_AUDIO, NULL, 0)) {
- if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
- TCHAR wzTmp[500];
- CE_CharToWide((char *) ifce->module_name, (u16 *)wzTmp);
- m_Audio.AddString(wzTmp);
- to_sel++;
- }
- gf_modules_close_interface((GF_BaseInterface *) ifce);
- }
- m_Audio.SetCurSel(select);
-
- /*audio dec enum*/
- while (m_Video.GetCount()) m_Video.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "DefVideoDec");
- count = gf_modules_get_count(gpac->m_user.modules);
- select = 0;
- to_sel = 0;
- for (i=0; i<count; i++) {
- ifce = (GF_BaseDecoder *) gf_modules_load_interface(gpac->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
- if (!ifce) continue;
- if (ifce->CanHandleStream(ifce, GF_STREAM_VISUAL, NULL, 0)) {
- if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
- TCHAR wzTmp[500];
- CE_CharToWide((char *) ifce->module_name, (u16 *)wzTmp);
- m_Video.AddString(wzTmp);
- to_sel++;
- }
- gf_modules_close_interface((GF_BaseInterface *) ifce);
- }
- m_Video.SetCurSel(select);
-
- return TRUE;
-}
-
-void COptDecoder::SaveOptions()
-{
- COsmo4 *gpac = GetApp();
- TCHAR wstr[100];
- char str[100];
-
- m_Audio.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "Systems", "DefAudioDec", str);
- m_Video.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "Systems", "DefVideoDec", str);
-}
-
-
-
-COptFont::COptFont(CWnd* pParent /*=NULL*/)
- : CDialog(COptFont::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptFont)
- //}}AFX_DATA_INIT
-}
-
-
-void COptFont::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptFont)
- DDX_Control(pDX, IDC_USE_TEXTURE, m_UseTexture);
- DDX_Control(pDX, IDC_FONT_LIST, m_Fonts);
- DDX_Control(pDX, IDC_BROWSE_FONT, m_BrowseFont);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptFont, CDialog)
- //{{AFX_MSG_MAP(COptFont)
- ON_BN_CLICKED(IDC_BROWSE_FONT, OnBrowseFont)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptFont message handlers
-
-BOOL COptFont::OnInitDialog()
-{
- u32 i;
- GF_BaseInterface *ifce;
-
- CDialog::OnInitDialog();
-
- COsmo4 *gpac = GetApp();
- TCHAR wTmp[500];
- const char *sOpt;
-
- /*video drivers enum*/
- while (m_Fonts.GetCount()) m_Fonts.DeleteString(0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "FontCache", "FontReader");
- s32 to_sel = 0;
- s32 select = 0;
- u32 count = gf_modules_get_count(gpac->m_user.modules);
- for (i=0; i<count; i++) {
- ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_FONT_READER_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
- CE_CharToWide((char *) ifce->module_name, (u16 *)wTmp);
- m_Fonts.AddString(wTmp);
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_Fonts.SetCurSel(select);
-
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "FontCache", "FontDirectory");
- CE_CharToWide((char *)sOpt, (u16 *)wTmp);
- if (sOpt) m_BrowseFont.SetWindowText(wTmp);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "TextureTextMode");
- m_UseTexture.SetCheck( (!sOpt || stricmp(sOpt, "Never")) ? 1 : 0);
-
- return TRUE;
-}
-
-void COptFont::OnBrowseFont()
-{
-
-}
-
-
-void COptFont::SaveOptions()
-{
- COsmo4 *gpac = GetApp();
- char str[MAX_PATH];
- TCHAR wstr[MAX_PATH];
-
- m_Fonts.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "FontCache", "FontReader", str);
- m_BrowseFont.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "FontCache", "FontDirectory", str);
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "TextureTextMode", m_UseTexture.GetCheck() ? "Default" : "Never");
-}
-
-
-
-COptGen::COptGen(CWnd* pParent /*=NULL*/)
- : CDialog(COptGen::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptGen)
- //}}AFX_DATA_INIT
-}
-
-
-void COptGen::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptGen)
- DDX_Control(pDX, IDC_NO_BACKLIGHT, m_NoBacklight);
- DDX_Control(pDX, IDC_FILL_SCREEN, m_Fill);
- DDX_Control(pDX, IDC_LOOP, m_Loop);
- DDX_Control(pDX, IDC_ENABLE_LOGS, m_Logs);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptGen, CDialog)
- //{{AFX_MSG_MAP(COptGen)
- ON_BN_CLICKED(IDC_FILEASSOC, OnFileassoc)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptGen message handlers
-
-
-
-BOOL COptGen::OnInitDialog()
-{
- CDialog::OnInitDialog();
- COsmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "Loop");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_Loop.SetCheck(1);
- } else {
- m_Loop.SetCheck(0);
- }
- sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "FillScreen");
- m_Fill.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "DisableBackLight");
- m_NoBacklight.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "Logs");
- m_Logs.SetCheck((sOpt && !strstr(sOpt, "none")) ? 1 : 0);
- return TRUE;
-}
-
-void COptGen::SaveOptions()
-{
- COsmo4 *gpac = GetApp();
-
- gpac->m_Loop = m_Loop.GetCheck();
- gf_cfg_set_key(gpac->m_user.config, "General", "Loop", gpac->m_Loop ? "yes" : "no");
- gpac->m_fit_screen = m_Fill.GetCheck();
- gf_cfg_set_key(gpac->m_user.config, "General", "FillScreen", gpac->m_fit_screen ? "yes" : "no");
- gpac->m_disable_backlight = m_NoBacklight.GetCheck();
- gf_cfg_set_key(gpac->m_user.config, "General", "DisableBackLight", gpac->m_disable_backlight ? "yes" : "no");
-
- gpac->EnableLogs(m_Logs.GetCheck() ? 1 : 0);
-}
-
-void COptGen::OnFileassoc()
-{
- HKEY hSection;
- TCHAR szDir[MAX_PATH];
- char szTemp[MAX_PATH];
- TCHAR cmd[MAX_PATH];
- DWORD ioSize = MAX_PATH;
- DWORD dwDisp;
-
- RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Osmo4"), 0, KEY_READ, &hSection);
-
- GetModuleFileName(NULL, szDir, MAX_PATH);
-
- while (szDir[strlen((char *) szDir)-1] != (TCHAR) '\\') szDir[strlen((char *) szDir)-1] = 0;
- if (!hSection)
- RegCreateKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Osmo4"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hSection, &dwDisp);
-
- CE_WideToChar((u16 *)szDir, szTemp);
- /*overwrite install dir with current path*/
- RegSetValueEx(hSection, _T("Install_Dir"), 0, REG_SZ, (const unsigned char *) szTemp, strlen(szTemp)+1);
- RegCloseKey(hSection);
-
-
- /*overwrite .mp4 file associations */
- RegCreateKeyEx(HKEY_CLASSES_ROOT, _T("mp4file\\DefaultIcon"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hSection, &dwDisp);
- wcscpy(cmd, szDir);
- wcscat(cmd, _T("Osmo4.ico") );
- CE_WideToChar((u16 *)cmd, szTemp);
-
- RegSetValueEx(hSection, _T(""), 0, REG_SZ, (const unsigned char *) szTemp, strlen((const char *) szTemp)+1);
- RegCloseKey(hSection);
-
- RegCreateKeyEx(HKEY_CLASSES_ROOT, _T("mp4file\\Shell\\open\\command"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hSection, &dwDisp);
- wcscpy(cmd, szDir);
- wcscat(cmd, _T("Osmo4.exe \"%L\"") );
- CE_WideToChar((u16 *)cmd, szTemp);
- RegSetValueEx(hSection, _T(""), 0, REG_SZ, (const unsigned char *) szTemp, strlen(szTemp)+1);
- RegCloseKey(hSection);
-
- RegCreateKeyEx(HKEY_CLASSES_ROOT, _T(".mp4"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hSection, &dwDisp);
- RegSetValueEx(hSection, _T(""), 0, REG_SZ, (const unsigned char *) "mp4file", strlen("mp4file")+1);
- RegCloseKey(hSection);
-}
-
-
-
-COptHTTP::COptHTTP(CWnd* pParent /*=NULL*/)
- : CDialog(COptHTTP::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptHTTP)
- //}}AFX_DATA_INIT
-}
-
-
-void COptHTTP::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptHTTP)
- DDX_Control(pDX, IDC_RESTART_CACHE, m_RestartFile);
- DDX_Control(pDX, IDC_CLEAN_CACHE, m_CleanCache);
- DDX_Control(pDX, IDC_BROWSE_CACHE, m_CacheDir);
- DDX_Control(pDX, IDC_SAX_PROGRESSIVE, m_Progressive);
- DDX_Control(pDX, IDC_SAX_DURATION, m_SaxDuration);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptHTTP, CDialog)
- //{{AFX_MSG_MAP(COptHTTP)
- ON_BN_CLICKED(IDC_BROWSE_CACHE, OnBrowseCache)
- ON_BN_CLICKED(IDC_SAX_PROGRESSIVE, OnProgressive)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptHTTP message handlers
-
-
-void COptHTTP::OnBrowseCache()
-{
-
-}
-
-BOOL COptHTTP::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- COsmo4 *gpac = GetApp();
- TCHAR wTmp[500];
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "CleanCache");
- m_CleanCache.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "RestartFiles");
- m_RestartFile.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "SAXLoader", "Progressive");
- m_Progressive.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "SAXLoader", "MaxDuration");
- if (sOpt) {
- CE_CharToWide((char *) sOpt, (u16 *)wTmp);
- m_SaxDuration.SetWindowText(wTmp);
- } else {
- m_SaxDuration.SetWindowText( _T("30") );
- }
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Core", "CacheDirectory");
- CE_CharToWide((char *) sOpt, (u16 *)wTmp);
- if (sOpt) m_CacheDir.SetWindowText(wTmp);
-
- OnProgressive();
- return TRUE;
-}
-
-void COptHTTP::OnProgressive()
-{
- m_SaxDuration.EnableWindow( m_Progressive.GetCheck() ? TRUE : FALSE );
-}
-
-void COptHTTP::SaveOptions()
-{
- TCHAR wTmp[500];
- char szCacheDir[500];
- COsmo4 *gpac = GetApp();
-
- gf_cfg_set_key(gpac->m_user.config, "Core", "CleanCache", m_CleanCache.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Core", "RestartFiles", m_RestartFile.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "SAXLoader", "Progressive", m_Progressive.GetCheck() ? "yes" : "no");
-
- m_SaxDuration.GetWindowText(wTmp, MAX_PATH);
- CE_WideToChar((u16 *)wTmp, szCacheDir);
- gf_cfg_set_key(gpac->m_user.config, "SAXLoader", "MaxDuration", szCacheDir);
-
- m_CacheDir.GetWindowText(wTmp, MAX_PATH);
- CE_WideToChar((u16 *)wTmp, szCacheDir);
- gf_cfg_set_key(gpac->m_user.config, "Core", "CacheDirectory", szCacheDir);
-}
-
-
-
-COptRender::COptRender(CWnd* pParent /*=NULL*/)
- : CDialog(COptRender::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptRender)
- //}}AFX_DATA_INIT
-}
-
-
-void COptRender::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptRender)
- DDX_Control(pDX, IDC_AA_LIST, m_Antialias);
- DDX_Control(pDX, IDC_FORCE_SIZE, m_ForceSize);
- DDX_Control(pDX, IDC_FAST_RENDER, m_HighSpeed);
- DDX_Control(pDX, IDC_ZOOM_SCALABLE, m_Scalable);
- DDX_Control(pDX, IDC_DIRECTRENDER, m_DirectRender);
- DDX_Control(pDX, IDC_BIFS_RATE, m_BIFSRate);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender, CDialog)
- //{{AFX_MSG_MAP(COptRender)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptRender message handlers
-
-
-
-#define NUM_RATES 11
-static char *BIFSRates[11] =
-{
- "5.0",
- "7.5",
- "10.0",
- "12.5",
- "15.0",
- "24.0",
- "25.0",
- "30.0",
- "50.0",
- "60.0",
- "100.0",
-};
-
-
-
-BOOL COptRender::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- COsmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DirectDraw");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_DirectRender.SetCheck(1);
- } else {
- m_DirectRender.SetCheck(0);
- }
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ScalableZoom");
- if (sOpt && !stricmp(sOpt, "no")) {
- m_Scalable.SetCheck(0);
- } else {
- m_Scalable.SetCheck(1);
- }
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ForceSceneSize");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_ForceSize.SetCheck(1);
- } else {
- m_ForceSize.SetCheck(0);
- }
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "FrameRate");
- if (!sOpt) sOpt = "30.0";
- s32 select = 0;
- while (m_BIFSRate.GetCount()) m_BIFSRate.DeleteString(0);
- for (s32 i = 0; i<NUM_RATES; i++) {
- TCHAR szText[100];
- CE_CharToWide(BIFSRates[i], (u16 *)szText);
- m_BIFSRate.AddString(szText);
- if (sOpt && !stricmp(sOpt, BIFSRates[i]) ) select = i;
- }
- m_BIFSRate.SetCurSel(select);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "HighSpeed");
- m_HighSpeed.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "AntiAlias");
- while (m_Antialias.GetCount()) m_Antialias.DeleteString(0);
-
- m_Antialias.AddString(_T("None"));
- m_Antialias.AddString(_T("Text only"));
- m_Antialias.AddString(_T("Complete"));
- select = 2;
- if (sOpt && !stricmp(sOpt, "Text")) select = 1;
- else if (sOpt && !stricmp(sOpt, "None")) select = 0;
- m_Antialias.SetCurSel(select);
-
- return TRUE;
-}
-
-
-void COptRender::SaveOptions()
-{
- COsmo4 *gpac = GetApp();
-
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "DirectDraw", m_DirectRender.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "ScalableZoom", m_Scalable.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "HighSpeed", m_HighSpeed.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "ForceSceneSize", m_ForceSize.GetCheck() ? "yes" : "no");
-
- s32 sel = m_BIFSRate.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "FrameRate", BIFSRates[sel]);
-
- sel = m_Antialias.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "AntiAlias", (sel==0) ? "None" : ( (sel==1) ? "Text" : "All"));
-}
-
-
-
-
-COptRender3D::COptRender3D(CWnd* pParent /*=NULL*/)
- : CDialog(COptRender3D::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptRender)
- //}}AFX_DATA_INIT
-}
-
-
-void COptRender3D::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptRender)
- DDX_Control(pDX, IDC_WIRE_MODE, m_WireMode);
- DDX_Control(pDX, IDC_DRAW_NORMALS, m_DrawNormals);
- DDX_Control(pDX, IDC_USE_3D_REN, m_Use3DRender);
- DDX_Control(pDX, IDC_NO_BACKCULL, m_NoBackFace);
- DDX_Control(pDX, IDC_EMULATE_POW2, m_EmulatePOW2);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender3D, CDialog)
- //{{AFX_MSG_MAP(COptRender3D)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-BOOL COptRender3D::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- COsmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ForceOpenGL");
- m_Use3DRender.SetCheck( (sOpt && !strcmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "BackFaceCulling");
- m_NoBackFace.SetCheck( (sOpt && !stricmp(sOpt, "Off")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "EmulatePOW2");
- m_EmulatePOW2.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- m_WireMode.ResetContent();
- m_WireMode.AddString(_T("Solid Draw"));
- m_WireMode.AddString(_T("Wireframe"));
- m_WireMode.AddString(_T("Both"));
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "Wireframe");
- if (sOpt && !stricmp(sOpt, "WireOnly")) m_WireMode.SetCurSel(1);
- else if (sOpt && !stricmp(sOpt, "WireOnSolid")) m_WireMode.SetCurSel(2);
- else m_WireMode.SetCurSel(0);
-
-
- m_DrawNormals.ResetContent();
- m_DrawNormals.AddString(_T("Never"));
- m_DrawNormals.AddString(_T("Per Face"));
- m_DrawNormals.AddString(_T("Per Vertex"));
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DrawNormals");
- if (sOpt && !stricmp(sOpt, "PerFace")) m_DrawNormals.SetCurSel(1);
- else if (sOpt && !stricmp(sOpt, "PerVertex")) m_DrawNormals.SetCurSel(2);
- else m_DrawNormals.SetCurSel(0);
-
- return TRUE;
-}
-
-
-void COptRender3D::SaveOptions()
-{
- COsmo4 *gpac = GetApp();
-
- u32 sel = m_DrawNormals.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "DrawNormals", (sel==2) ? "PerVertex" : (sel==1) ? "PerFace" : "Never");
-
- sel = m_WireMode.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "Wireframe", (sel==2) ? "WireOnSolid" : (sel==1) ? "WireOnly" : "WireNone");
-
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "BackFaceCulling", m_NoBackFace.GetCheck() ? "Off" : "On");
- gf_cfg_set_key(gpac->m_user.config, "Compositor", "EmulatePOW2", m_EmulatePOW2.GetCheck() ? "yes" : "no");
-}
-
-
-COptStream::COptStream(CWnd* pParent /*=NULL*/)
- : CDialog(COptStream::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptStream)
- //}}AFX_DATA_INIT
-}
-
-
-void COptStream::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptStream)
- DDX_Control(pDX, IDC_REBUFFER_LEN, m_RebufferLen);
- DDX_Control(pDX, IDC_REBUFFER, m_Rebuffer);
- DDX_Control(pDX, IDC_BUFFER, m_Buffer);
- DDX_Control(pDX, IDC_TIMEOUT, m_Timeout);
- DDX_Control(pDX, IDC_REORDER, m_Reorder);
- DDX_Control(pDX, IDC_RTSP, m_UseRTSP);
- DDX_Control(pDX, IDC_PORT, m_Port);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptStream, CDialog)
- //{{AFX_MSG_MAP(COptStream)
- ON_CBN_SELCHANGE(IDC_PORT, OnSelchangePort)
- ON_BN_CLICKED(IDC_RTSP, OnRtsp)
- ON_BN_CLICKED(IDC_REBUFFER, OnRebuffer)
- ON_EN_UPDATE(IDC_REBUFFER_LEN, OnUpdateRebufferLen)
- ON_EN_UPDATE(IDC_BUFFER, OnUpdateBuffer)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptStream message handlers
-
-BOOL COptStream::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- COsmo4 *gpac = GetApp();
- TCHAR wTmp[500];
- const char *sOpt;
-
- while (m_Port.GetCount()) m_Port.DeleteString(0);
- m_Port.AddString(_T("554 (RTSP standard)"));
- m_Port.AddString(_T("7070 (RTSP ext)"));
- m_Port.AddString(_T("80 (RTSP / HTTP tunnel)"));
- m_Port.AddString(_T("8080 (RTSP / HTTP tunnel)"));
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "DefaultPort");
- u32 port = 554;
- Bool force_rtsp = 0;;
- if (sOpt) port = atoi(sOpt);
- switch (port) {
- case 8080:
- m_Port.SetCurSel(3);
- force_rtsp = 1;
- break;
- case 80:
- m_Port.SetCurSel(2);
- force_rtsp = 1;
- break;
- case 7070:
- m_Port.SetCurSel(1);
- break;
- default:
- m_Port.SetCurSel(0);
- break;
- }
-
- Bool use_rtsp = 0;
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "RTPoverRTSP");
- if (sOpt && !stricmp(sOpt, "yes")) use_rtsp = 1;
-
- if (force_rtsp) {
- m_UseRTSP.SetCheck(1);
- m_UseRTSP.EnableWindow(0);
- m_Reorder.SetCheck(0);
- m_Reorder.EnableWindow(0);
- } else {
- m_UseRTSP.SetCheck(use_rtsp);
- m_UseRTSP.EnableWindow(1);
- m_Reorder.EnableWindow(1);
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "ReorderSize");
- if (sOpt && !stricmp(sOpt, "0")) {
- m_Reorder.SetCheck(0);
- } else {
- m_Reorder.SetCheck(1);
- }
- }
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "RTSPTimeout");
- if (sOpt) {
- CE_CharToWide((char *) sOpt, (u16 *)wTmp);
- m_Timeout.SetWindowText(wTmp);
- } else {
- m_Timeout.SetWindowText(_T("30000"));
- }
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Network", "BufferLength");
- if (sOpt) {
- CE_CharToWide((char *) sOpt, (u16 *)wTmp);
- m_Buffer.SetWindowText(wTmp);
- } else {
- m_Buffer.SetWindowText(_T("3000"));
- }
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Network", "RebufferLength");
- u32 buf_len = 0;
- if (sOpt) buf_len = atoi(sOpt);
- if (buf_len) {
- CE_CharToWide((char *) sOpt, (u16 *)wTmp);
- m_RebufferLen.SetWindowText(wTmp);
- m_Rebuffer.SetCheck(1);
- m_RebufferLen.EnableWindow(1);
- } else {
- m_RebufferLen.SetWindowText(_T("0"));
- m_Rebuffer.SetCheck(0);
- m_RebufferLen.EnableWindow(0);
- }
-
- return TRUE;
-}
-
-
-void COptStream::OnSelchangePort()
-{
- s32 sel = m_Port.GetCurSel();
- switch (sel) {
- case 3:
- case 2:
- m_UseRTSP.SetCheck(1);
- m_UseRTSP.EnableWindow(0);
- m_Reorder.SetCheck(0);
- m_Reorder.EnableWindow(0);
- break;
- case 1:
- default:
- m_UseRTSP.SetCheck(0);
- m_UseRTSP.EnableWindow(1);
- m_Reorder.SetCheck(1);
- m_Reorder.EnableWindow(1);
- break;
- }
-}
-
-void COptStream::OnRtsp()
-{
- if (m_UseRTSP.GetCheck()) {
- m_Reorder.SetCheck(0);
- m_Reorder.EnableWindow(0);
- } else {
- m_Reorder.SetCheck(1);
- m_Reorder.EnableWindow(1);
- }
-
-}
-
-void COptStream::CheckRebuffer()
-{
- TCHAR wstr[50];
- char str[50];
- s32 buf, rebuf;
- m_Buffer.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- buf = atoi(str);
- m_RebufferLen.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- rebuf = atoi(str);
- if (rebuf*2 > buf) {
- rebuf = buf/2;
- wsprintf(wstr, _T("%d"), rebuf);
- m_RebufferLen.SetWindowText(wstr);
- }
-}
-
-void COptStream::OnRebuffer()
-{
- if (!m_Rebuffer.GetCheck()) {
- m_RebufferLen.EnableWindow(0);
- } else {
- m_RebufferLen.EnableWindow(1);
- CheckRebuffer();
- }
-}
-
-void COptStream::OnUpdateRebufferLen()
-{
- CheckRebuffer();
-}
-
-void COptStream::OnUpdateBuffer()
-{
- CheckRebuffer();
-}
-
-void COptStream::SaveOptions()
-{
- COsmo4 *gpac = GetApp();
- Bool force_rtsp = 0;
- s32 sel = m_Port.GetCurSel();
- switch (sel) {
- case 3:
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "8080");
- force_rtsp = 1;
- break;
- case 2:
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "80");
- force_rtsp = 1;
- break;
- case 1:
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "7070");
- break;
- default:
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "554");
- break;
- }
-
- if (force_rtsp) {
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTPoverRTSP", "yes");
- } else {
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTPoverRTSP", m_UseRTSP.GetCheck() ? "yes" : "no");
- if (!m_UseRTSP.GetCheck()) gf_cfg_set_key(gpac->m_user.config, "Streaming", "ReorderSize", m_Reorder.GetCheck() ? "30" : "0");
- }
-
- TCHAR wstr[50];
- char str[50];
-
- m_Timeout.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTSPTimeout", str);
-
- m_Buffer.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "Network", "BufferLength", str);
- if (m_Rebuffer.GetCheck()) {
- m_RebufferLen.GetWindowText(wstr, 50);
- CE_WideToChar((u16 *)wstr, str);
- gf_cfg_set_key(gpac->m_user.config, "Network", "RebufferLength", str);
- } else {
- gf_cfg_set_key(gpac->m_user.config, "Network", "RebufferLength", "0");
- }
-}
-
-
-
-COptSystems::COptSystems(CWnd* pParent /*=NULL*/)
- : CDialog(COptSystems::IDD, pParent)
-{
- //{{AFX_DATA_INIT(COptSystems)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-}
-
-
-void COptSystems::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(COptSystems)
- DDX_Control(pDX, IDC_FORCE_DURATION, m_ForceDuration);
- DDX_Control(pDX, IDC_DEC_THREAD, m_Threading);
- DDX_Control(pDX, IDC_BIFSDROP, m_BifsAlwaysDrawn);
- DDX_Control(pDX, IDC_LANG, m_Lang);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptSystems, CDialog)
- //{{AFX_MSG_MAP(COptSystems)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptSystems message handlers
-
-
-
-BOOL COptSystems::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- COsmo4 *gpac = GetApp();
- const char *sOpt;
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "Language3CC");
- if (!sOpt) sOpt = "eng";
- s32 select = 0;
- while (m_Lang.GetCount()) m_Lang.DeleteString(0);
- s32 idx = gf_lang_find(sOpt);
- u32 i, count = gf_lang_get_count();
- for (i=0; i<count; i++) {
- TCHAR szTmp[100];
- CE_CharToWide( (char *)gf_lang_get_name(i), (u16 *)szTmp);
- m_Lang.AddString(szTmp);
- if (idx>=0 && (i==idx))
- select = i;
- }
- m_Lang.SetCurSel(select);
-
-
- /*system config*/
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "ThreadingPolicy");
- select = 0;
- while (m_Threading.GetCount()) m_Threading.DeleteString(0);
- m_Threading.AddString(_T("Single Thread"));
- m_Threading.AddString(_T("Mutli Thread"));
- if (sOpt && !stricmp(sOpt, "Multi")) select = 1;
- m_Threading.AddString(_T("Free"));
- if (sOpt && !stricmp(sOpt, "Free")) select = 2;
- m_Threading.SetCurSel(select);
-
-
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "ForceSingleClock");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_ForceDuration.SetCheck(1);
- } else {
- m_ForceDuration.SetCheck(0);
- }
- sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "AlwaysDrawBIFS");
- if (sOpt && !stricmp(sOpt, "yes")) {
- m_BifsAlwaysDrawn.SetCheck(1);
- } else {
- m_BifsAlwaysDrawn.SetCheck(0);
- }
-
-
- return TRUE;
-}
-
-
-void COptSystems::SaveOptions()
-{
- COsmo4 *gpac = GetApp();
-
- s32 sel = m_Lang.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Systems", "LanguageName", gf_lang_get_name(sel) );
- gf_cfg_set_key(gpac->m_user.config, "Systems", "Language3CC", gf_lang_get_3cc(sel) );
- gf_cfg_set_key(gpac->m_user.config, "Systems", "Language2CC", gf_lang_get_2cc(sel) );
-
- sel = m_Threading.GetCurSel();
- gf_cfg_set_key(gpac->m_user.config, "Systems", "ThreadingPolicy", (sel==0) ? "Single" : ( (sel==1) ? "Multi" : "Free"));
-
- /*reset duration flag*/
- gpac->m_duration = (u32) -1;
- gf_cfg_set_key(gpac->m_user.config, "Systems", "ForceSingleClock", m_ForceDuration.GetCheck() ? "yes" : "no");
- gf_cfg_set_key(gpac->m_user.config, "Systems", "AlwaysDrawBIFS", m_BifsAlwaysDrawn.GetCheck() ? "yes" : "no");
-
-}
-
+++ /dev/null
-#if !defined(AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_)
-#define AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// Options.h : header file
-//
-
-
-class COptSystems : public CDialog
-{
-// Construction
-public:
- COptSystems(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptSystems)
- enum { IDD = IDD_OPT_SYSTEMS };
- CButton m_ForceDuration;
- CComboBox m_Threading;
- CButton m_BifsAlwaysDrawn;
- CComboBox m_Lang;
- //}}AFX_DATA
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptSystems)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptSystems)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class COptStream : public CDialog
-{
-// Construction
-public:
- COptStream(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptStream)
- enum { IDD = IDD_OPT_STREAM };
- CEdit m_RebufferLen;
- CButton m_Rebuffer;
- CEdit m_Buffer;
- CEdit m_Timeout;
- CButton m_Reorder;
- CButton m_UseRTSP;
- CComboBox m_Port;
- //}}AFX_DATA
-
-
- void SaveOptions();
-
- void CheckRebuffer();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptStream)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptStream)
- virtual BOOL OnInitDialog();
- afx_msg void OnSelchangePort();
- afx_msg void OnRtsp();
- afx_msg void OnRebuffer();
- afx_msg void OnUpdateRebufferLen();
- afx_msg void OnUpdateBuffer();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-class COptRender : public CDialog
-{
-// Construction
-public:
- COptRender(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptRender)
- enum { IDD = IDD_OPT_RENDER };
- CComboBox m_Antialias;
- CButton m_ForceSize;
- CButton m_HighSpeed;
- CButton m_Scalable;
- CButton m_DirectRender;
- CComboBox m_BIFSRate;
- //}}AFX_DATA
-
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptRender)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptRender)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-class COptHTTP : public CDialog
-{
-// Construction
-public:
- COptHTTP(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptHTTP)
- enum { IDD = IDD_OPT_HTTP };
- CButton m_RestartFile;
- CButton m_Progressive;
- CButton m_CleanCache;
- CButton m_CacheDir;
- CEdit m_SaxDuration;
- //}}AFX_DATA
-
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptHTTP)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptHTTP)
- afx_msg void OnBrowseCache();
- afx_msg void OnProgressive();
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-class COptGen : public CDialog
-{
-// Construction
-public:
- COptGen(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptGen)
- enum { IDD = IDD_OPT_GEN };
- CButton m_NoBacklight;
- CButton m_Fill;
- CButton m_Loop;
- CButton m_Logs;
- //}}AFX_DATA
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptGen)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptGen)
- virtual BOOL OnInitDialog();
- afx_msg void OnFileassoc();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-class COptFont : public CDialog
-{
-// Construction
-public:
- COptFont(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptFont)
- enum { IDD = IDD_OPT_FONT };
- CButton m_UseTexture;
- CComboBox m_Fonts;
- CButton m_BrowseFont;
- //}}AFX_DATA
-
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptFont)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptFont)
- virtual BOOL OnInitDialog();
- afx_msg void OnBrowseFont();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-class COptDecoder : public CDialog
-{
-// Construction
-public:
- COptDecoder(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptDecoder)
- enum { IDD = IDD_OPT_DECODER };
- CComboBox m_Video;
- CComboBox m_Audio;
- //}}AFX_DATA
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptDecoder)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptDecoder)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-class COptAudio : public CDialog
-{
-// Construction
-public:
- COptAudio(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptAudio)
- enum { IDD = IDD_OPT_AUDIO };
- CComboBox m_DriverList;
- CButton m_AudioResync;
- CEdit m_AudioDur;
- CSpinButtonCtrl m_SpinDur;
- CButton m_ForceConfig;
- CSpinButtonCtrl m_AudioSpin;
- CEdit m_AudioEdit;
- //}}AFX_DATA
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptAudio)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptAudio)
- virtual BOOL OnInitDialog();
- afx_msg void OnForceAudio();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-
-class COptRender3D : public CDialog
-{
-// Construction
-public:
- COptRender3D(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptRender)
- enum { IDD = IDD_OPT_RENDER3D };
- CComboBox m_WireMode;
- CComboBox m_DrawNormals;
- CButton m_Use3DRender;
- CButton m_NoBackFace;
- CButton m_EmulatePOW2;
- //}}AFX_DATA
-
- void SaveOptions();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptRender)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(COptRender)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions dialog
-
-class COptions : public CDialog
-{
-// Construction
-public:
- COptions(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(COptions)
- enum { IDD = IDD_OPTIONS };
- CComboBox m_Selection;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COptions)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- COptGen m_general;
- COptSystems m_systems;
- COptRender m_render;
- COptRender3D m_render3D;
- COptAudio m_audio;
- COptHTTP m_http;
- COptFont m_font;
- COptStream m_stream;
- COptDecoder m_decoder;
-
-
- void HideAll();
-
- // Generated message map functions
- //{{AFX_MSG(COptions)
- virtual BOOL OnInitDialog();
- virtual void OnOK();
- afx_msg void OnSaveopt();
- afx_msg void OnSelchangeCombosel();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_)
+++ /dev/null
-// Osmo4.cpp : Defines the class behaviors for the application.
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-
-#include <gpac/options.h>
-#include <gpac/modules/service.h>
-#include "MainFrm.h"
-#include "OpenDlg.h"
-#include "Options.h"
-#include <gx.h>
-
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4
-
-BEGIN_MESSAGE_MAP(COsmo4, CWinApp)
- //{{AFX_MSG_MAP(COsmo4)
- ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
- ON_COMMAND(IDD_CONFIGURE, OnConfigure)
- ON_COMMAND(ID_OPEN_FILE, OnOpenFile)
- ON_COMMAND(ID_OPEN_URL, OnOpenUrl)
- ON_COMMAND(ID_SHORTCUTS, OnShortcuts)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-
-
-
-
-Bool Osmo4CE_EventProc(void *priv, GF_Event *event)
-{
- u32 dur;
- COsmo4 *app = (COsmo4 *) priv;
- CMainFrame *pFrame = (CMainFrame *) app->m_pMainWnd;
- /*shutdown*/
- if (!pFrame) return 0;
-
- switch (event->type) {
- case GF_EVENT_MESSAGE:
- if (event->message.error!=GF_OK) {
- if (event->message.error<GF_OK) {
- pFrame->console_err = event->message.error;
- pFrame->console_message = event->message.message;
- pFrame->PostMessage(WM_CONSOLEMSG, 0, 0);
- }
- return 0;
- }
- if (1) return 0;
- /*process user message*/
- pFrame->console_err = GF_OK;
- pFrame->console_message = event->message.message;
- pFrame->PostMessage(WM_CONSOLEMSG, 0, 0);
- break;
- case GF_EVENT_SIZE:
- break;
- case GF_EVENT_SCENE_SIZE:
- app->m_scene_width = event->size.width;
- app->m_scene_height = event->size.height;
- if (!pFrame->m_full_screen)
- pFrame->PostMessage(WM_SETSIZE, event->size.width, event->size.height);
- break;
- case GF_EVENT_CONNECT:
- app->m_open = event->connect.is_connected;
- break;
- case GF_EVENT_DURATION:
- dur = (u32) (1000 * event->duration.duration);
- if (dur<2000) dur = 0;
- app->m_duration = dur;
- app->m_can_seek = event->duration.can_seek && dur;
- pFrame->m_progBar.m_range_invalidated = 1;
- /*by default, don't display timing if not seekable and vice-versa*/
- if (app->m_can_seek != pFrame->m_view_timing) {
- pFrame->m_view_timing = app->m_can_seek;
- if (!pFrame->m_full_screen)
- pFrame->PostMessage(WM_SETSIZE, 0, 0);
- }
- break;
- case GF_EVENT_NAVIGATE:
- /*store URL since it may be destroyed, and post message*/
- app->m_navigate_url = event->navigate.to_url;
- pFrame->PostMessage(WM_NAVIGATE, NULL, NULL);
- return 1;
- case GF_EVENT_QUIT:
- pFrame->PostMessage(WM_CLOSE, 0L, 0L);
- break;
- /*ipaq keys*/
- case GF_EVENT_KEYDOWN:
- switch (event->key.key_code) {
- case GF_KEY_F1:
- pFrame->PostMessage(WM_COMMAND, ID_FILE_OPEN);
- break;
- case GF_KEY_F2:
- pFrame->PostMessage(WM_QUIT);
- break;
- case GF_KEY_F3:
- pFrame->PostMessage(WM_COMMAND, ID_FILE_RESTART);
- break;
- case GF_KEY_F5:
- pFrame->PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);
- break;
- case GF_KEY_ENTER:
- pFrame->PostMessage(WM_COMMAND, ID_FILE_PAUSE);
- break;
- case GF_KEY_LEFT:
- if (app->m_duration>=2000) {
- s32 res = gf_term_get_time_in_ms(app->m_term) - 5*app->m_duration/100;
- if (res<0) res=0;
- gf_term_play_from_time(app->m_term, res, 0);
- }
- break;
- case GF_KEY_RIGHT:
- if (app->m_duration>=2000) {
- u32 res = gf_term_get_time_in_ms(app->m_term) + 5*app->m_duration/100;
- if (res>=app->m_duration) res = 0;
- gf_term_play_from_time(app->m_term, res, 0);
- }
- break;
- case GF_KEY_UP:
- if (app->m_duration>=2000) pFrame->PostMessage(WM_COMMAND, ID_FILE_STEP);
- break;
- case GF_KEY_DOWN:
- gf_term_set_option(app->m_term, GF_OPT_REFRESH, 0);
- break;
- }
- break;
- case GF_EVENT_DBLCLICK:
- pFrame->PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);
- return 0;
- }
-
- return 0;
-}
-
-COsmo4::COsmo4()
- : CWinApp()
-{
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
- m_logs = NULL;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only COsmo4 object
-
-COsmo4 theApp;
-
-static void osmo4_do_log(void *cbk, GF_LOG_Level level, GF_LOG_Tool tool, const char *fmt, va_list list)
-{
- FILE *logs = (FILE *) cbk;
- if (logs) {
- vfprintf(logs, fmt, list);
- fflush(logs);
- }
-}
-
-void COsmo4::EnableLogs(Bool turn_on)
-{
- if (turn_on) {
- const char *filename = gf_cfg_get_key(m_user.config, "General", "LogFile");
- if (!filename) {
- gf_cfg_set_key(m_user.config, "General", "LogFile", "\\gpac_logs.txt");
- filename = "\\gpac_logs.txt";
- }
- m_logs = gf_fopen(filename, "wt");
- if (!m_logs) {
- MessageBox(NULL, _T("Couldn't open log file on file system"), _T("Disabling logs"), MB_OK);
- turn_on = 0;
- } else {
- gf_log_set_tools_levels("network:rtp:sync:codec:media@debug");
- gf_log_set_callback(m_logs, osmo4_do_log);
- gf_cfg_set_key(m_user.config, "General", "Logs", "network:rtp:sync:codec:media@debug");
- }
- }
- if (!turn_on) {
- if (m_logs) {
- gf_fclose(m_logs);
- m_logs = 0;
- }
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_NONE);
- gf_log_set_callback(NULL, NULL);
- gf_cfg_set_key(m_user.config, "General", "Logs", "all@quiet");
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4 initialization
-
-BOOL COsmo4::InitInstance()
-{
- Bool first_load = 0;
- if (!AfxSocketInit())
- {
- AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
- return FALSE;
- }
-
- gf_sys_init(GF_MemTrackerNone);
-
- SetRegistryKey(_T("GPAC"));
-
- m_prev_batt_bl = m_prev_ac_bl = 0;
-
- m_screen_width = GetSystemMetrics(SM_CXSCREEN);
- m_screen_height = GetSystemMetrics(SM_CYSCREEN);
- m_menu_height = GetSystemMetrics(SM_CYMENU);
- m_scene_width = m_scene_height = 0;
-
- CMainFrame* pFrame = new CMainFrame;
- m_pMainWnd = pFrame;
-
- pFrame->LoadFrame(IDR_MAINFRAME, WS_VISIBLE, NULL, NULL);
-
- pFrame->ShowWindow(m_nCmdShow);
- pFrame->UpdateWindow();
-
- TCHAR w_config_path[MAX_PATH];
- char config_path[MAX_PATH];
- GetModuleFileName(NULL, w_config_path, MAX_PATH);
- CE_WideToChar((u16 *) w_config_path, (char *) config_path);
-
- while (config_path[strlen((char *) config_path)-1] != '\\') config_path[strlen((char *) config_path)-1] = 0;
-
- /*setup user*/
- memset(&m_user, 0, sizeof(GF_User));
-
- /*init config and plugins*/
- m_user.config = gf_cfg_init(NULL, &first_load);
- if (!m_user.config) {
- MessageBox(NULL, _T("GPAC Configuration file not found"), _T("Fatal Error"), MB_OK);
- m_pMainWnd->PostMessage(WM_CLOSE);
- }
-
- const char *str = gf_cfg_get_key(m_user.config, "General", "Logs");
- EnableLogs((str && strcmp(str, "all@quiet") ) ? 1 : 0);
-
- if (first_load) {
- /*first launch, register all files ext*/
- u32 i;
- for (i=0; i<gf_modules_get_count(m_user.modules); i++) {
- GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(m_user.modules, i, GF_NET_CLIENT_INTERFACE);
- if (!ifce) continue;
- if (ifce) {
- ifce->CanHandleURL(ifce, "test.test");
- gf_modules_close_interface((GF_BaseInterface *)ifce);
- }
- }
- ::MessageBox(NULL, _T("Osmo4/GPAC Setup complete"), _T("Initial launch"), MB_OK);
- }
-
-
- str = gf_cfg_get_key(m_user.config, "Core", "ModulesDirectory");
- m_user.modules = gf_modules_new(str, m_user.config);
- if (!m_user.modules || ! gf_modules_get_count(m_user.modules) ) {
- MessageBox(NULL, _T("No plugins available - system cannot work"), _T("Fatal Error"), MB_OK);
- m_pMainWnd->PostMessage(WM_QUIT);
- return FALSE;
- }
-
- m_user.config = m_user.config;
- m_user.modules = m_user.modules;
- m_user.EventProc = Osmo4CE_EventProc;
- m_user.opaque = this;
- m_user.os_window_handler = pFrame->m_wndView.m_hWnd;
-
-
- m_term = gf_term_new(&m_user);
- if (! m_term) {
- MessageBox(NULL, _T("Cannot load MPEG-4 Terminal"), _T("Fatal Error"), MB_OK);
- m_pMainWnd->PostMessage(WM_QUIT);
- }
-
- m_stopped = 0;
- m_open = 0;
- m_can_seek = 0;
- m_DoResume = 0;
- SetOptions();
- pFrame->SendMessage(WM_SETSIZE, 0, 0);
- ShowTaskBar(0);
-
- CCommandLineInfo cmdInfo;
- ParseCommandLine(cmdInfo);
-
- if (! cmdInfo.m_strFileName.IsEmpty()) {
- m_filename = cmdInfo.m_strFileName;
- m_pMainWnd->PostMessage(WM_OPENURL);
- } else {
- str = gf_cfg_get_key(m_user.config, "General", "StartupFile");
- if (str) gf_term_connect(m_term, str);
- }
- return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4 message handlers
-
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDlg dialog used for App About
-
-class CAboutDlg : public CDialog
-{
-public:
- CAboutDlg();
-
-// Dialog Data
- //{{AFX_DATA(CAboutDlg)
- enum { IDD = IDD_ABOUTBOX };
- CStatic m_AbtTxt;
- //}}AFX_DATA
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CAboutDlg)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
- //{{AFX_MSG(CAboutDlg)
- virtual BOOL OnInitDialog(); // Added for WCE apps
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
-{
- //{{AFX_DATA_INIT(CAboutDlg)
- //}}AFX_DATA_INIT
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAboutDlg)
- DDX_Control(pDX, IDC_ABT_TEXT, m_AbtTxt);
- //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- //{{AFX_MSG_MAP(CAboutDlg)
- // No message handlers
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4 commands
-// Added for WCE apps
-
-BOOL CAboutDlg::OnInitDialog()
-{
- CDialog::OnInitDialog();
- CString str = _T("Osmo4 Player\nGPAC V");
- str += _T(GPAC_VERSION);
- str += _T(" (build");
- str += _T(GPAC_BUILD_NUMBER);
- str += _T(")");
- m_AbtTxt.SetWindowText(str);
- return TRUE;
-}
-
-
-
-void COsmo4::OnAppAbout()
-{
- CAboutDlg aboutDlg;
- ShowTaskBar(1);
- aboutDlg.DoModal();
- ShowTaskBar(0);
-}
-
-
-int COsmo4::ExitInstance()
-{
- gf_term_del(m_term);
- gf_modules_del(m_user.modules);
- gf_cfg_del(m_user.config);
- ShowTaskBar(1);
- gf_sys_close();
- if (m_logs) gf_fclose(m_logs);
- return CWinApp::ExitInstance();
-}
-
-void COsmo4::SetOptions()
-{
- const char *sOpt = gf_cfg_get_key(m_user.config, "General", "Loop");
- m_Loop = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
- sOpt = gf_cfg_get_key(m_user.config, "General", "FillScreen");
- m_fit_screen = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
- sOpt = gf_cfg_get_key(m_user.config, "General", "DisableBackLight");
- m_disable_backlight = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
- gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
- sOpt = gf_cfg_get_key(m_user.config, "General", "NoMIMETypeFetch");
- m_no_mime_fetch = (!sOpt || !stricmp(sOpt, "yes")) ? 1 : 0;
-
- //gf_term_set_option(m_term, GF_OPT_AUDIO_VOLUME, 100);
-}
-
-void COsmo4::Pause()
-{
- if (!m_open) return;
-
- if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
- SetBacklightState(0);
- } else {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
- SetBacklightState(1);
- }
- ((CMainFrame*)m_pMainWnd)->SetPauseButton();
-}
-
-
-void COsmo4::OnConfigure()
-{
- COptions dlg;
-
- ShowTaskBar(1);
- dlg.DoModal();
- ShowTaskBar(0);
-}
-
-void COsmo4::ShowTaskBar(Bool showIt, Bool pause_only)
-{
- if (showIt) {
- m_DoResume = 0;
- if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
- m_DoResume = 1;
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
- }
- gf_term_set_option(m_term, GF_OPT_FREEZE_DISPLAY, 1);
- if (!pause_only) {
- SHFullScreen(GetForegroundWindow(), SHFS_HIDESTARTICON | SHFS_SHOWTASKBAR| SHFS_SHOWSIPBUTTON);
- ::ShowWindow(::FindWindow(_T("HHTaskbar"),NULL), SW_SHOWNA);
- }
- SetBacklightState(0);
- } else {
- if (!pause_only) {
- SHFullScreen(GetForegroundWindow(), SHFS_HIDESTARTICON | SHFS_HIDETASKBAR| SHFS_HIDESIPBUTTON);
- ::ShowWindow(::FindWindow(_T("HHTaskbar"),NULL), SW_HIDE);
- }
- gf_term_set_option(m_term, GF_OPT_FREEZE_DISPLAY, 0);
- gf_term_set_option(m_term, GF_OPT_REFRESH, 0);
- if (m_DoResume) {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
- SetBacklightState(1);
- m_DoResume = 0;
- }
- m_pMainWnd->SetFocus();
- }
-}
-
-
-CString COsmo4::GetFileFilter()
-{
- u32 keyCount, i;
- CString sFiles;
- CString sExts;
- CString supportedFiles;
-
- return CString("All Files |*.*|");
-
- supportedFiles = "All Known Files|*.m3u;*.pls";
-
- sExts = "";
- sFiles = "";
- keyCount = gf_cfg_get_key_count(m_user.config, "MimeTypes");
- for (i=0; i<keyCount; i++) {
- const char *sMime;
- Bool first;
- char *sKey;
- char szKeyList[1000], sDesc[1000];
- short swKeyList[1000], swDesc[1000];
- sMime = gf_cfg_get_key_name(m_user.config, "MimeTypes", i);
- if (!sMime) continue;
- CString sOpt;
- const char *opt = gf_cfg_get_key(m_user.config, "MimeTypes", sMime);
- /*remove #include <gpac/options.h>
- name*/
- strcpy(szKeyList, opt+1);
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- sKey[0] = 0;
- /*get description*/
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- strcpy(sDesc, sKey+1);
- sKey[0] = 0;
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- sKey[0] = 0;
-
- CE_CharToWide(sDesc, (unsigned short *)swDesc);
- CE_CharToWide(szKeyList, (unsigned short *)swKeyList);
-
- /*if same description for # mime types skip (means an old mime syntax)*/
- if (sFiles.Find((LPCTSTR) swDesc)>=0) continue;
- /*if same extensions for # mime types skip (don't polluate the file list)*/
- if (sExts.Find((LPCTSTR) swKeyList)>=0) continue;
-
- sExts += (LPCTSTR) swKeyList;
- sExts += " ";
- sFiles += (LPCTSTR) swDesc;
- sFiles += "|";
-
- first = 1;
-
- sOpt = CString(szKeyList);
- while (1) {
-
- int pos = sOpt.Find(' ');
- CString ext = (pos==-1) ? sOpt : sOpt.Left(pos);
- /*WATCHOUT: we do have some "double" ext , eg .wrl.gz - these are NOT supported by windows*/
- if (ext.Find(_T("."))<0) {
- if (!first) {
- sFiles += ";";
- } else {
- first = 0;
- }
- sFiles += "*.";
- sFiles += ext;
-
- CString sext = ext;
- sext += ";";
- if (supportedFiles.Find(sext)<0) {
- supportedFiles += ";*.";
- supportedFiles += ext;
- }
- }
-
- if (sOpt==ext) break;
- CString rem;
- rem.Format(_T("%s "), (LPCTSTR) ext);
- sOpt.Replace((LPCTSTR) rem, _T(""));
- }
- sFiles += "|";
- }
- supportedFiles += "|";
- supportedFiles += sFiles;
- //supportedFiles += "M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|All Files |*.*|";
- supportedFiles += "All Files |*.*|";
- return supportedFiles;
-}
-
-void COsmo4::OnOpenFile()
-{
- Bool res;
- CFileDialog fd(TRUE,NULL,_T("\\"),OFN_HIDEREADONLY, GetFileFilter());
-
- ShowTaskBar(1);
- res = 0;
- if (fd.DoModal()==IDOK) {
- res = 1;
- m_filename = fd.GetPathName();
- m_DoResume = 0;/*done by term*/
- }
- ShowTaskBar(0);
- if (res) m_pMainWnd->PostMessage(WM_OPENURL);
-}
-
-void COsmo4::OnOpenUrl()
-{
- OpenDlg dlg;
- Bool res;
- ShowTaskBar(1, 1);
- res = 0;
- if (dlg.DoModal() == IDOK) {
- res = 1;
- m_DoResume = 0;/*done by term*/
- }
- ShowTaskBar(0, 1);
- if (res) m_pMainWnd->PostMessage(WM_OPENURL);
-}
-
-void COsmo4::SetBacklightState(Bool disable)
-{
- HKEY hKey = 0;
- DWORD dwSize;
- DWORD dwValue;
- HANDLE hBL;
-
- if (!m_disable_backlight) return;
-
- if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("ControlPanel\\Backlight"), 0, 0, &hKey ) != ERROR_SUCCESS) return;
-
- if (disable) {
- dwSize = 4;
- RegQueryValueEx(hKey, _T("BatteryTimeout"), NULL, NULL,(unsigned char*) &m_prev_batt_bl, &dwSize);
- dwSize = 4;
- RegQueryValueEx(hKey, _T("ACTimeout"), NULL, NULL, (unsigned char*) &m_prev_ac_bl,&dwSize);
- dwSize = 4;
- dwValue = 0xefff ;
- RegSetValueEx(hKey, _T("BatteryTimeout"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
- dwSize = 4;
- dwValue = 0xefff ;
- RegSetValueEx( hKey, _T("ACTimeout"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
- } else {
- if (m_prev_batt_bl) {
- dwSize = 4;
- RegSetValueEx(hKey, _T("BatteryTimeout"), NULL, REG_DWORD, (unsigned char *)&m_prev_batt_bl, dwSize);
- }
- if (m_prev_ac_bl) {
- dwSize = 4;
- RegSetValueEx(hKey, _T("ACTimeout"), NULL, REG_DWORD,(unsigned char *)&m_prev_ac_bl, dwSize);
- }
- }
- RegCloseKey(hKey);
- hBL = CreateEvent(NULL, FALSE, FALSE, _T("BackLightChangeEvent"));
- if (hBL) {
- SetEvent(hBL);
- CloseHandle(hBL);
- }
-}
-
-void COsmo4::OnShortcuts()
-{
- ShowTaskBar(1);
-
- MessageBox(NULL,
- _T("Double Click: Fullscreen on/off\n"),
-
- _T("Osmo4 Shortcuts"),
- MB_OK);
-
- ShowTaskBar(0);
-}
-
+++ /dev/null
-// Osmo4.h : main header file for the OSMO4 application
-//
-
-#if !defined(AFX_OSMO4_H__7E4A02D1_F77D_4E97_9E10_032054B29E33__INCLUDED_)
-#define AFX_OSMO4_H__7E4A02D1_F77D_4E97_9E10_032054B29E33__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#ifndef __AFXWIN_H__
-#error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "resource.h" // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4:
-// See Osmo4.cpp for the implementation of this class
-//
-
-/*MPEG4 term*/
-#include <gpac/terminal.h>
-
-enum {
- WM_SCENE_DONE = WM_USER + 1,
- WM_NAVIGATE,
- WM_SETSIZE,
- WM_OPENURL,
- WM_CONSOLEMSG,
-};
-
-
-#define IPAQ_TRANSLATE_KEY(vk) (LOWORD(vk) != 0x5b ? LOWORD(vk) : vk )
-/*navigation pad keys*/
-#define VK_IPAQ_LEFT 0x25
-#define VK_IPAQ_UP 0x26
-#define VK_IPAQ_RIGHT 0x27
-#define VK_IPAQ_DOWN 0x28
-/*"enter" key*/
-#define VK_IPAQ_START 0x86
-/*ipaq keys from left to right*/
-#define VK_IPAQ_A 0xC1
-#define VK_IPAQ_B 0xC2
-#define VK_IPAQ_C 0xC3
-#define VK_IPAQ_D 0xC4
-/*record button*/
-#define VK_IPAQ_E 0xC5
-
-class COsmo4 : public CWinApp
-{
-public:
- COsmo4();
-
- GF_Terminal *m_term;
- GF_User m_user;
- CString m_filename;
-
- u32 m_duration;
- CString m_navigate_url;
- Bool m_Loop, m_fit_screen, m_can_seek, m_open, m_disable_backlight, m_stopped, m_no_mime_fetch;
- void Pause();
-
- u32 m_scene_width, m_scene_height, m_reconnect_time;
- u32 m_screen_width, m_screen_height, m_menu_height;
- /*task bar on/off*/
- void ShowTaskBar(Bool showIt, Bool pause_only = 0);
-
- CString GetFileFilter();
-
- void SetBacklightState(Bool disable);
- void EnableLogs(Bool turn_on);
-
-private:
- Bool m_DoResume;
-
- void SetOptions();
-
- /*power management*/
- u32 m_prev_batt_bl, m_prev_ac_bl;
-
- FILE *m_logs;
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(COsmo4)
-public:
- virtual BOOL InitInstance();
- virtual int ExitInstance();
- //}}AFX_VIRTUAL
-
-// Implementation
-
- //{{AFX_MSG(COsmo4)
- afx_msg void OnAppAbout();
- afx_msg void OnConfigure();
- afx_msg void OnOpenFile();
- afx_msg void OnOpenUrl();
- afx_msg void OnShortcuts();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-inline COsmo4 *GetApp() {
- return (COsmo4 *)AfxGetApp();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OSMO4_H__7E4A02D1_F77D_4E97_9E10_032054B29E33__INCLUDED_)
+++ /dev/null
-//Microsoft eMbedded Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-#include "newres.h"
-
-#include <gpac/version.h>
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDR_MAINFRAME ICON DISCARDABLE "res\\Osmo4.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Cmdbar.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Toolbar
-//
-
-IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 16
-BEGIN
- BUTTON ID_OPEN_FILE
- BUTTON ID_FILE_PAUSE
- BUTTON ID_FILE_STEP
- BUTTON ID_FILE_STOP
- BUTTON ID_VIEW_FULLSCREEN
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
-BEGIN
- "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
- "Q", ID_APP_EXIT, VIRTKEY, CONTROL, NOINVERT
- "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT
- "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
- "X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT
- "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 140, 153
-STYLE WS_POPUP | WS_CAPTION
-EXSTYLE 0x80000000L
-CAPTION "About Osmo4"
-FONT 8, "System"
-BEGIN
- ICON IDR_MAINFRAME,IDC_STATIC,15,3,21,20
- CTEXT "Osmo4 player\nGPAC MPEG-4 SDK",IDC_ABT_TEXT,44,4,64,17
- CTEXT "This program is free software and may be distributed according to the terms of the GNU Lesser General Public License",
- IDC_STATIC,3,24,131,24
- CTEXT "GPAC Copyright (C) Telecom ParisTech 2000 - 2012 - All Rights Reserved http://gpac.io",
- IDC_STATIC,4,52,129,26
- LTEXT "Authors: Jean Le Feuvre, Cyril Concolato",IDC_STATIC,11,100,109,8
- LTEXT "Mozilla SpiderMonkey (JavaScript)",IDC_STATIC,11,110,
- 109,8
- LTEXT "The FreeType Project",IDC_STATIC,11,120,70,8
- LTEXT "The PNG Group, The I.J.G.",IDC_STATIC,12,130,87,8
- LTEXT "XVID, FAAD, MAD, 3GPP",IDC_STATIC,13,139,80,8
- LTEXT "------------ With many thanks to: -------------",
- IDC_STATIC,0,91,139,8
-END
-
-IDD_OPENFILE DIALOG DISCARDABLE 0, 0, 133, 116
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Select file location"
-FONT 8, "System"
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,92,33,27,14
- COMBOBOX IDC_FILELIST,4,17,127,52,CBS_DROPDOWN | CBS_AUTOHSCROLL |
- CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
- DEFPUSHBUTTON "Cancel",IDCANCEL,14,34,27,14
- LTEXT "Enter path to remote file",IDC_STATIC,25,6,80,8
-END
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "Comments", "\0"
- VALUE "CompanyName", "\0"
- VALUE "FileDescription", "Osmo4-GPAC\0"
- VALUE "FileVersion", GPAC_VERSION"\0"
- VALUE "InternalName", "Osmo4\0"
- VALUE "LegalCopyright", "Copyright (C) Telecom ParisTech 2005-2012\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "Osmo4.EXE\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Osmo4-GPAC\0"
- VALUE "ProductVersion", GPAC_VERSION"\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-#endif // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_ABOUTBOX, DIALOG
- BEGIN
- RIGHTMARGIN, 138
- TOPMARGIN, 1
- END
-
- IDD_OPENFILE, DIALOG
- BEGIN
- LEFTMARGIN, 2
- TOPMARGIN, 2
- BOTTOMMARGIN, 113
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menubar
-//
-
-IDR_MENU MENU DISCARDABLE
-BEGIN
- POPUP "File"
- BEGIN
- MENUITEM "Open", ID_OPEN_FILE
- MENUITEM "Open URL", ID_OPEN_URL
- MENUITEM SEPARATOR
- MENUITEM "Exit", ID_APP_EXIT
- END
- POPUP "View"
- BEGIN
- POPUP "Viewpoint"
- BEGIN
- MENUITEM "", ID_VIEWPORT_EMPTY
- END
- POPUP "Navigation"
- BEGIN
- MENUITEM "Reset", ID_NAV_RESET
- MENUITEM SEPARATOR
- MENUITEM "None", ID_NAV_NONE
- MENUITEM "Walk", ID_NAV_WALK
- MENUITEM "Fly", ID_NAV_FLY
- MENUITEM "Examine", ID_NAV_EXAMINE
- MENUITEM "Slide", ID_NAV_SLIDE
- MENUITEM SEPARATOR
- MENUITEM "Headlight", ID_NAV_HEADLIGHT
- MENUITEM "Gravity", ID_NAV_GRAVITY
- POPUP "Collision"
- BEGIN
- MENUITEM "Off", ID_COLLIDE_OFF
- MENUITEM "Regular", ID_COLLIDE_REG
- MENUITEM "Displacement", ID_COLLIDE_DISP
- END
- END
- MENUITEM SEPARATOR
- MENUITEM "Fullscreen", ID_VIEW_FULLSCREEN
- POPUP "Aspect Ratio"
- BEGIN
- MENUITEM "Keep Original", ID_VIEW_AR_ORIG
- MENUITEM "Fill Screen", ID_VIEW_AR_FILL
- MENUITEM "Ratio 4/3", ID_VIEW_AR_43
- MENUITEM "Ratio 16/9", ID_VIEW_AR_169
- MENUITEM SEPARATOR
- MENUITEM "Fit Screen", ID_VIEW_FIT
- END
- MENUITEM SEPARATOR
- MENUITEM "Time Control", ID_VIEW_TIMING
- MENUITEM SEPARATOR
- MENUITEM "Settings", IDD_CONFIGURE
- END
- POPUP "?"
- BEGIN
- MENUITEM "Shortcuts", ID_SHORTCUTS
- MENUITEM "About ...", ID_APP_ABOUT
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Data
-//
-
-IDR_MENU SHMENUBAR DISCARDABLE
-BEGIN
- IDR_MENU, 3,
- I_IMAGENONE, ID_FILE, TBSTATE_ENABLED,
- TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_FILE, 0, 0,
- I_IMAGENONE, ID_VIEW, TBSTATE_ENABLED,
- TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_VIEW, 0, 1,
- I_IMAGENONE, ID_MENUITEM32789, TBSTATE_ENABLED,
- TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_MENUITEM32790, 0, 2,
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_EDIT "File"
- IDS_TOOL "Tools"
- IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
-END
-
-STRINGTABLE PRELOAD DISCARDABLE
-BEGIN
- IDR_MAINFRAME "Osmo4\n\nOsmo4\n\n\nOsmo4.Document\nOsmo4 Document"
-END
-
-STRINGTABLE PRELOAD DISCARDABLE
-BEGIN
- AFX_IDS_IDLEMESSAGE "Ready"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
- ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
- ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_EDIT_CLEAR "Erase the selection\nErase"
- ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
- ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
- ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
- ID_EDIT_FIND "Find the specified text\nFind"
- ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
- ID_EDIT_REPEAT "Repeat the last action\nRepeat"
- ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
- ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
- ID_EDIT_UNDO "Undo the last action\nUndo"
- ID_EDIT_REDO "Redo the previously undone action\nRedo"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- AFX_IDS_SCTASKLIST "Activate Task List"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_NEW "New"
- IDS_FILE "File"
- IDS_MHELP "Help"
- IDS_SAVE "Save"
- IDS_CUT "Cut"
- IDS_COPY "Copy"
- IDS_PASTE "Paste"
- IDS_ABOUT "About"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_INDICATOR_CAPS "CAP"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_CAP_FILE "File"
- ID_FILE_RESTART "Restart presentation"
- IDS_CAP_MENUITEM32790 "?"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_CAP_VIEW "View"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// French (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-#ifdef _WIN32
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_CONTROL DIALOG DISCARDABLE 0, 0, 161, 15
-STYLE DS_SETFOREGROUND | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_STATICEDGE
-FONT 8, "System"
-BEGIN
- CONTROL "Slider1",IDC_SLIDER,"msctls_trackbar32",TBS_BOTH |
- TBS_NOTICKS | WS_TABSTOP,0,1,101,12
- LTEXT "00:00 FPS 30.00",IDC_TIME,102,3,56,10
-END
-
-IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 134, 121
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Osmo4 Options"
-FONT 8, "System"
-BEGIN
- PUSHBUTTON "Apply",IDC_SAVEOPT,108,3,24,14
- COMBOBOX IDC_COMBOSEL,3,5,99,80,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_TABSTOP
- LTEXT "-------------------------------------------------------",
- IDC_STATIC,0,17,133,8
-END
-
-IDD_OPT_GEN DIALOG DISCARDABLE 0, 120, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
- CONTROL "Loop at end",IDC_LOOP,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,6,28,54,10
- PUSHBUTTON "Make Default MPEG-4 Player",IDC_FILEASSOC,5,90,124,20,
- BS_MULTILINE
- CONTROL "Stretch display to fill screen",IDC_FILL_SCREEN,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,6,45,104,10
- CONTROL "Disable Backlight while playing",IDC_NO_BACKLIGHT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,61,111,10
- CONTROL "Enable logs",IDC_ENABLE_LOGS,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,6,74,52,10
-END
-
-IDD_OPT_RENDER DIALOG DISCARDABLE 0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
- LTEXT "Rendering Frame Rate",IDC_STATIC,27,27,73,8
- COMBOBOX IDC_BIFS_RATE,29,39,68,47,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_TABSTOP
- CONTROL "Direct Rendering",IDC_DIRECTRENDER,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,1,64,69,10
- CONTROL "Scalable Zoom",IDC_ZOOM_SCALABLE,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,70,64,61,10
- CONTROL "Fast Rendering",IDC_FAST_RENDER,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,70,79,60,10
- CONTROL "Force Scene Size",IDC_FORCE_SIZE,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,1,79,70,10
- LTEXT "Anti-Aliasing",IDC_STATIC,6,103,40,8
- COMBOBOX IDC_AA_LIST,56,99,71,47,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_TABSTOP
-END
-
-IDD_OPT_SYSTEMS DIALOG DISCARDABLE 0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
- LTEXT "Prefered Language for stream selection",IDC_STATIC,3,46,
- 64,19
- COMBOBOX IDC_LANG,69,48,60,72,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_TABSTOP
- LTEXT "Decoder Threading",IDC_STATIC,4,75,62,8
- COMBOBOX IDC_DEC_THREAD,69,72,60,30,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_TABSTOP
- CONTROL "Always draw late BIFS frames",IDC_BIFSDROP,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,4,91,111,10
- CONTROL "Force Single Timeline",IDC_FORCE_DURATION,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,4,106,82,10
-END
-
-IDD_OPT_VIDEO DIALOG DISCARDABLE 0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
- LTEXT "Graphics Driver",IDC_STATIC,5,54,50,8
- LTEXT "Anti-Aliasing",IDC_STATIC,6,77,40,8
- LTEXT "Video Driver",IDC_STATIC,5,98,40,8
- COMBOBOX IDC_GD_LIST,56,53,71,30,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_AA_LIST,56,73,71,47,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_TABSTOP
- COMBOBOX IDC_VIDEO_LIST,56,95,71,30,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
-END
-
-IDD_OPT_AUDIO DIALOG DISCARDABLE 0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
- CONTROL "Force Audio Config",IDC_FORCE_AUDIO,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,5,33,77,10
- LTEXT "Number of buffers",IDC_STATIC,5,51,60,8
- LTEXT "Total Duration in ms",IDC_STATIC,4,69,64,8
- EDITTEXT IDC_EDIT_AUDIO,68,48,34,14,ES_AUTOHSCROLL | ES_READONLY
- CONTROL "Spin1",IDC_SPIN_AUDIO,"msctls_updown32",UDS_SETBUDDYINT |
- UDS_ARROWKEYS | UDS_HORZ,105,49,19,12
- EDITTEXT IDC_AUDIO_DUR,68,67,34,14,ES_AUTOHSCROLL
- CONTROL "Spin1",IDC_SPIN_DUR,"msctls_updown32",UDS_SETBUDDYINT |
- UDS_ARROWKEYS | UDS_HORZ,105,68,19,12
- CONTROL "Disable Audio Resync",IDC_AUDIO_RESYNC,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,5,85,84,10
- LTEXT "Default Plugin",IDC_STATIC,5,103,45,8
- COMBOBOX IDC_DRIVER_LIST,52,100,73,30,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
-END
-
-IDD_OPT_FONT DIALOG DISCARDABLE 0, 20, 133, 119
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
- LTEXT "Font Engine",IDC_STATIC,35,33,39,8
- COMBOBOX IDC_FONT_LIST,12,45,98,30,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
- LTEXT "Systems Font Directory",IDC_STATIC,19,87,76,8
- PUSHBUTTON "...",IDC_BROWSE_FONT,6,98,115,12
- CONTROL "Draw text through texturing",IDC_USE_TEXTURE,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,10,68,107,10
-END
-
-IDD_OPT_HTTP DIALOG DISCARDABLE 0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
- LTEXT "Cache Directory",IDC_STATIC,35,9,53,8
- PUSHBUTTON "...",IDC_BROWSE_CACHE,7,22,113,14
- CONTROL "Remove temp files",IDC_CLEAN_CACHE,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,7,43,75,10
- CONTROL "Always redownload incomplete cached files",
- IDC_RESTART_CACHE,"Button",BS_AUTOCHECKBOX |
- BS_MULTILINE | WS_TABSTOP,7,54,102,22
- CONTROL "XML Progressive Load",IDC_SAX_PROGRESSIVE,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,8,77,85,10
- EDITTEXT IDC_SAX_DURATION,27,89,35,14,ES_CENTER | ES_AUTOHSCROLL |
- ES_NUMBER
-END
-
-IDD_OPT_STREAM DIALOG DISCARDABLE 0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
- LTEXT "Default RTSP Port",IDC_STATIC,33,33,58,8
- COMBOBOX IDC_PORT,15,42,95,30,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
- CONTROL "RTP over RTSP",IDC_RTSP,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,1,58,64,10
- CONTROL "RTP Reordering",IDC_REORDER,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,66,58,66,10
- EDITTEXT IDC_TIMEOUT,1,72,35,14,ES_CENTER | ES_AUTOHSCROLL |
- ES_NUMBER
- LTEXT "ms before control timeout",IDC_STATIC,44,75,83,8
- EDITTEXT IDC_BUFFER,1,87,35,14,ES_CENTER | ES_AUTOHSCROLL |
- ES_NUMBER
- LTEXT "ms of Media Buffering ",IDC_STATIC,44,90,72,8
- CONTROL "Rebuffer if less than",IDC_REBUFFER,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,2,106,78,10
- EDITTEXT IDC_REBUFFER_LEN,81,105,35,12,ES_CENTER | ES_AUTOHSCROLL |
- ES_NUMBER
- LTEXT "ms",IDC_STATIC,121,108,10,8
-END
-
-IDD_OPT_DECODER DIALOG DISCARDABLE 0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
- LTEXT "Prefered Audio Output",-1,33,9,70,8
- LTEXT "Prefered Video Output",-1,33,44,80,8
- COMBOBOX IDC_AUDEC_LIST,11,22,109,54,CBS_DROPDOWNLIST |
- WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_VIDEC_LIST,12,57,109,47,CBS_DROPDOWNLIST |
- WS_VSCROLL | WS_TABSTOP
-END
-
-IDD_OPT_RENDER3D DIALOG DISCARDABLE 0, 0, 133, 121
-STYLE DS_MODALFRAME | WS_CHILD
-FONT 8, "System"
-BEGIN
- CONTROL "Use 3D Renderer",IDC_USE_3D_REN,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,3,29,121,10
- CONTROL "Disable Backface Culling",IDC_NO_BACKCULL,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,3,41,92,10
- CONTROL "Emulate pow2 textures for video",IDC_EMULATE_POW2,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,1,97,121,10
- LTEXT "Drawing Mode",IDC_STATIC,5,56,46,8
- COMBOBOX IDC_WIRE_MODE,61,54,61,35,CBS_DROPDOWN | WS_VSCROLL |
- WS_TABSTOP
- LTEXT "Draw Normals",IDC_STATIC,5,73,45,8
- COMBOBOX IDC_DRAW_NORMALS,62,72,61,35,CBS_DROPDOWN | WS_VSCROLL |
- WS_TABSTOP
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_CONTROL, DIALOG
- BEGIN
- RIGHTMARGIN, 160
- BOTTOMMARGIN, 14
- END
-
- IDD_OPTIONS, DIALOG
- BEGIN
- RIGHTMARGIN, 133
- BOTTOMMARGIN, 120
- END
-
- IDD_OPT_GEN, DIALOG
- BEGIN
- RIGHTMARGIN, 132
- BOTTOMMARGIN, 120
- END
-
- IDD_OPT_RENDER, DIALOG
- BEGIN
- RIGHTMARGIN, 132
- BOTTOMMARGIN, 120
- END
-
- IDD_OPT_SYSTEMS, DIALOG
- BEGIN
- RIGHTMARGIN, 132
- BOTTOMMARGIN, 120
- END
-
- IDD_OPT_VIDEO, DIALOG
- BEGIN
- RIGHTMARGIN, 132
- BOTTOMMARGIN, 120
- END
-
- IDD_OPT_AUDIO, DIALOG
- BEGIN
- RIGHTMARGIN, 132
- BOTTOMMARGIN, 120
- END
-
- IDD_OPT_FONT, DIALOG
- BEGIN
- RIGHTMARGIN, 132
- BOTTOMMARGIN, 118
- END
-
- IDD_OPT_HTTP, DIALOG
- BEGIN
- RIGHTMARGIN, 132
- BOTTOMMARGIN, 120
- END
-
- IDD_OPT_STREAM, DIALOG
- BEGIN
- RIGHTMARGIN, 132
- BOTTOMMARGIN, 120
- END
-
- IDD_OPT_DECODER, DIALOG
- BEGIN
- RIGHTMARGIN, 132
- BOTTOMMARGIN, 120
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "#include ""newres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
- "#define _AFX_NO_OLE_RESOURCES\r\n"
- "#define _AFX_NO_TRACKER_RESOURCES\r\n"
- "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
- "\r\n"
- "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
- "#ifdef _WIN32\r\n"
- "LANGUAGE 9, 1\r\n"
- "#pragma code_page(1252)\r\n"
- "#endif //_WIN32\r\n"
- "#include ""res\\Osmo4.rc2"" // non-Microsoft eMbedded Visual C++ edited resources\r\n"
- "#include ""afxres.rc"" // Standard components\r\n"
- "#include ""wceres.rc"" // WCE-specific components\r\n"
- "#endif\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog Info
-//
-
-IDD_OPT_RENDER DLGINIT
-BEGIN
- IDC_BIFS_RATE, 0x403, 8, 0
-0x0035, 0x002e, 0x0030, 0x0000,
- IDC_BIFS_RATE, 0x403, 8, 0
-0x0037, 0x002e, 0x0035, 0x0000,
- IDC_BIFS_RATE, 0x403, 10, 0
-0x0031, 0x0030, 0x002e, 0x0030, 0x0000,
- IDC_BIFS_RATE, 0x403, 10, 0
-0x0031, 0x0032, 0x002e, 0x0035, 0x0000,
- IDC_BIFS_RATE, 0x403, 10, 0
-0x0031, 0x0035, 0x002e, 0x0030, 0x0000,
- IDC_BIFS_RATE, 0x403, 10, 0
-0x0032, 0x0034, 0x002e, 0x0030, 0x0000,
- IDC_BIFS_RATE, 0x403, 10, 0
-0x0032, 0x0035, 0x002e, 0x0030, 0x0000,
- IDC_BIFS_RATE, 0x403, 10, 0
-0x0033, 0x0030, 0x002e, 0x0030, 0x0000,
- 0
-END
-
-IDD_OPT_SYSTEMS DLGINIT
-BEGIN
- IDC_DEC_THREAD, 0x403, 28, 0
-0x0053, 0x0069, 0x006e, 0x0067, 0x006c, 0x0065, 0x0020, 0x0054, 0x0068,
-0x0072, 0x0065, 0x0061, 0x0064, 0x0000,
- IDC_DEC_THREAD, 0x403, 26, 0
-0x004d, 0x0075, 0x0074, 0x006c, 0x0069, 0x0020, 0x0054, 0x0068, 0x0072,
-0x0065, 0x0061, 0x0064, 0x0000,
- IDC_DEC_THREAD, 0x403, 10, 0
-0x0046, 0x0072, 0x0065, 0x0065, 0x0000,
- 0
-END
-
-#endif // French (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE 9, 1
-#pragma code_page(1252)
-#endif //_WIN32
-#include "res\Osmo4.rc2" // non-Microsoft eMbedded Visual C++ edited resources
-#include "afxres.rc" // Standard components
-//#include "wceres.rc" // WCE-specific components
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
+++ /dev/null
-// ProgressBar.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include "ProgressBar.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// ProgressBar dialog
-
-
-ProgressBar::ProgressBar(CWnd* pParent /*=NULL*/)
- : CDialog(ProgressBar::IDD, pParent)
-{
- //{{AFX_DATA_INIT(ProgressBar)
- //}}AFX_DATA_INIT
-
- m_grabbed = 0;
- m_range_invalidated = 0;
-}
-
-
-void ProgressBar::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(ProgressBar)
- DDX_Control(pDX, IDC_TIME, m_Time);
- DDX_Control(pDX, IDC_SLIDER, m_Slider);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(ProgressBar, CDialog)
- //{{AFX_MSG_MAP(ProgressBar)
- ON_WM_SIZE()
- ON_WM_HSCROLL()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// ProgressBar message handlers
-#define TEXT_RIGHT_PAD 2
-void ProgressBar::OnSize(UINT nType, int cx, int cy)
-{
- u32 tw;
- CDialog::OnSize(nType, cx, cy);
-
- if (!m_Slider.m_hWnd) return;
-
- RECT rc;
- m_Time.GetClientRect(&rc);
- tw = rc.right-rc.left;
- rc.left = cx - tw - TEXT_RIGHT_PAD;
- rc.right = cx - TEXT_RIGHT_PAD;
- m_Time.MoveWindow(&rc);
- m_Slider.GetClientRect(&rc);
- rc.left = 0;
- rc.right = cx - tw - TEXT_RIGHT_PAD;
- m_Slider.MoveWindow(&rc);
-}
-
-void ProgressBar::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
-{
- COsmo4 *app = GetApp();
-
- if (pScrollBar->GetDlgCtrlID() == IDC_SLIDER) {
- if (!app->m_can_seek) return;
- switch (nSBCode) {
- case TB_LINEUP:
- case TB_LINEDOWN:
- case TB_PAGEUP:
- case TB_PAGEDOWN:
- case TB_THUMBPOSITION:
- case TB_THUMBTRACK:
- case TB_TOP:
- case TB_BOTTOM:
- m_grabbed = 1;
- break;
- case TB_ENDTRACK:
- if (!app->m_open) {
- SetPosition(0);
- } else {
- u32 seek_to = m_Slider.GetPos();
- gf_term_play_from_time(app->m_term, seek_to, 0);
- }
- m_grabbed = 0;
- return;
- }
- }
- CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
-}
-
-void ProgressBar::SetPosition(u32 now)
-{
- TCHAR swText[20];
- u32 nb_s, nb_m;
- COsmo4 *app = GetApp();
-
- if (m_range_invalidated) {
- if (app->m_can_seek) {
- m_Slider.SetRangeMin(0);
- m_Slider.SetRangeMax(app->m_duration);
- m_Slider.ShowWindow(SW_SHOWNORMAL);
- m_Slider.EnableWindow(TRUE);
- } else {
- m_Slider.ShowWindow(SW_SHOWNORMAL);
- m_Slider.EnableWindow(FALSE);
-
- }
- m_range_invalidated = 0;
- }
- if (now==m_prev_time) return;
-
- if (now<m_prev_time) m_prev_time = 0;
-
- if (!m_prev_time || (m_prev_time + 500 <= now)) {
- m_FPS = gf_term_get_framerate(app->m_term, 0);
- m_prev_time = now;
- }
- nb_s = now/1000;
- nb_m = nb_s/60;
- nb_s -= nb_m*60;
- wsprintf(swText, _T("%02d:%02d FPS %02.2f"), nb_m, nb_s, m_FPS);
- m_Time.SetWindowText(swText);
-
- if (!m_grabbed) m_Slider.SetPos(now);
-}
+++ /dev/null
-#if !defined(AFX_PROGRESSBAR_H__85FCAC2B_9C83_4C83_8E66_D712FC88B221__INCLUDED_)
-#define AFX_PROGRESSBAR_H__85FCAC2B_9C83_4C83_8E66_D712FC88B221__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// ProgressBar.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// ProgressBar dialog
-
-class ProgressBar : public CDialog
-{
-// Construction
-public:
- ProgressBar(CWnd* pParent = NULL); // standard constructor
-
- Bool m_grabbed, m_range_invalidated;
- Double m_FPS;
- u32 m_prev_time;
- void SetPosition(u32 time_ms);
-
-// Dialog Data
- //{{AFX_DATA(ProgressBar)
- enum { IDD = IDD_CONTROL };
- CStatic m_Time;
- CSliderCtrl m_Slider;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(ProgressBar)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(ProgressBar)
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PROGRESSBAR_H__85FCAC2B_9C83_4C83_8E66_D712FC88B221__INCLUDED_)
+++ /dev/null
-//{{NO_DEPENDENCIES}}
-// Microsoft eMbedded Visual C++ generated include file.
-// Used by Osmo4.rc
-//
-#define IDD_ABOUTBOX 100
-#define IDM_MENU 101
-#define IDS_EDIT 102
-#define IDS_TOOL 103
-#define IDP_SOCKETS_INIT_FAILED 104
-#define IDR_MAIN_EDIT 105
-#define IDR_MAIN_TOOL 106
-#define IDI_PAUSE 120
-#define IDD_OPT_HTTP 121
-#define IDR_MAINFRAME 128
-#define IDD_OPT_AUDIO 129
-#define IDD_OPENFILE 130
-#define IDD_CONTROL 131
-#define IDD_OPTIONS 132
-#define IDD_OPT_GEN 133
-#define IDD_OPT_RENDER 134
-#define IDD_OPT_SYSTEMS 135
-#define IDD_OPT_VIDEO 136
-#define IDI_PLAY 137
-#define IDD_OPT_FONT 138
-#define IDI_STOP 139
-#define IDD_OPT_STREAM 140
-#define IDR_MENU 141
-#define IDD_OPT_RENDER3D 142
-#define IDD_OPT_DECODER 143
-#define IDC_FILELIST 1000
-#define IDC_BROWSE 1001
-#define IDC_SEEK 1002
-#define IDC_PLAY 1003
-#define IDC_STOP 1004
-#define IDC_OPT_SET_NAME 1005
-#define IDC_SAVEOPT 1006
-#define IDC_LOOP 1007
-#define IDC_AUTOSTART 1008
-#define IDC_NO_CONSOLE 1009
-#define IDC_FILEASSOC 1010
-#define IDC_BIFS_RATE 1011
-#define IDC_DIRECTRENDER 1012
-#define IDC_ZOOM_SCALABLE 1013
-#define IDC_FAST_RENDER 1014
-#define IDC_FORCE_SIZE 1015
-#define IDC_COLOR 1016
-#define IDC_LANG 1017
-#define IDC_DEC_THREAD 1018
-#define IDC_BIFSDROP 1019
-#define IDC_FORCE_DURATION 1020
-#define IDC_SLIDER 1021
-#define IDC_GD_LIST 1022
-#define IDC_AA_LIST 1023
-#define IDC_VIDEO_LIST 1024
-#define IDC_FORCE_AUDIO 1025
-#define IDC_EDIT_AUDIO 1026
-#define IDC_SPIN_AUDIO 1027
-#define IDC_AUDIO_FPS 1028
-#define IDC_SPIN_DUR 1029
-#define IDC_AUDIO_RESYNC 1030
-#define IDC_DRIVER_LIST 1031
-#define IDC_FONT_LIST 1032
-#define IDC_BROWSE_FONT 1033
-#define IDC_BROWSE_CACHE 1034
-#define IDC_CLEAN_CACHE 1035
-#define IDC_RESTART_CACHE 1036
-#define IDC_PORT 1037
-#define IDC_RTSP 1038
-#define IDC_REORDER 1039
-#define IDC_TIMEOUT 1040
-#define IDC_BUFFER 1041
-#define IDC_REBUFFER 1042
-#define IDC_REBUFFER_LEN 1043
-#define IDC_VERSION 1044
-#define IDC_AUDEC_LIST 1046
-#define IDC_VIDEC_LIST 1047
-#define IDC_COMBOSEL 1048
-#define IDC_TIME 1049
-#define IDC_ABT_TEXT 1050
-#define IDC_CTRL_PLAY 1051
-#define IDC_USE_TEXTURE 1052
-#define IDC_USE_3D_REN 1053
-#define IDC_NO_BACKCULL 1054
-#define IDC_CTRL_STOP 1055
-#define IDC_EMULATE_POW2 1056
-#define IDC_WIRE_MODE 1057
-#define IDC_SAX_DURATION 1058
-#define IDC_DRAW_NORMALS 1059
-#define IDC_SPIN_OPT 1060
-#define IDC_AUDIO_DUR 1061
-#define IDC_SPIN_FPS 1062
-#define IDC_FILL_SCREEN 1063
-#define IDC_VIEW_FPS 1064
-#define IDC_NO_BACKLIGHT 1065
-#define IDC_SAX_PROGRESSIVE 1066
-#define IDC_ENABLE_LOGS 1067
-#define IDS_CAP_FILE 32772
-#define ID_FILE_RESTART 32773
-#define ID_FPS_DISP 32774
-#define IDD_CONFIGURE 32775
-#define ID_VIEW_CONTROL 32776
-#define ID_FILE_PAUSE 32777
-#define ID_FILE_STEP 32778
-#define ID_FILE_STOP 32779
-#define ID_VIEW_FULLSCREEN 32780
-#define ID_FILE 32781
-#define ID_MENUITEM32789 32782
-#define IDS_CAP_MENUITEM32790 32783
-#define ID_VIEW 32784
-#define IDS_CAP_VIEW 32785
-#define ID_OPEN_FILE 32786
-#define ID_OPEN_URL 32787
-#define ID_SHORTCUTS 32788
-#define ID_VIEW_FIT 32789
-#define ID_NAV_NONE 32806
-#define ID_NAV_SLIDE 32807
-#define ID_NAV_RESET 32808
-#define ID_NAV_WALK 32810
-#define ID_NAV_FLY 32811
-#define ID_NAV_EXAMINE 32812
-#define ID_NAV_GRAVITY 32813
-#define ID_COLLIDE_OFF 32815
-#define ID_COLLIDE_REG 32816
-#define ID_COLLIDE_DISP 32817
-#define ID_VIEWPORT_EMPTY 32818
-#define ID_NAV_HEADLIGHT 32819
-#define ID_VP_0 32820
-#define ID_VP_1 32821
-#define ID_VP_2 32822
-#define ID_VP_3 32823
-#define ID_VP_4 32824
-#define ID_VP_5 32825
-#define ID_VP_6 32826
-#define ID_VP_7 32827
-#define ID_VP_8 32828
-#define ID_VP_9 32829
-#define ID_VP_10 32830
-#define ID_VP_11 32831
-#define ID_VP_12 32832
-#define ID_VP_13 32833
-#define ID_VP_14 32834
-#define ID_VP_15 32835
-#define ID_VP_16 32836
-#define ID_VP_17 32837
-#define ID_VP_18 32838
-#define ID_VP_19 32839
-#define ID_VIEW_AR_ORIG 32890
-#define ID_VIEW_AR_FILL 32891
-#define ID_VIEW_AR_43 32892
-#define ID_VIEW_AR_169 32893
-#define ID_VIEW_TIMING 32894
-#define IDS_NEW 65000
-#define IDS_FILE 65001
-#define IDS_MHELP 65002
-#define IDS_SAVE 65003
-#define IDS_CUT 65004
-#define IDS_COPY 65005
-#define IDS_PASTE 65006
-#define IDS_ABOUT 65007
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 143
-#define _APS_NEXT_COMMAND_VALUE 32820
-#define _APS_NEXT_CONTROL_VALUE 1059
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+++ /dev/null
-// stdafx.cpp : source file that includes just the standard includes
-// Osmo4.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
+++ /dev/null
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__C81DFFE9_41A3_474E_A044_3A730DB4FFD6__INCLUDED_)
-#define AFX_STDAFX_H__C81DFFE9_41A3_474E_A044_3A730DB4FFD6__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#if (_WIN32_WCE <= 200)
-#error This project does not support MFCCE 2.00 or earlier, because it requires CControlBar, available only in MFCCE 2.01 or later
-#endif
-
-#if (_WIN32_WCE <= 211)
-#error This project can not be built for H/PC Pro 2.11 or earlier platforms.
-#endif
-
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-
-#include <afxwin.h> // MFC core and standard components
-#include <afxext.h> // MFC extensions
-
-#if defined(_AFXDLL)
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
-#endif
-
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-#include <afxsock.h> // MFC socket extensions
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__C81DFFE9_41A3_474E_A044_3A730DB4FFD6__INCLUDED_)
+++ /dev/null
-#ifndef __NEWRES_H__
-#define __NEWRES_H__
-
-#define SHMENUBAR RCDATA
-#if !(defined(_WIN32_WCE_PSPC) && (_WIN32_WCE >= 300))
-#undef HDS_HORZ
-#undef HDS_BUTTONS
-#undef HDS_HIDDEN
-
-#include <commctrl.h>
-// for MenuBar
-#define I_IMAGENONE (-2)
-#define NOMENU 0xFFFF
-#define IDS_SHNEW 1
-#define IDM_SHAREDNEW 10
-#define IDM_SHAREDNEWDEFAULT 11
-
-// for Tab Control
-#define TCS_SCROLLOPPOSITE 0x0001 // assumes multiline tab
-#define TCS_BOTTOM 0x0002
-#define TCS_RIGHT 0x0002
-#define TCS_VERTICAL 0x0080
-#define TCS_MULTISELECT 0x0004 // allow multi-select in button mode
-#define TCS_FLATBUTTONS 0x0008
-#endif //_WIN32_WCE_PSPC
-
-
-#endif //__NEWRES_H__
+++ /dev/null
-//
-// OSMO4.RC2 - resources Microsoft eMbedded Visual C++ does not edit directly
-//
-
-#ifdef APSTUDIO_INVOKED
- #error this file is not editable by Microsoft eMbedded Visual C++
-#endif //APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Add manually edited resources here...
-
-/////////////////////////////////////////////////////////////////////////////
+++ /dev/null
-set OLDDIR=%CD%\r
-cd /d %~dp0\r
-\r
-for /f "delims=" %%a in ('git describe --tags --long') do @set VERSION=%%a\r
-for /f "delims=" %%a in ('git describe --tags --abbrev=0') do @set TAG=%%a-\r
-for /f "delims=" %%a in ('git rev-parse --abbrev-ref HEAD') do @set BRANCH=%%a\r
-REM remove anotated tag from VERSION\r
-setlocal enabledelayedexpansion\r
-call set VERSION=%%VERSION:!TAG!=%%\r
-setlocal disabledelayedexpansion\r
-set revision="%VERSION%-%BRANCH%"\r
-set gpac_version="0.8.0-r%gpac_revision%\r
-\r
-zip "GPAC_%gpac_version%_WindowsMobile.zip" ../*.dll ../*.exe ../*.plg\r
-\r
-cd /d %OLDDIR%\r
+++ /dev/null
-set OLDDIR=%CD%\r
-cd /d %~dp0\r
-\r
-for /f "delims=" %%a in ('git describe --tags --long') do @set VERSION=%%a\r
-for /f "delims=" %%a in ('git describe --tags --abbrev=0') do @set TAG=%%a-\r
-for /f "delims=" %%a in ('git rev-parse --abbrev-ref HEAD') do @set BRANCH=%%a\r
-REM remove anotated tag from VERSION\r
-setlocal enabledelayedexpansion\r
-call set VERSION=%%VERSION:!TAG!=%%\r
-setlocal disabledelayedexpansion\r
-set revision="%VERSION%-%BRANCH%"\r
-\r
-set gpac_version="0.8.0-r%gpac_revision%\r
-\r
-ECHO [Version] > gpaccab.inf\r
-ECHO Provider = "GPAC %gpac_version%" >> gpaccab.inf\r
-type gpac.inf >> gpaccab.inf\r
-\r
-CabWiz gpaccab.inf\r
-\r
-ECHO off\r
-\r
-ECHO [CEAppManager]> gpac.ini\r
-ECHO Version = %gpac_version%>> gpac.ini\r
-ECHO Component = GPAC for Windows Mobile>> gpac.ini\r
-ECHO [GPAC for Windows Mobile]>> gpac.ini\r
-ECHO Description = GPAC MPEG-4 Player>> gpac.ini\r
-ECHO Uninstall = GPAC Osmophone>> gpac.ini\r
-ECHO IconFile = ..\..\..\..\doc\osmo4.ico>> gpac.ini\r
-ECHO IconIndex = 0 >> gpac.ini\r
-ECHO CabFiles = gpaccab.cab >> gpac.ini\r
-\r
-ECHO on\r
-\r
-ezsetup -l english -i gpac.ini -r readme.txt -e ../../../../COPYING -o gpac.exe\r
-rename gpac.exe "GPAC_%gpac_version%_WindowsMobile.exe"\r
-DEL gpaccab.cab\r
-DEL gpaccab.inf\r
-DEL gpac.ini\r
-DEL *.tmp\r
-\r
-cd /d %OLDDIR%\r
+++ /dev/null
-;[Version]
-Signature = "$Windows NT$"
-CESignature = "$Windows CE$"
-
-[CEStrings]
-;Osmo4 for PocketPC install, Osmophone for Smartphone install
-AppName = Osmophone
-InstallDir = \Program Files\GPAC
-
-[Strings]
-;Osmo4.exe for PocketPC install, Osmophone.exe for Smartphone install
-ExeName = Osmophone.exe
-
-[DefaultInstall]
-CopyFiles = BinFiles , Exefiles
-AddReg = GPACReg
-CEShortcuts = Shortcut , ProgLink
-CESelfRegister=GPAX.dll
-
-
-[SourceDisksNames]
-
-1 =, "Common Files",, ..
-2 =, "Extra Files",, .
-3 =, "Doc Files",, ..\..\..\..\doc\
-
-[SourceDisksFiles]
-libgpac.dll = 1
-%ExeName% = 1
-;Osmo4.exe = 1
-GPAX.dll = 1
-gpac.mp4 = 3
-
-msvcr80.dll = 1
-
-;comment this one if not using OpenGL
-libGLES_CM.dll = 1
-
-;comment this one if not using SpiderMonkey
-js32.dll = 1
-
-;uncomment if your device doesn't have GX installed (I think most do)
-;gx.dll = 2
-
-;all gpac modules - comment the ones you haven't compiled
-gm_aac_in.dll = 1
-gm_bifs_dec.dll = 1
-gm_ctx_load.dll = 1
-gm_dummy_in.dll = 1
-gm_ft_font.dll = 1
-gm_gapi.dll = 1
-gm_gpac_js.dll = 1
-gm_img_in.dll = 1
-gm_ismacryp.dll = 1
-gm_isom_in.dll = 1
-gm_laser_dec.dll = 1
-gm_mp3_in.dll = 1
-gm_mpegts_in.dll = 1
-gm_odf_dec.dll = 1
-gm_platinum.dll = 1
-gm_rtp_in.dll = 1
-gm_timedtext.dll = 1
-gm_soft_raster.dll = 1
-gm_svg_in.dll = 1
-gm_wav_out.dll = 1
-gm_widgetman.dll = 1
-gm_xvid_dec.dll = 1
-gm_ogg.dll = 1
-;commenting out ffmpeg since we no longer have a recent version (and no one uses smartphone 2003 anymore ...)
-;gm_ffmpeg_in.dll = 1
-;avcodec-52.dll = 1
-;avformat-52.dll = 1
-;avutil-50.dll = 1
-;swscale-0.dll = 1
-
-;==================================================
-
-
-
-; Ouput directories for files & shortcuts
-
-[DestinationDirs]
-BinFiles = 0, %CE2%
-Exefiles = 0, %InstallDir%
-Shortcut = 0, %CE17%
-ProgLink = 0, %CE11%
-DefaultDestDir = 0, %InstallDir%
-
-[BinFiles]
-;"gx.dll"
-"libgpac.dll"
-"GPAX.dll"
-"js32.dll"
-"libGLES_CM.dll"
-"msvcr80.dll"
-
-[Exefiles]
-"%ExeName%"
-"gpac.mp4"
-"gm_aac_in.dll"
-"gm_bifs_dec.dll"
-"gm_ctx_load.dll"
-"gm_dummy_in.dll"
-"gm_ffmpeg_in.dll"
-"avcodec-52.dll"
-"avformat-52.dll"
-"avutil-50.dll"
-"swscale-0.dll"
-"gm_ft_font.dll"
-"gm_gapi.dll"
-"gm_gpac_js.dll"
-"gm_img_in.dll"
-"gm_ismacryp.dll"
-"gm_isom_in.dll"
-"gm_laser_dec.dll"
-"gm_mp3_in.dll"
-"gm_mpegts_in.dll"
-"gm_odf_dec.dll"
-"gm_platinum.dll"
-"gm_rtp_in.dll"
-"gm_timedtext.dll"
-"gm_soft_raster.dll"
-"gm_svg_in.dll"
-"gm_wav_out.dll"
-"gm_widgetman.dll"
-"gm_xvid_dec.dll"
-"gm_ogg.dll"
-
-[GPACReg]
-;GPAC cfg file location
-HKCR,GPAC,InstallDir,0x00000000,%InstallDir%
-
-;GPAC cfg file association
-HKCR,.cfg,,0x00000000,txtfile
-
-;MP4 file association
-HKCR,.mp4,,0x00000000,mp4file
-HKCR,mp4file\Shell\Open\Command,,0x00000000,"""%InstallDir%\%ExeName%""" """%%L"""
-
-;Icon number is bin ID of ressource in app
-HKCR,mp4file\DefaultIcon,,0x00000000,"%InstallDir%\%ExeName%,-128"
-
-[Shortcut]
-"%AppName%", 0, "%ExeName%"
-
-[ProgLink]
-"%AppName%", 0, "%ExeName%"
-
+++ /dev/null
-This will install GPAC for ARM PocketPC/SmartPhones 2003 Platforms
-
-GPAC is an open source MPEG-4 framework developped by ENST and available at:
- http://gpac.io
-
-WARNING: THIS RELEASE COMES WITH NO WARRANTY, AND MAY EVEN DAMAGE YOUR HANDHELD DEVICE. PLEASE READ CAREFULLY THE LICENSE HEREJOIN
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>Osmo4</string>
- <key>CFBundleIconFile</key>
- <string>Osmo</string>
- <key>CFBundleIdentifier</key>
- <string>org.gpac.Osmo4</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>Omo4</string>
- <key>NSHumanReadableCopyright</key>
- <string>Copyright (c) 2003-2005 TelecomParisTech</string>
- <key>NSMainNibFile</key>
- <string>NSMainNibFile</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
+++ /dev/null
-include ../../config.mak
-
-vpath %.cpp $(SRC_PATH)/applications/osmo4_wx
-
-CFLAGS= $(CXXFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-ifeq ($(GPACREADONLY),yes)
-CFLAGS+=-DGPAC_READ_ONLY
-endif
-
-#common obj
-OBJS= wxOsmo4.o wxGPACControl.o fileprops.o Playlist.o menubtn.o
-
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=Osmo4$(EXE)
-else
-EXT=
-PROG=Osmo4
-endif
-
-#3 - spidermonkey support
-ifeq ($(CONFIG_JS),no)
-else
-SCENEGRAPH_CFLAGS+=$(JS_FLAGS)
-ifeq ($(CONFIG_JS),local)
-NEED_LOCAL_LIB=yes
-endif
-LINKFLAGS+=$(JS_LIBS)
-endif
-
-CFLAGS+=$(WX_CFLAGS)
-
-SRCS := $(OBJS:.o=.cpp)
-
-all: $(PROG)
-
-Osmo4$(EXE): $(OBJS)
- $(CC) -o ../../bin/gcc/$@ $(OBJS) -L../../bin/gcc -lgpac $(WX_LFLAGS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(PROG)
-
-install:
-ifeq ($(CONFIG_DARWIN),yes)
- mkdir -p $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/MacOS
- mkdir -p $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/Resources/English.lproj
- cp ./Darwin.Info.plist \
- $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/Info.plist
- cp ./Darwin.InfoPlist.strings \
- $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/Resources/English.lproj/InfoPlist.strings
- cp ./Darwin.Osmo.icns \
- $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/Resources/Osmo.icns
- install -m 755 $(INSTFLAGS) ../../bin/gcc/Osmo4 \
- $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/MacOS
- echo -n 'APPLOsm4' > $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/PkgInfo
-else
- rm -f wxOsmo4.o
- mkdir -p $(DESTDIR)$(prefix)/bin
- install -m 755 $(INSTFLAGS) ../../bin/gcc/Osmo4 "$(DESTDIR)$(prefix)/bin"
-endif
-
-uninstall:
- rm -rf $(DESTDIR)$(prefix)/bin/Osmo4
-
-dep:
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- * GPAC is gf_free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-#include "wxOsmo4.h"
-#include "Playlist.h"
-
-
-#include "playlist.xpm"
-
-PLEntry::PLEntry(wxString url)
-{
- m_url = gf_strdup(url.mb_str(wxConvUTF8));
- Bool is_remote = 0;;
- wxCharBuffer the_url = (const char *) url.mb_str(wxConvUTF8);
- const char *_url = strstr(the_url, "://");
- if (_url) {
- _url += 3;
- is_remote = 1;
- }
- else _url = (const char *) the_url;
-
- char *str = (char*)strrchr(_url, '\\');
- if (!str) str = (char*)strrchr(_url, '/');
- if (str && strlen(str+1)) {
- m_disp_name = gf_strdup(str+1);
- str = strrchr(m_disp_name, '.');
- if (str) str[0] = 0;
- } else {
- m_disp_name = gf_strdup(_url);
- if (!is_remote) {
- str = strrchr(m_disp_name, '.');
- if (str) str[0] = 0;
- }
- }
- m_duration = 0;
- m_bIsDead = 0;
- m_bIsPlaying = 0;
- m_bIsSelected = 0;
-}
-
-PLEntry::~PLEntry()
-{
- if (m_url) gf_free(m_url);
- if (m_disp_name) gf_free(m_disp_name);
-
-}
-
-wxPlaylist::wxPlaylist(wxWindow *parent)
- : wxFrame(parent, -1, wxString(_T("Osmo4 Playlist")), wxDefaultPosition, wxDefaultSize,
- wxCLOSE_BOX | wxSYSTEM_MENU | wxCAPTION | wxRESIZE_BORDER)
-{
-
- m_pApp = (wxOsmo4Frame *)parent;
-
- m_pOpen = new wxBitmap(pl_open);
- m_pSave = new wxBitmap(pl_save);
- m_pAdd = new wxBitmap(pl_add);
- m_pRem = new wxBitmap(pl_rem);
- m_pUp = new wxBitmap(pl_up);
- m_pDown = new wxBitmap(pl_down);
- m_pSort = new wxBitmap(pl_sort);
-
- m_pToolBar = CreateToolBar(wxTB_HORIZONTAL);
- m_pAddBut = new wxMenuButton(m_pToolBar, ID_PL_ADD_FILE, *m_pAdd);
- wxMenu *menu = new wxMenu();
- menu->Append(ID_PL_ADD_URL, wxT("&Url"));
- menu->Append(ID_PL_ADD_DIR, wxT("&Directory"));
- menu->Append(ID_PL_ADD_DIR_REC, wxT("&Directory and subfolders"));
- m_pAddBut->AssignMenu(menu);
- m_pAddBut->SetToolTip(wxString(wxT("Add Files")));
-
- m_pRemBut = new wxMenuButton(m_pToolBar, ID_PL_REM_FILE, *m_pRem);
- menu = new wxMenu();
- menu->Append(ID_PL_REM_ALL, wxT("&Clear"));
- menu->Append(ID_PL_REM_DEAD, wxT("&Remove dead entries"));
- m_pRemBut->AssignMenu(menu);
- m_pRemBut->SetToolTip(wxString(wxT("Remove Selected Files")));
-
- m_pSortBut = new wxMenuButton(m_pToolBar, ID_PL_SORT_FILE, *m_pSort);
- menu = new wxMenu();
- menu->Append(ID_PL_SORT_TITLE, wxT("&Sort by Title"));
- menu->Append(ID_PL_SORT_FILE, wxT("&Sort by file name"));
- menu->Append(ID_PL_SORT_DUR, wxT("&Sort by Duration"));
- menu->AppendSeparator();
- menu->Append(ID_PL_REVERSE, wxT("&Reverse"));
- menu->Append(ID_PL_RANDOMIZE, wxT("&Randomize"));
- m_pSortBut->AssignMenu(menu);
- m_pSortBut->SetToolTip(wxString(wxT("Sort Playlist by filename")));
-
- m_pToolBar->AddTool(ID_PL_OPEN, wxT(""), *m_pOpen, wxT("Open Playlist"));
- m_pToolBar->AddTool(ID_PL_SAVE, wxT(""), *m_pSave, wxT("Save Playlist"));
- m_pToolBar->AddSeparator();
- m_pToolBar->AddControl(m_pAddBut);
- m_pToolBar->AddControl(m_pRemBut);
- m_pToolBar->AddSeparator();
- m_pToolBar->AddTool(ID_PL_UP, wxT(""), *m_pUp, wxT("Moves Selected Files Up"));
- m_pToolBar->AddTool(ID_PL_DOWN, wxT(""), *m_pDown, wxT("Moves Selected Files Down"));
- m_pToolBar->AddSeparator();
- m_pToolBar->AddControl(m_pSortBut);
- m_pToolBar->Realize();
-
- m_FileList = new wxListCtrl(this, ID_FILE_LIST, wxDefaultPosition, wxDefaultSize, wxLC_REPORT);
-
- m_FileList->InsertColumn(0, wxT(""), wxLIST_FORMAT_LEFT, 1);
- m_FileList->InsertColumn(1, wxT("Title"), wxLIST_FORMAT_LEFT, 1);
- m_FileList->InsertColumn(2, wxT("Duration"), wxLIST_FORMAT_LEFT, 1);
-
- m_entries = gf_list_new();
- m_cur_entry = -1;
- m_all_dead_entries = -1;
-
- SetSize(220, 380);
- Centre();
-}
-
-wxPlaylist::~wxPlaylist()
-{
- Clear();
- gf_list_del(m_entries);
- delete m_pAddBut;
- delete m_pRemBut;
- delete m_pSortBut;
- delete m_pOpen;
- delete m_pSave;
- delete m_pAdd;
- delete m_pRem;
- delete m_pUp;
- delete m_pDown;
- delete m_pSort;
-}
-
-
-BEGIN_EVENT_TABLE(wxPlaylist, wxWindow)
- EVT_CLOSE(wxPlaylist::OnClose)
- EVT_SIZE(wxPlaylist::OnSize)
- EVT_TOOL(ID_PL_ADD_FILE, wxPlaylist::OnAddFile)
- EVT_TOOL(ID_PL_ADD_URL, wxPlaylist::OnAddURL)
- EVT_TOOL(ID_PL_ADD_DIR, wxPlaylist::OnAddDir)
- EVT_TOOL(ID_PL_ADD_DIR_REC, wxPlaylist::OnAddDirRec)
- EVT_TOOL(ID_PL_REM_FILE, wxPlaylist::OnRemFile)
- EVT_TOOL(ID_PL_REM_ALL, wxPlaylist::OnRemAll)
- EVT_TOOL(ID_PL_REM_DEAD, wxPlaylist::OnRemDead)
- EVT_TOOL(ID_PL_UP, wxPlaylist::OnSelUp)
- EVT_TOOL(ID_PL_DOWN, wxPlaylist::OnSelDown)
- EVT_TOOL(ID_PL_SAVE, wxPlaylist::OnSave)
- EVT_TOOL(ID_PL_OPEN, wxPlaylist::OnOpen)
- EVT_MENU(ID_PL_PLAY, wxPlaylist::OnPlay)
- EVT_MENU(ID_PL_RANDOMIZE, wxPlaylist::OnRandomize)
- EVT_MENU(ID_PL_REVERSE, wxPlaylist::OnReverseList)
- EVT_MENU(ID_PL_SEL_REV, wxPlaylist::OnReverseSelection)
- EVT_MENU(ID_PL_SORT_TITLE, wxPlaylist::OnSortTitle)
- EVT_MENU(ID_PL_SORT_FILE, wxPlaylist::OnSortFile)
- EVT_MENU(ID_PL_SORT_DUR, wxPlaylist::OnSortDuration)
- EVT_LIST_ITEM_ACTIVATED(ID_FILE_LIST, wxPlaylist::OnItemActivate)
- EVT_LIST_ITEM_RIGHT_CLICK(ID_FILE_LIST, wxPlaylist::OnRightClick)
-END_EVENT_TABLE()
-
-void wxPlaylist::OnClose(wxCloseEvent &event)
-{
- if (event.CanVeto()) {
- event.Veto();
- Hide();
- }
-}
-
-void wxPlaylist::OnSize(wxSizeEvent &event)
-{
- wxSize s = event.GetSize();
- m_FileList->SetSize(0, 0, s.GetWidth()-2, s.GetHeight());
- m_FileList->SetColumnWidth(0, 30);
- m_FileList->SetColumnWidth(2, 60);
- m_FileList->SetColumnWidth(1, s.GetWidth()-96);
-}
-
-void wxPlaylist::Clear()
-{
- m_FileList->DeleteAllItems();
- while (gf_list_count(m_entries)) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, 0);
- gf_list_rem(m_entries, 0);
- delete ple;
- }
- m_cur_entry = -1;
-}
-
-void wxPlaylist::ClearButPlaying()
-{
- PLEntry *p = NULL;
- if (m_cur_entry >= 0) {
- p = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- gf_list_rem(m_entries, m_cur_entry);
- }
- Clear();
- if (p) {
- gf_list_add(m_entries, p);
- m_cur_entry = 0;
- }
- RefreshList();
-}
-
-void wxPlaylist::UpdateEntry(u32 idx)
-{
- char szText[20];
-
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, idx);
- if (idx+1<10) sprintf(szText, "00%d", idx+1);
- else if (idx+1<100) sprintf(szText, "0%d", idx+1);
- else sprintf(szText, "%d", idx+1);
- m_FileList->SetItem(idx, 0, wxString(szText, wxConvUTF8));
-
- wxString str;
- if (ple->m_bIsDead) str = wxT("!! ") + wxString(ple->m_disp_name, wxConvUTF8) + wxT(" (DEAD)!!)");
- else if (ple->m_bIsPlaying) str = wxT(">> ") + wxString(ple->m_disp_name, wxConvUTF8) + wxT(" >>");
- else str = wxString(ple->m_disp_name, wxConvUTF8);
- m_FileList->SetItem(idx, 1, str);
-
- if (ple->m_duration) {
- u32 h = (u32) (ple->m_duration / 3600);
- u32 m = (u32) (ple->m_duration / 60) - h*60;
- u32 s = (u32) (ple->m_duration) - h*3600 - m*60;
- m_FileList->SetItem(idx, 2, wxString::Format(wxT("%02d:%02d:%02d"), h, m, s) );
- } else {
- m_FileList->SetItem(idx, 2, wxT("Unknown"));
- }
-}
-
-void wxPlaylist::RefreshList()
-{
- u32 i, top_idx;
- char szPath[GF_MAX_PATH];
- Bool first_sel;
-
- top_idx = m_FileList->GetTopItem();
- m_FileList->DeleteAllItems();
-
- first_sel = 0;
- for (i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- m_FileList->InsertItem(i, wxT(""));
- /*cast for 64-bit compilation*/
- m_FileList->SetItemData(i, (unsigned long) ple);
- UpdateEntry(i);
-
- if (ple->m_bIsPlaying) m_cur_entry = i;
-
- if (ple->m_bIsSelected) {
- m_FileList->SetItemState(i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED | wxLIST_MASK_STATE);
- ple->m_bIsSelected = 0;
- /*ensure first item of selection is visible*/
- if (!first_sel) {
- first_sel = 1;
- top_idx = i;
- }
- }
- }
-
- if (m_cur_entry >= (s32) gf_list_count(m_entries)-1) m_cur_entry = gf_list_count(m_entries)-1;
- else {
- s32 last_idx = top_idx + m_FileList->GetCountPerPage();
- m_FileList->EnsureVisible(top_idx);
- if (gf_list_count(m_entries)<1+ (u32) last_idx) last_idx = gf_list_count(m_entries)-1;
- m_FileList->EnsureVisible(last_idx);
- }
-
- strcpy((char *) szPath, m_pApp->szAppPath);
-#ifdef WIN32
- strcat(szPath, "gpac_pl.m3u");
-#else
- strcat(szPath, ".gpac_pl.m3u");
-#endif
- Save(szPath, 1);
-}
-
-void wxPlaylist::OnAddFile(wxCommandEvent &WXUNUSED(event))
-{
- wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), m_pApp->GetFileFilter(), wxOPEN | wxCHANGE_DIR | /*wxHIDE_READONLY |*/ wxMULTIPLE);
-
- if (dlg.ShowModal() == wxID_OK) {
- wxArrayString stra;
- dlg.GetPaths(stra);
- for (u32 i=0; i<stra.GetCount(); i++) {
- PLEntry *ple = new PLEntry(stra[i]);
- gf_list_add(m_entries, ple);
- }
- m_all_dead_entries = -1;
- RefreshList();
- }
-}
-
-
-static Bool pl_enum_dir_item(void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info)
-{
- wxPlaylist *_this = (wxPlaylist *)cbck;
-
- if (gf_term_is_supported_url(_this->m_pApp->m_term, item_name, 0, 1)) {
- PLEntry *ple = new PLEntry(wxString(item_path, wxConvUTF8) );
- gf_list_add(_this->m_entries, ple);
- }
- return 0;
-}
-
-static Bool pl_enum_dir_dirs(void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info)
-{
- gf_enum_directory(item_path, 0, pl_enum_dir_item, cbck, NULL);
- gf_enum_directory(item_path, 1, pl_enum_dir_dirs, cbck, NULL);
- return 0;
-}
-
-
-void wxPlaylist::AddDir(Bool do_recurse)
-{
- wxDirDialog dlg(this);
- dlg.SetPath(wxString(szCacheDir, wxConvUTF8) );
- if (dlg.ShowModal() != wxID_OK) return;
-
- strcpy(szCacheDir, dlg.GetPath().mb_str(wxConvUTF8));
- gf_enum_directory(szCacheDir, 0, pl_enum_dir_item, this, NULL);
- if (do_recurse) gf_enum_directory(szCacheDir, 1, pl_enum_dir_dirs, this, NULL);
- m_all_dead_entries = -1;
- RefreshList();
-}
-void wxPlaylist::OnAddDir(wxCommandEvent &WXUNUSED(event))
-{
- AddDir(0);
-}
-void wxPlaylist::OnAddDirRec(wxCommandEvent &WXUNUSED(event))
-{
- AddDir(1);
-}
-
-void wxPlaylist::OnAddURL(wxCommandEvent &WXUNUSED(event))
-{
- OpenURLDlg dlg(this, m_pApp->m_user.config);
- if (dlg.ShowModal() != wxID_OK) return;
- PLEntry *ple = new PLEntry(dlg.m_urlVal);
- gf_list_add(m_entries, ple);
- m_all_dead_entries = -1;
- RefreshList();
-}
-
-void wxPlaylist::OnRemFile(wxCommandEvent &WXUNUSED(event))
-{
- if (!m_FileList->GetSelectedItemCount()) return;
-
- long item = -1;
- for (;;) {
- item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- if (item == -1) break;
- PLEntry *ple = (PLEntry *) m_FileList->GetItemData(item);
- gf_list_del_item(m_entries, ple);
- delete ple;
- }
- RefreshList();
-}
-
-void wxPlaylist::OnRemAll(wxCommandEvent &WXUNUSED(event))
-{
- Clear();
- RefreshList();
- m_cur_entry = -1;
- m_all_dead_entries = 1;
-}
-
-void wxPlaylist::OnRemDead(wxCommandEvent &WXUNUSED(event))
-{
- for (u32 i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- if (!ple->m_bIsDead) continue;
- gf_list_rem(m_entries, i);
- i--;
- delete ple;
- }
- m_all_dead_entries = gf_list_count(m_entries) ? 0 : 1;
- RefreshList();
-}
-
-
-void wxPlaylist::OnSelUp(wxCommandEvent &WXUNUSED(event))
-{
- s32 i;
- if (!m_FileList->GetSelectedItemCount()) return;
- long item = -1;
- item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- if (item <= 0) return;
-
- item = -1;
- for (;;) {
- item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- if (item == -1) break;
- PLEntry *ple = (PLEntry *) m_FileList->GetItemData(item);
- i = gf_list_del_item(m_entries, ple);
- assert(i>=1);
- gf_list_insert(m_entries, ple, i-1);
- ple->m_bIsSelected = 1;
- }
- RefreshList();
-}
-
-void wxPlaylist::OnSelDown(wxCommandEvent &WXUNUSED(event))
-{
- s32 i;
-
- if (!m_FileList->GetSelectedItemCount()) return;
- long item = -1;
- for (;;) {
- item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- if (item == -1) break;
- }
- if ((u32) item + 1 == gf_list_count(m_entries)) return;
-
- item = -1;
- for (;;) {
- item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- if (item == -1) break;
- PLEntry *ple = (PLEntry *) m_FileList->GetItemData(item);
- i = gf_list_del_item(m_entries, ple);
- assert(i>=1);
- gf_list_insert(m_entries, ple, i+1);
- ple->m_bIsSelected = 1;
- }
- RefreshList();
-}
-
-
-
-void wxPlaylist::OnSave(wxCommandEvent & WXUNUSED(event))
-{
- Bool save_m3u;
- char szPath[GF_MAX_PATH];
- if (!gf_list_count(m_entries)) return;
-
- wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), wxT("M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|"), wxSAVE | wxCHANGE_DIR | wxOVERWRITE_PROMPT);
- if (dlg.ShowModal() != wxID_OK) return;
-
- strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
- strlwr(szPath);
- save_m3u = (dlg.GetFilterIndex()==0) ? 1 : 0;
- if (save_m3u) {
- if (!strstr(szPath, ".m3u")) {
- strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
- strcat(szPath, ".m3u");
- } else {
- strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
- }
- } else {
- if (!strstr(szPath, ".pls")) {
- strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
- strcat(szPath, ".pls");
- } else {
- strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
- }
- }
- Save(szPath, save_m3u);
-}
-
-void wxPlaylist::Save(char *szPath, Bool save_m3u)
-{
- FILE *out = gf_fopen(szPath, "wt");
- if (!save_m3u)
- fprintf(out, "[playlist]\nNumberOfEntries=%d\n", gf_list_count(m_entries));
-
- for (u32 i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- if (save_m3u) {
- fprintf(out, "%s\n", ple->m_url);
- } else {
- fprintf(out, "File%d=%s\n", i+1, ple->m_url);
- fprintf(out, "Title%d=%s\n", i+1, ple->m_disp_name);
- if (ple->m_duration) fprintf(out, "Length%d=%d\n", i+1, ple->m_duration);
- else fprintf(out, "Length%d=-1\n", i+1);
- }
- }
- if (!save_m3u) fprintf(out, "Version=2\n");
-
- fprintf(out, "\n");
- gf_fclose(out);
-}
-
-void wxPlaylist::OnOpen(wxCommandEvent & WXUNUSED(event))
-{
- wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), wxT("M3U & PLS Playlists|*.m3u;*.pls|M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|"), wxOPEN | wxCHANGE_DIR/* | wxHIDE_READONLY*/);
- if (dlg.ShowModal() != wxID_OK) return;
-
- Clear();
- OpenPlaylist(dlg.GetPath());
- m_cur_entry = 0;
- Play();
-}
-
-void wxPlaylist::OpenPlaylist(wxString filename)
-{
- FILE *pl;
- PLEntry *ple;
- Bool load_m3u, go;
- char szLine[GF_MAX_PATH];
- pl = gf_fopen(filename.mb_str(wxConvUTF8) , "rt");
- if (!pl) return;
-
- ple = NULL;
- load_m3u = 1;
- while (!feof(pl)) {
- fgets(szLine, GF_MAX_PATH, pl);
- go = 1;
- while (go) {
- switch (szLine[strlen(szLine)-1]) {
- case '\n':
- case '\r':
- case ' ':
- szLine[strlen(szLine)-1] = 0;
- break;
- default:
- go = 0;
- break;
- }
- }
- if (!strlen(szLine)) continue;
- if (!stricmp(szLine, "[playlist]")) {
- load_m3u = 0;
- } else if (load_m3u) {
- ple = new PLEntry(wxString(szLine, wxConvUTF8) );
- gf_list_add(m_entries, ple);
- } else if (!strnicmp(szLine, "file", 4)) {
- char *st = strchr(szLine, '=');
- if (!st) ple = NULL;
- else {
- ple = new PLEntry(wxString(st + 1, wxConvUTF8) );
- gf_list_add(m_entries, ple);
- }
- } else if (ple && !strnicmp(szLine, "Length", 6)) {
- char *st = strchr(szLine, '=');
- s32 d = atoi(st + 1);
- if (d>0) ple->m_duration = d;
- } else if (ple && !strnicmp(szLine, "Title", 5)) {
- char *st = strchr(szLine, '=');
- gf_free(ple->m_disp_name);
- ple->m_disp_name = gf_strdup(st + 6);
- }
- }
- gf_fclose(pl);
- m_all_dead_entries = -1;
- m_cur_entry = -1;
- RefreshList();
-}
-
-void wxPlaylist::OnRightClick(wxListEvent & event)
-{
- if (!m_FileList->GetItemCount()) return;
-
- wxMenu *popup = new wxMenu();
-
- if (m_FileList->GetSelectedItemCount()==1) {
- popup->Append(ID_PL_PLAY, wxT("Play"));
- popup->AppendSeparator();
- }
- popup->Append(ID_PL_SEL_REV, wxT("Inverse Selection"));
- if (m_FileList->GetSelectedItemCount()) popup->Append(ID_PL_REM_FILE, wxT("Remove File(s)"));
- if (m_FileList->GetItemCount()>1) {
- popup->AppendSeparator();
- popup->Append(ID_PL_SORT_TITLE, wxT("Sort By Title"));
- popup->Append(ID_PL_SORT_FILE, wxT("Sort By File Name"));
- popup->Append(ID_PL_SORT_DUR, wxT("Sort By Duration"));
- popup->AppendSeparator();
- popup->Append(ID_PL_REVERSE, wxT("Reverse List"));
- popup->Append(ID_PL_RANDOMIZE, wxT("Randomize"));
- }
-
- PopupMenu(popup, event.GetPoint());
- delete popup;
-}
-
-void wxPlaylist::OnReverseSelection(wxCommandEvent &WXUNUSED(event) )
-{
- u32 i;
- long item = -1;
- for (;;) {
- item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- if (item == -1) break;
- PLEntry *ple = (PLEntry *) m_FileList->GetItemData(item);
- ple->m_bIsSelected = 1;
- }
- for (i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- ple->m_bIsSelected = !ple->m_bIsSelected;
- }
- RefreshList();
-}
-
-void wxPlaylist::OnReverseList(wxCommandEvent &WXUNUSED(event) )
-{
- u32 count = gf_list_count(m_entries);
- u32 hcount = count / 2;
- count--;
- for (u32 i=0; i<hcount; i++) {
- PLEntry *ple1 = (PLEntry *) gf_list_get(m_entries, i);
- PLEntry *ple2 = (PLEntry *) gf_list_get(m_entries, count-i);
- gf_list_rem(m_entries, i);
- gf_list_insert(m_entries, ple2, i);
- gf_list_rem(m_entries, count-i);
- gf_list_insert(m_entries, ple1, count-i);
- }
- RefreshList();
-}
-
-void wxPlaylist::OnRandomize(wxCommandEvent &WXUNUSED(event) )
-{
- GF_List *new_entries = gf_list_new();
-
- gf_rand_init(0);
-
- while (gf_list_count(m_entries)>1) {
- u32 pos = gf_rand() % (gf_list_count(m_entries)-1);
- PLEntry *ple = (PLEntry *)gf_list_get(m_entries, pos);
- gf_list_rem(m_entries, pos);
- gf_list_add(new_entries, ple);
- }
- PLEntry *ple = (PLEntry *)gf_list_get(m_entries, 0);
- gf_list_rem(m_entries, 0);
- gf_list_add(new_entries, ple);
-
- gf_list_del(m_entries);
- m_entries = new_entries;
- m_cur_entry = -1;
- RefreshList();
-}
-
-void wxPlaylist::Sort(u32 type)
-{
- u32 i, j, smallest;
-
- for (i=0; i<gf_list_count(m_entries)-1; i++) {
- smallest = i;
- for (j=i+1; j<gf_list_count(m_entries); j++) {
- PLEntry *ple2 = (PLEntry *) gf_list_get(m_entries, smallest);
- PLEntry *ple1 = (PLEntry *) gf_list_get(m_entries, j);
- s32 test = 0;
- switch (type) {
- case 0:
- test = stricmp(ple1->m_url, ple2->m_url);
- break;
- case 1:
- test = stricmp(ple1->m_disp_name, ple2->m_disp_name);
- break;
- case 2:
- test = ple1->m_duration - ple2->m_duration;
- break;
- }
- if (test<0) smallest = j;
- }
- PLEntry *ple = (PLEntry *)gf_list_get(m_entries, smallest);
- gf_list_rem(m_entries, smallest);
- gf_list_insert(m_entries, ple, i);
- }
- m_cur_entry = -1;
- RefreshList();
-}
-
-void wxPlaylist::OnSortFile(wxCommandEvent &WXUNUSED(event) ) {
- Sort(0);
-}
-void wxPlaylist::OnSortTitle(wxCommandEvent &WXUNUSED(event) ) {
- Sort(1);
-}
-void wxPlaylist::OnSortDuration(wxCommandEvent &WXUNUSED(event) ) {
- Sort(2);
-}
-
-void wxPlaylist::RefreshCurrent()
-{
- PLEntry *ple;
- if (m_cur_entry<0) return;
- ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple && ple->m_bIsPlaying) {
- ple->m_bIsPlaying = 0;
- UpdateEntry(m_cur_entry);
- }
-}
-
-Bool wxPlaylist::HasValidEntries()
-{
- u32 nb_dead = 0;
- if (m_all_dead_entries==-1) {
- for (u32 i=0; i<gf_list_count(m_entries); i++) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
- ple->m_bIsPlaying = 0;
- if (ple->m_bIsDead) nb_dead ++;
- }
- m_all_dead_entries = (nb_dead==gf_list_count(m_entries)) ? 1 : 0;
- }
- return !m_all_dead_entries;
-}
-
-void wxPlaylist::Play()
-{
- PLEntry *ple;
-
- if (!HasValidEntries()) return;
-
- RefreshCurrent();
-
- if (m_cur_entry >= (s32)gf_list_count(m_entries)) {
- if (!m_pApp->m_loop) return;
- m_cur_entry = 0;
- }
-
- ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (!ple || ple->m_bIsDead) {
- m_cur_entry++;
- Play();
- } else {
- char szPLE[20];
- ple->m_bIsPlaying = 1;
- UpdateEntry(m_cur_entry);
- sprintf(szPLE, "%d", m_cur_entry);
- gf_cfg_set_key(m_pApp->m_user.config, "General", "PLEntry", szPLE);
- m_pApp->DoConnect();
- }
-}
-
-void wxPlaylist::OnItemActivate(wxListEvent &WXUNUSED(event) )
-{
- long item = m_FileList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- if (item==-1) return;
- RefreshCurrent();
- m_cur_entry = item;
- Play();
-}
-
-
-void wxPlaylist::OnPlay(wxCommandEvent &WXUNUSED(event))
-{
- long item = m_FileList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- if (item==-1) return;
-
- RefreshCurrent();
- m_cur_entry = item;
- Play();
-}
-
-void wxPlaylist::Truncate()
-{
- if (m_cur_entry<0) return;
- while ((u32) m_cur_entry+1 < gf_list_count(m_entries)) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry+1);
- gf_list_rem(m_entries, m_cur_entry+1);
- delete ple;
- }
- RefreshList();
-}
-
-void wxPlaylist::QueueURL(wxString filename)
-{
- char *ext = (char*)strrchr(filename.mb_str(wxConvUTF8), '.');
- if (ext && (!stricmp(ext, ".m3u") || !stricmp(ext, ".pls")) ) {
- OpenPlaylist(filename);
- } else {
- PLEntry *ple = new PLEntry(filename);
- gf_list_add(m_entries, ple);
- }
-}
-
-void wxPlaylist::PlayNext()
-{
- RefreshCurrent();
- if (1+m_cur_entry < (s32)gf_list_count(m_entries)) {
- m_cur_entry++;
- Play();
- }
-}
-
-void wxPlaylist::PlayPrev()
-{
- RefreshCurrent();
- if (m_cur_entry>0) {
- m_cur_entry--;
- Play();
- }
-}
-
-void wxPlaylist::SetDead()
-{
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple) {
- ple->m_bIsDead = 1;
- UpdateEntry(m_cur_entry);
- if (ple->m_bIsPlaying) PlayNext();
- m_all_dead_entries = -1;
- }
-}
-void wxPlaylist::SetDuration(u32 duration)
-{
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple) {
- ple->m_duration = duration;
- UpdateEntry(m_cur_entry);
- }
-}
-
-wxString wxPlaylist::GetDisplayName()
-{
- if (m_cur_entry>=0) {
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple) return wxString(wxString(ple->m_disp_name, wxConvUTF8) );
- }
- return wxT("");
-}
-
-wxString wxPlaylist::GetURL()
-{
- PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
- if (ple) return wxString(ple->m_url, wxConvUTF8);
- return wxT("");
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-#ifndef _PLAYLIST_H
-#define _PLAYLIST_H
-
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-
-#include "menubtn.h"
-
-enum
-{
- ID_FILE_LIST = 1000,
-};
-
-class wxOsmo4Frame;
-
-class PLEntry
-{
-public:
- PLEntry(wxString url);
- ~PLEntry();
-
- char *m_url;
- char *m_disp_name;
- u32 m_duration;
-
- Bool m_bIsSelected;
- Bool m_bIsDead;
- Bool m_bIsPlaying;
-};
-
-
-class wxPlaylist : public wxFrame
-{
-public:
- wxPlaylist(wxWindow *parent);
- virtual ~wxPlaylist();
-
- void Clear();
- void ClearButPlaying();
- void RefreshList();
-
- void Truncate();
- void QueueURL(wxString filename);
- void Play();
- void PlayNext();
- void PlayPrev();
- void SetDead();
- void SetDuration(u32 duration);
- Bool HasValidEntries();
- void OpenPlaylist(wxString fileName);
-
- /*for current entry played*/
- wxString GetDisplayName();
- wxString GetURL();
-
- s32 m_cur_entry;
- GF_List *m_entries;
-
- wxOsmo4Frame *m_pApp;
-
-private:
- DECLARE_EVENT_TABLE()
-
- void OnClose(wxCloseEvent &event);
- void OnSize(wxSizeEvent &event);
- void OnAddFile(wxCommandEvent &event);
- void OnAddURL(wxCommandEvent &event);
- void OnAddDir(wxCommandEvent &event);
- void OnAddDirRec(wxCommandEvent &event);
- void OnRemFile(wxCommandEvent &event);
- void OnRemAll(wxCommandEvent &event);
- void OnRemDead(wxCommandEvent &event);
- void OnSelUp(wxCommandEvent &event);
- void OnSelDown(wxCommandEvent &event);
- void OnSave(wxCommandEvent &event);
- void OnOpen(wxCommandEvent &event);
- void OnRightClick(wxListEvent & event);
- void OnReverseSelection(wxCommandEvent &event);
- void OnReverseList(wxCommandEvent &event);
- void OnRandomize(wxCommandEvent &event);
- void OnSortFile(wxCommandEvent &event);
- void OnSortTitle(wxCommandEvent &event);
- void OnSortDuration(wxCommandEvent &event);
- void OnItemActivate(wxListEvent &event);
- void OnPlay(wxCommandEvent &event);
-
-
- void Sort(u32 type);
- void UpdateEntry(u32 idx);
- void RefreshCurrent();
- void Save(char *szPath, Bool save_m3u);
-
- wxBitmap *m_pOpen, *m_pSave, *m_pAdd, *m_pRem, *m_pUp, *m_pDown, *m_pSort;
- wxMenuButton *m_pAddBut, *m_pRemBut, *m_pSortBut;
- wxToolBar *m_pToolBar;
- wxListCtrl *m_FileList;
- char szCacheDir[GF_MAX_PATH];
- s32 m_all_dead_entries;
-
- void AddDir(Bool do_recurse);
-};
-
-
-
-#endif
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-#include "fileprops.h"
-#include "wxOsmo4.h"
-#include "Playlist.h"
-#include <wx/filename.h>
-#include <gpac/modules/codec.h>
-#include <gpac/modules/service.h>
-#include <gpac/constants.h>
-/*ISO 639 languages*/
-#include <gpac/iso639.h>
-
-
-wxFileProps::wxFileProps(wxWindow *parent)
- : wxDialog(parent, -1, wxString(_T("File Properties")))
-{
-
- m_pApp = (wxOsmo4Frame *)parent;
- SetSize(540, 260);
- assert(m_pApp->m_pPlayList);
-
- m_pTreeView = new wxTreeCtrl(this, ID_TREE_VIEW, wxPoint(4, 2), wxSize(200, 180), wxTR_DEFAULT_STYLE | wxSUNKEN_BORDER);
-
- new wxStaticText(this, 0, _T("Information"), wxPoint(210, 2), wxSize(60, 20));
- m_pViewSel = new wxComboBox(this, ID_VIEW_SEL, _T(""), wxPoint(280, 2), wxSize(120, 24), 0, NULL, wxCB_READONLY);
- m_pViewSel->Append(wxT("General"));
- m_pViewSel->Append(wxT("Streams"));
- m_pViewSel->Append(wxT("Playback"));
- m_pViewSel->Append(wxT("Network"));
- m_pViewSel->SetSelection(0);
-
- m_pViewInfo = new wxTextCtrl(this, -1, wxT(""), wxPoint(210, 30), wxSize(320, 200), wxTE_MULTILINE | wxTE_READONLY | wxHSCROLL | wxSUNKEN_BORDER);
-
-#ifdef WIN32
- m_pViewInfo->SetBackgroundColour(wxColour(wxT("LIGHT GREY")));
-#endif
-
- m_pViewWI = new wxButton(this, ID_VIEW_WI, wxT("View World Info"), wxPoint(4, 174), wxSize(200, 40));
- m_pViewSG = new wxButton(this, ID_VIEW_SG, wxT("View Scene Graph"), wxPoint(4, 220), wxSize(200, 40));
-
-
- wxString str = m_pApp->m_pPlayList->GetDisplayName();
- str += wxT(" Properties");
- SetTitle(str);
-
- m_pTimer = new wxTimer();
- m_pTimer->SetOwner(this, ID_OD_TIMER);
- m_pTimer->Start(500, 0);
- RewriteODTree();
-
-}
-
-wxFileProps::~wxFileProps()
-{
- m_pTimer->Stop();
- delete m_pTimer;
-}
-
-
-BEGIN_EVENT_TABLE(wxFileProps, wxDialog)
- EVT_TREE_ITEM_ACTIVATED(ID_TREE_VIEW, wxFileProps::OnSetSelection)
- EVT_TREE_SEL_CHANGED(ID_TREE_VIEW, wxFileProps::OnSetSelection)
- EVT_TREE_ITEM_EXPANDED(ID_TREE_VIEW, wxFileProps::OnSetSelection)
- EVT_TREE_ITEM_COLLAPSED(ID_TREE_VIEW, wxFileProps::OnSetSelection)
- EVT_TIMER(ID_OD_TIMER, wxFileProps::OnTimer)
- EVT_BUTTON(ID_VIEW_SG, wxFileProps::OnViewSG)
- EVT_BUTTON(ID_VIEW_WI, wxFileProps::OnViewWorld)
- EVT_COMBOBOX(ID_VIEW_SEL, wxFileProps::OnSelectInfo)
-END_EVENT_TABLE()
-
-void wxFileProps::RewriteODTree()
-{
- GF_ObjectManager *root_odm = gf_term_get_root_object(m_pApp->m_term);
- if (!root_odm) return;
-
- m_pTreeView->DeleteAllItems();
- ODTreeData *root = new ODTreeData(root_odm);
- m_pTreeView->AddRoot(wxT("Root OD"), -1, -1, root);
- wxTreeItemId rootId = m_pTreeView->GetRootItem();
-
- WriteInlineTree(root);
- SetInfo(root_odm);
-}
-
-void wxFileProps::WriteInlineTree(ODTreeData *root)
-{
- /*browse all ODs*/
- u32 count = gf_term_get_object_count(m_pApp->m_term, root->m_pODMan);
-
- for (u32 i=0; i<count; i++) {
- GF_ObjectManager *odm = gf_term_get_object(m_pApp->m_term, root->m_pODMan, i);
- if (!odm) return;
- ODTreeData *odd = new ODTreeData(odm);
- m_pTreeView->AppendItem(root->GetId(), wxT("Object Descriptor"), -1, -1, odd);
-
- /*if inline propagate*/
- switch (gf_term_object_subscene_type(m_pApp->m_term, odm)) {
- case 1:
- m_pTreeView->SetItemText(odd->GetId(), wxT("Root Scene"));
- WriteInlineTree(odd);
- break;
- case 2:
- m_pTreeView->SetItemText(odd->GetId(), wxT("Inline Scene"));
- WriteInlineTree(odd);
- break;
- case 3:
- m_pTreeView->SetItemText(odd->GetId(), wxT("Extern Proto Lib"));
- break;
- default:
- break;
- }
- }
-}
-
-void wxFileProps::OnSetSelection(wxTreeEvent& event)
-{
- ODTreeData *odd = (ODTreeData *) m_pTreeView->GetItemData(event.GetItem());
- SetInfo(odd->m_pODMan);
-}
-
-void wxFileProps::SetInfo(GF_ObjectManager *odm)
-{
- m_current_odm = odm;
-
- switch (m_pViewSel->GetSelection()) {
- case 3:
- SetNetworkInfo();
- break;
- case 2:
- SetDecoderInfo();
- break;
- case 1:
- SetStreamsInfo();
- break;
- default:
- SetGeneralInfo();
- break;
- }
-}
-
-void wxFileProps::OnTimer(wxTimerEvent& WXUNUSED(event))
-{
- switch (m_pViewSel->GetSelection()) {
- case 2:
- SetDecoderInfo();
- break;
- }
-}
-void wxFileProps::OnSelectInfo(wxCommandEvent & WXUNUSED(event) )
-{
- SetInfo(m_current_odm);
-}
-
-void wxFileProps::SetGeneralInfo()
-{
- wxString info;
- GF_MediaInfo odi;
- u32 h, m, s;
- u32 i, j;
-
- info = wxT("");
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
-
- if (!m_current_odm || gf_term_get_object_info(m_pApp->m_term, m_current_odm, &odi) != GF_OK) return;
-
- if (odi.has_profiles) info += wxT("Initial ");
- info += wxString::Format(wxT("Object Descriptor ID %d\n"), odi.od->objectDescriptorID);
- if (odi.duration) {
- h = (u32) (odi.duration / 3600);
- m = (u32) (odi.duration / 60) - h*60;
- s = (u32) (odi.duration) - h*3600 - m*60;
- info += wxString::Format(wxT("Duration %02d:%02d:%02d\n"), h, m, s);
- } else {
- info += wxT("Unknown duration\n");
- }
-
- if (odi.owns_service) {
- info += wxT("Service Handler: ") + wxString(odi.service_handler, wxConvUTF8) + wxT("\n");
- info += wxT("Service URL: ") + wxString(odi.service_url, wxConvUTF8) + wxT("\n");
- }
-
- if (odi.od->URLString) {
- info += wxT("Remote OD - URL: ") + wxString(odi.od->URLString, wxConvUTF8) + wxT("\n");
- }
-
- if (odi.codec_name) {
- switch (odi.od_type) {
- case GF_STREAM_VISUAL:
- info += wxString::Format(wxT("Video Object: Width %d - Height %d\n"), odi.width, odi.height);
- info += wxT("Media Codec ") + wxString(odi.codec_name, wxConvUTF8) + wxT("\n");
- break;
- case GF_STREAM_AUDIO:
- info += wxString::Format(wxT("Audio Object: Sample Rate %d - %d channels\n"), odi.sample_rate, odi.num_channels);
- info += wxT("Media Codec ") + wxString(odi.codec_name, wxConvUTF8) + wxT("\n");
- break;
- case GF_STREAM_PRIVATE_SCENE:
- case GF_STREAM_SCENE:
- if (odi.width && odi.height) {
- info += wxString::Format(wxT("Scene Description: Width %d - Height %d\n"), odi.width, odi.height);
- } else {
- info += wxT("Scene Description: No size specified\n");
- }
- info += wxT("Scene Codec ") + wxString(odi.codec_name, wxConvUTF8) + wxT("\n");
- break;
- case GF_STREAM_TEXT:
- if (odi.width && odi.height) {
- info += wxString::Format(wxT("Text Object: Width %d - Height %d\n"), odi.width, odi.height);
- } else {
- info += wxString::Format(wxT("Text Object: No size specified\n"));
- }
- info += wxT("Text Codec ") + wxString(odi.codec_name, wxConvUTF8) + wxT("\n");
- break;
- }
- }
- if (odi.protection==2) info += wxT("Encrypted Media NOT UNLOCKED");
- else if (odi.protection==1) info += wxT("Encrypted Media");
-
- if (!gf_list_count(odi.od->OCIDescriptors)) {
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
- return;
- }
-
- info += wxT("\nObject Content Information:\n");
-
- /*check OCI (not everything interests us) - FIXME: support for unicode*/
- for (i=0; i<gf_list_count(odi.od->OCIDescriptors); i++) {
- GF_Descriptor *desc = (GF_Descriptor *) gf_list_get(odi.od->OCIDescriptors, i);
- switch (desc->tag) {
- case GF_ODF_SEGMENT_TAG:
- {
- GF_Segment *sd = (GF_Segment *) desc;
- info += wxT("\nSegment Descriptor:\nName: ") + wxString((char *) sd->SegmentName, wxConvUTF8);
- info += wxString::Format(wxT(" - start time %g sec - duration %g sec\n"), sd->startTime, sd->Duration);
- }
- break;
- case GF_ODF_CC_NAME_TAG:
- {
- GF_CC_Name *ccn = (GF_CC_Name *)desc;
- info += wxT("\nContent Creators:\n");
- for (j=0; j<gf_list_count(ccn->ContentCreators); j++) {
- GF_ContentCreatorInfo *ci = (GF_ContentCreatorInfo *) gf_list_get(ccn->ContentCreators, j);
- if (!ci->isUTF8) continue;
- info += wxT("\t") + wxString(ci->contentCreatorName, wxConvUTF8) + wxT("\n");
- }
- }
- break;
-
- case GF_ODF_SHORT_TEXT_TAG:
- {
- GF_ShortTextual *std = (GF_ShortTextual *)desc;
- info += wxT("\n") + wxString(std->eventName, wxConvUTF8) + wxT(": ") + wxString(std->eventText, wxConvUTF8) + wxT("\n");
- }
- break;
- /*todo*/
- case GF_ODF_CC_DATE_TAG:
- break;
- default:
- break;
- }
-
- }
-
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
-}
-
-void wxFileProps::SetStreamsInfo()
-{
- u32 i, count;
- wxString info;
- GF_MediaInfo odi;
- char code[5];
-
- info = wxT("");
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
-
- if (!m_current_odm || gf_term_get_object_info(m_pApp->m_term, m_current_odm, &odi) != GF_OK) return;
-
- if (odi.has_profiles) {
- info += wxString::Format(wxT("\tOD Profile@Level %d\n"), odi.OD_pl);
- info += wxString::Format(wxT("\tScene Profile@Level %d\n"), odi.scene_pl);
- info += wxString::Format(wxT("\tGraphics Profile@Level %d\n"), odi.graphics_pl);
- info += wxString::Format(wxT("\tAudio Profile@Level %d\n"), odi.audio_pl);
- info += wxString::Format(wxT("\tVisual Profile@Level %d\n"), odi.scene_pl);
- if (odi.inline_pl) info += wxT("\tInline Content use same profiles\n");
- info += wxT("\n");
- }
-
- count = gf_list_count(odi.od->ESDescriptors);
-
- for (i=0; i<count; i++) {
- GF_ESD *esd = (GF_ESD *) gf_list_get(odi.od->ESDescriptors, i);
-
- info += wxString::Format(wxT("Stream ID %d - Clock ID %d\n"), esd->ESID, esd->OCRESID);
- if (esd->dependsOnESID) {
- info += wxString::Format(wxT("\tDepends on Stream ID %d for decoding\n"), esd->dependsOnESID);
- }
- switch (esd->decoderConfig->streamType) {
- case GF_STREAM_OD:
- info += wxString::Format(wxT("\tOD Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
- break;
- case GF_STREAM_OCR:
- info += wxT("\tObject Clock Reference Stream\n");
- break;
- case GF_STREAM_SCENE:
- info += wxString::Format(wxT("\tScene Description Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
- break;
- case GF_STREAM_PRIVATE_SCENE:
- info += wxString::Format(wxT("\tGPAC Private Scene Description Stream\n"));
- break;
- case GF_STREAM_VISUAL:
- info += wxT("\tVisual Stream - media type: ");
- switch (esd->decoderConfig->objectTypeIndication) {
- case GPAC_OTI_VIDEO_MPEG4_PART2:
- info += wxT("MPEG-4\n");
- break;
- case GPAC_OTI_VIDEO_MPEG2_SIMPLE:
- info += wxT("MPEG-2 Simple Profile\n");
- break;
- case GPAC_OTI_VIDEO_MPEG2_MAIN:
- info += wxT("MPEG-2 Main Profile\n");
- break;
- case GPAC_OTI_VIDEO_MPEG2_SNR:
- info += wxT("MPEG-2 SNR Profile\n");
- break;
- case GPAC_OTI_VIDEO_MPEG2_SPATIAL:
- info += wxT("MPEG-2 Spatial Profile\n");
- break;
- case GPAC_OTI_VIDEO_MPEG2_HIGH:
- info += wxT("MPEG-2 High Profile\n");
- break;
- case GPAC_OTI_VIDEO_MPEG2_422:
- info += wxT("MPEG-2 422 Profile\n");
- break;
- case GPAC_OTI_VIDEO_MPEG1:
- info += wxT("MPEG-1\n");
- break;
- case GPAC_OTI_IMAGE_JPEG:
- info += wxT("JPEG\n");
- break;
- case GPAC_OTI_IMAGE_PNG:
- info += wxT("PNG\n");
- break;
- case GPAC_OTI_IMAGE_JPEG_2000:
- info += wxT("JPEG2000\n");
- break;
- case 0x80:
- memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
- code[4] = 0;
- info += wxT("GPAC Intern (") + wxString(code, wxConvUTF8) + wxT(")\n");
- break;
- default:
- info += wxString::Format(wxT("Private/Unknown Type (0x%x)\n"), esd->decoderConfig->objectTypeIndication);
- break;
- }
- break;
-
- case GF_STREAM_AUDIO:
- info += wxT("\tAudio Stream - media type: ");
- switch (esd->decoderConfig->objectTypeIndication) {
- case GPAC_OTI_AUDIO_AAC_MPEG4:
- info += wxT("MPEG-4\n");
- break;
- case GPAC_OTI_AUDIO_AAC_MPEG2_MP:
- info += wxT("MPEG-2 AAC Main Profile\n");
- break;
- case GPAC_OTI_AUDIO_AAC_MPEG2_LCP:
- info += wxT("MPEG-2 AAC LowComplexity Profile\n");
- break;
- case GPAC_OTI_AUDIO_AAC_MPEG2_SSRP:
- info += wxT("MPEG-2 AAC Scalable Sampling Rate Profile\n");
- break;
- case GPAC_OTI_AUDIO_MPEG2_PART3:
- info += wxT("MPEG-2 Audio\n");
- break;
- case GPAC_OTI_AUDIO_MPEG1:
- info += wxT("MPEG-1 Audio\n");
- break;
- case 0xA0:
- info += wxT("EVRC Audio\n");
- break;
- case 0xA1:
- info += wxT("SMV Audio\n");
- break;
- case 0xE1:
- info += wxT("QCELP Audio\n");
- break;
- case 0x80:
- memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
- code[4] = 0;
- info += wxT("GPAC Intern (") + wxString(code, wxConvUTF8) + wxT(")\n");
- break;
- default:
- info += wxString::Format(wxT("Private/Unknown Type (0x%x)\n"), esd->decoderConfig->objectTypeIndication);
- break;
- }
- break;
- case GF_STREAM_MPEG7:
- info += wxString::Format(wxT("\tMPEG-7 Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
- break;
- case GF_STREAM_IPMP:
- info += wxString::Format(wxT("\tIPMP Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
- break;
- case GF_STREAM_OCI:
- info += wxString::Format(wxT("\tOCI Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
- break;
- case GF_STREAM_MPEGJ:
- info += wxString::Format(wxT("\tMPEGJ Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
- break;
- case GF_STREAM_INTERACT:
- info += wxString::Format(wxT("\tUser Interaction Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
- break;
- default:
- info += wxT("Private/Unknown\n");
- break;
- }
-
- info += wxString::Format(wxT("\tBuffer Size %d\n\tAverage Bitrate %d bps\n\tMaximum Bitrate %d bps\n"), esd->decoderConfig->bufferSizeDB, esd->decoderConfig->avgBitrate, esd->decoderConfig->maxBitrate);
- if (esd->slConfig->predefined==SLPredef_SkipSL) {
- info += wxString::Format(wxT("\tNot using MPEG-4 Synchronization Layer\n"));
- } else {
- info += wxString::Format(wxT("\tStream Clock Resolution %d\n"), esd->slConfig->timestampResolution);
- }
- if (esd->URLString)
- info += wxT("\tStream Location: ") + wxString(esd->URLString, wxConvUTF8) + wxT("\n");
-
- /*check language*/
- if (esd->langDesc) {
- s32 idx;
- char lan[4];
- lan[0] = esd->langDesc->langCode>>16;
- lan[1] = (esd->langDesc->langCode>>8)&0xFF;
- lan[2] = (esd->langDesc->langCode)&0xFF;
- lan[3] = 0;
- idx = gf_lang_find(lan);
- if (idx>=0) {
- info += wxString::Format(wxT("\tStream Language: %s\n"), gf_lang_get_name(idx) );
- }
- }
-
- }
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
-}
-
-
-void wxFileProps::SetDecoderInfo()
-{
- GF_MediaInfo odi;
- wxString info;
- u32 h, m, s;
-
- if (!m_current_odm || gf_term_get_object_info(m_pApp->m_term, m_current_odm, &odi)) {
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
- return;
- }
-
- info = wxT("Status: ");
- switch (odi.status) {
- case 0:
- case 1:
- case 2:
- h = (u32) (odi.current_time / 3600);
- m = (u32) (odi.current_time / 60) - h*60;
- s = (u32) (odi.current_time) - h*3600 - m*60;
- if (odi.status==0) info += wxT("Stopped");
- else if (odi.status==1) info += wxT("Playing");
- else info += wxT("Paused");
- info += wxString::Format(wxT("\nObject Time: %02d:%02d:%02d\n"), h, m, s);
- break;
- case 3:
- info += wxT("Not Setup\n");
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
- return;
- default:
- info += wxT("Setup Failed\n");
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
- return;
- }
- /*get clock drift*/
- info += wxString::Format(wxT("Clock drift: %d ms\n"), odi.clock_drift);
- /*get buffering*/
- if (odi.buffer>=0) info += wxString::Format(wxT("Buffering Time: %d ms\n"), odi.buffer);
- else if (odi.buffer==-1) info += wxT("Not buffering\n");
- else info += wxT("Not Playing\n");
-
- /*get DB occupation*/
- if (odi.buffer>=0) info += wxString::Format(wxT("Decoding Buffer: %d Access Units\n"), odi.db_unit_count);
- /*get CB occupation*/
- if (odi.cb_max_count)
- info += wxString::Format(wxT("Composition Memory: %d/%d Units\n"), odi.cb_unit_count, odi.cb_max_count);
-
- Float avg_dec_time = 0;
- if (odi.nb_dec_frames) {
- avg_dec_time = (Float) odi.total_dec_time;
- avg_dec_time /= odi.nb_dec_frames;
- }
- info += wxString::Format(wxT("Average Bitrate %d kbps (%d max)\nAverage Decoding Time %.2f ms (%d max)\nTotal decoded frames %d - %d dropped\n"),
- (u32) odi.avg_bitrate/1024, odi.max_bitrate/1024, avg_dec_time, odi.max_dec_time, odi.nb_dec_frames, odi.nb_dropped);
-
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
-}
-
-void wxFileProps::SetNetworkInfo()
-{
- wxString info;
- u32 id;
- NetStatCommand com;
- GF_MediaInfo odi;
- u32 d_enum;
- GF_Err e;
-
- info = wxT("");
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(wxT(""));
-
- if (!m_current_odm || gf_term_get_object_info(m_pApp->m_term, m_current_odm, &odi) != GF_OK) return;
-
- if (odi.owns_service) {
- const char *url, *path;
- u32 done, total, bps;
- info = wxT("Current Downloads in service:\n");
- d_enum = 0;
- while (gf_term_get_download_info(m_pApp->m_term, m_current_odm, &d_enum, &url, &path, &done, &total, &bps)) {
- info += wxString(url, wxConvUTF8);
- if (total) {
- info += wxString::Format(wxT(": %d / %d bytes (%.2f %%) - %.2f kBps\n"), done, total, (100.0*done)/total, ((Double)bps)/1024);
- } else {
- info += wxString::Format(wxT(": %.2f kBps\n"), ((Double)bps)/1024);
- }
- }
- if (!d_enum) info = wxT("No Downloads in service\n");
- info += wxT("\n");
- }
-
- d_enum = 0;
- while (gf_term_get_channel_net_info(m_pApp->m_term, m_current_odm, &d_enum, &id, &com, &e)) {
- if (e) continue;
- if (!com.bw_down && !com.bw_up) continue;
-
- info += wxString::Format(wxT("Stream ID %d statistics:\n"), id);
- if (com.multiplex_port) {
- info += wxString::Format(wxT("\tMultiplex Port %d - multiplex ID %d\n"), com.multiplex_port, com.port);
- } else {
- info += wxString::Format(wxT("\tPort %d\n"), com.port);
- }
- info += wxString::Format(wxT("\tPacket Loss Percentage: %.4f\n"), com.pck_loss_percentage);
- info += wxString::Format(wxT("\tDown Bandwidth: %.3f bps\n"), ((Float)com.bw_down)/1024);
- if (com.bw_up) info += wxString::Format(wxT("\tUp Bandwidth: %d bps\n"), com.bw_up);
- if (com.ctrl_port) {
- if (com.multiplex_port) {
- info += wxString::Format(wxT("\tControl Multiplex Port: %d - Control Multiplex ID %d\n"), com.multiplex_port, com.ctrl_port);
- } else {
- info += wxString::Format(wxT("\tControl Port: %d\n"), com.ctrl_port);
- }
- info += wxString::Format(wxT("\tControl Down Bandwidth: %d bps\n"), com.ctrl_bw_down);
- info += wxString::Format(wxT("\tControl Up Bandwidth: %d bps\n"), com.ctrl_bw_up);
- }
- info += wxT("\n");
- }
- m_pViewInfo->Clear();
- m_pViewInfo->AppendText(info);
-}
-
-
-void wxFileProps::OnViewWorld(wxCommandEvent &WXUNUSED(event))
-{
- wxString wit;
- const char *str;
- GF_List *descs;
- descs = gf_list_new();
- str = gf_term_get_world_info(m_pApp->m_term, m_current_odm, descs);
-
- if (!str) {
- wxMessageDialog(this, wxT("No World Info available"), wxT("Sorry!"), wxOK).ShowModal();
- return;
- }
-
- wit = wxT("");
- for (u32 i=0; gf_list_count(descs); i++) {
- const char *d = (const char *) gf_list_get(descs, i);
- wit += wxString(d, wxConvUTF8);
- wit += wxT("\n");
- }
- wxMessageDialog(this, wit, wxString(str, wxConvUTF8), wxOK).ShowModal();
- gf_list_del(descs);
-}
-
-void wxFileProps::OnViewSG(wxCommandEvent &WXUNUSED(event))
-{
- const char *sOpt;
- Bool dump_xmt;
- wxFileName out_file;
- char szOutFile[GF_MAX_PATH];
- wxString fname;
-
- sOpt = gf_cfg_get_key(m_pApp->m_user.config, "Core", "CacheDirectory");
- out_file.AssignDir(wxString(sOpt, wxConvUTF8) );
-
- sOpt = gf_cfg_get_key(m_pApp->m_user.config, "General", "ViewXMT");
- out_file.SetFullName(wxT("scene_dump"));
- if (sOpt && !stricmp(sOpt, "yes")) {
- dump_xmt = 1;
- } else {
- dump_xmt = 0;
- }
- strcpy(szOutFile, out_file.GetFullName().mb_str(wxConvUTF8));
-
- GF_Err e = gf_term_dump_scene(m_pApp->m_term, szOutFile, NULL, dump_xmt, 0, m_current_odm);
- if (e) {
- wxMessageDialog dlg(this, wxString(gf_error_to_string(e), wxConvUTF8), wxT("Error while dumping"), wxOK);
- dlg.ShowModal();
- } else {
- wxString cmd = get_pref_browser(m_pApp->m_user.config);
- cmd += wxT(" ");
- cmd += wxString(szOutFile, wxConvUTF8);
- wxExecute(cmd);
- }
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-#ifndef _FILEPROPS_H
-#define _FILEPROPS_H
-
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-
-#include <wx/treectrl.h>
-
-#include <gpac/terminal.h>
-
-/*abstract class for all items in the tree*/
-class ODTreeData : public wxTreeItemData
-{
-public:
- ODTreeData(GF_ObjectManager *odm) : wxTreeItemData(), m_pODMan(odm) {}
- GF_ObjectManager *m_pODMan;
-};
-
-
-class wxOsmo4Frame;
-class wxFileProps : public wxDialog
-{
-public:
- wxFileProps(wxWindow *parent);
- virtual ~wxFileProps();
-
-private:
- DECLARE_EVENT_TABLE()
-
- wxOsmo4Frame *m_pApp;
-
- wxTreeCtrl *m_pTreeView;
- wxTextCtrl *m_pViewInfo;
- wxComboBox *m_pViewSel;
- wxButton *m_pViewWI, *m_pViewSG;
- wxTimer *m_pTimer;
-
- GF_ObjectManager *m_current_odm;
-
- void RewriteODTree();
- void SetGeneralInfo();
- void SetStreamsInfo();
- void SetDecoderInfo();
- void SetNetworkInfo();
- void WriteInlineTree(ODTreeData *pRoot);
- void OnSetSelection(wxTreeEvent &event);
- void OnSelectInfo(wxCommandEvent &event);
- void OnTimer(wxTimerEvent &event);
- void OnViewWorld(wxCommandEvent &event);
- void OnViewSG(wxCommandEvent &event);
- void SetInfo(GF_ObjectManager *odm);
-};
-
-#endif
-
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: wxMenuButton
-// Purpose: A button with a dropdown wxMenu
-// Author: John Labenski
-// Modified by:
-// Created: 11/05/2002
-// RCS-ID:
-// Copyright: (c) John Labenki
-// Licence: wxWidgets licence
-/////////////////////////////////////////////////////////////////////////////
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "menubtn.h"
-#endif
-
-// For compilers that support precompilation, includes "wx/wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#include "wx/control.h"
-#include "wx/menu.h"
-#include "wx/settings.h"
-#include "wx/bitmap.h"
-#include "wx/pen.h"
-#include "wx/dc.h"
-#endif // WX_PRECOMP
-
-#include <wx/tglbtn.h>
-#include <wx/dcclient.h>
-#include <wx/timer.h>
-#include <wx/image.h>
-
-#include "menubtn.h"
-
-
-
-// ==========================================================================
-// wxCustomButton
-// ==========================================================================
-IMPLEMENT_DYNAMIC_CLASS( wxCustomButton, wxControl )
-
-BEGIN_EVENT_TABLE(wxCustomButton,wxControl)
- EVT_MOUSE_EVENTS ( wxCustomButton::OnMouseEvents )
- EVT_PAINT ( wxCustomButton::OnPaint )
- EVT_SIZE ( wxCustomButton::OnSize )
-END_EVENT_TABLE()
-
-wxCustomButton::~wxCustomButton()
-{
- if (HasCapture()) ReleaseMouse();
- if (m_timer) delete m_timer;
-}
-
-void wxCustomButton::Init()
-{
- m_focused = FALSE;
- m_labelMargin = wxSize(4,4);
- m_bitmapMargin = wxSize(2,2);
- m_down = 0;
- m_timer = NULL;
- m_eventType = 0;
- m_button_style = wxCUSTBUT_TOGGLE|wxCUSTBUT_BOTTOM;
-}
-
-bool wxCustomButton::Create(wxWindow* parent, wxWindowID id,
- const wxString& label, const wxBitmap &bitmap,
- const wxPoint& pos, const wxSize& size,
- long style, const wxValidator& val,
- const wxString& name)
-{
- if (!wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name))
- return FALSE;
-
- wxControl::SetLabel(label);
- wxControl::SetBackgroundColour(parent->GetBackgroundColour());
- wxControl::SetForegroundColour(parent->GetForegroundColour());
- wxControl::SetFont(parent->GetFont());
-
- if (bitmap.Ok()) m_bmpLabel = bitmap;
-
- if (!SetButtonStyle(style)) return FALSE;
-
- wxSize bestSize = DoGetBestSize();
- SetSize(wxSize(size.x<0 ? bestSize.x:size.x, size.y<0 ? bestSize.y:size.y));
-#if (wxMINOR_VERSION<8)
- SetBestSize(GetSize());
-#else
- SetInitialSize(GetSize());
-#endif
-
- CalcLayout(TRUE);
- return TRUE;
-}
-
-void wxCustomButton::SetValue(bool depressed)
-{
- wxCHECK_RET(!(m_button_style & wxCUSTBUT_NOTOGGLE), wxT("can't set button state"));
- m_down = depressed ? 1 : 0;
- Refresh(FALSE);
-}
-
-bool wxCustomButton::SetButtonStyle(long style)
-{
- int n_styles = 0;
- if ((style & wxCUSTBUT_LEFT) != 0) n_styles++;
- if ((style & wxCUSTBUT_RIGHT) != 0) n_styles++;
- if ((style & wxCUSTBUT_TOP) != 0) n_styles++;
- if ((style & wxCUSTBUT_BOTTOM) != 0) n_styles++;
- wxCHECK_MSG(n_styles < 2, FALSE, wxT("Only one wxCustomButton label position allowed"));
-
- n_styles = 0;
- if ((style & wxCUSTBUT_NOTOGGLE) != 0) n_styles++;
- if ((style & wxCUSTBUT_BUTTON) != 0) n_styles++;
- if ((style & wxCUSTBUT_TOGGLE) != 0) n_styles++;
- if ((style & wxCUSTBUT_BUT_DCLICK_TOG) != 0) n_styles++;
- if ((style & wxCUSTBUT_TOG_DCLICK_BUT) != 0) n_styles++;
- wxCHECK_MSG(n_styles < 2, FALSE, wxT("Only one wxCustomButton style allowed"));
-
- m_button_style = style;
-
- if ((m_button_style & wxCUSTBUT_BUTTON) != 0)
- m_down = 0;
-
- CalcLayout(TRUE);
- return TRUE;
-}
-
-void wxCustomButton::SetLabel( const wxString &label )
-{
- wxControl::SetLabel(label);
- CalcLayout(TRUE);
-}
-
-// sequence of events in GTK is up, dclick, up.
-
-void wxCustomButton::OnMouseEvents(wxMouseEvent& event)
-{
- if (m_button_style & wxCUSTBUT_NOTOGGLE) return;
-
- if (event.LeftDown() || event.RightDown())
- {
- if (!HasCapture())
- CaptureMouse(); // keep depressed until up
-
- m_down++;
- Redraw();
- }
- else if (event.LeftDClick() || event.RightDClick())
- {
- m_down++; // GTK eats second down event
- Redraw();
- }
- else if (event.LeftUp())
- {
- if (HasCapture())
- ReleaseMouse();
-
- m_eventType = wxEVT_LEFT_UP;
-
-#if (wxMINOR_VERSION<8)
- if (wxRect(wxPoint(0,0), GetSize()).Inside(event.GetPosition()))
-#else
- if (wxRect(wxPoint(0,0), GetSize()).Contains(event.GetPosition()))
-#endif
- {
- if ((m_button_style & wxCUSTBUT_BUTTON) && (m_down > 0))
- {
- m_down = 0;
- Redraw();
- SendEvent();
- return;
- }
- else
- {
- if (!m_timer)
- {
- m_timer = new wxTimer(this, m_down+1);
- m_timer->Start(200, TRUE);
- }
- else
- {
- m_eventType = wxEVT_LEFT_DCLICK;
- }
-
- if ((m_button_style & wxCUSTBUT_TOGGLE) &&
- (m_button_style & wxCUSTBUT_TOG_DCLICK_BUT)) m_down++;
- }
- }
-
- Redraw();
- }
- else if (event.RightUp())
- {
- if (HasCapture())
- ReleaseMouse();
-
- m_eventType = wxEVT_RIGHT_UP;
-
-#if (wxMINOR_VERSION<8)
- if (wxRect(wxPoint(0,0), GetSize()).Inside(event.GetPosition()))
-#else
- if (wxRect(wxPoint(0,0), GetSize()).Contains(event.GetPosition()))
-#endif
- {
- if ((m_button_style & wxCUSTBUT_BUTTON) && (m_down > 0))
- {
- m_down = 0;
- Redraw();
- SendEvent();
- return;
- }
- else
- {
- m_down++;
-
- if (!m_timer)
- {
- m_timer = new wxTimer(this, m_down);
- m_timer->Start(250, TRUE);
- }
- else
- {
- m_eventType = wxEVT_RIGHT_DCLICK;
- }
- }
- }
-
- Redraw();
- }
- else if (event.Entering())
- {
- m_focused = TRUE;
- if ((event.LeftIsDown() || event.RightIsDown()) && HasCapture())
- m_down++;
-
- Redraw();
- }
- else if (event.Leaving())
- {
- m_focused = FALSE;
- if ((event.LeftIsDown() || event.RightIsDown()) && HasCapture())
- m_down--;
-
- Redraw();
- }
-}
-
-
-
-void wxCustomButton::SendEvent()
-{
- if (((m_button_style & wxCUSTBUT_TOGGLE) && (m_eventType == wxEVT_LEFT_UP)) ||
- ((m_button_style & wxCUSTBUT_BUT_DCLICK_TOG) && (m_eventType == wxEVT_LEFT_DCLICK)) ||
- ((m_button_style & wxCUSTBUT_TOG_DCLICK_BUT) && (m_eventType == wxEVT_LEFT_UP)))
- {
- wxCommandEvent eventOut(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, GetId());
- eventOut.SetInt(m_down%2 ? 1 : 0);
- eventOut.SetExtraLong(m_eventType);
- eventOut.SetEventObject(this);
- GetEventHandler()->ProcessEvent(eventOut);
- }
- else
- {
- wxCommandEvent eventOut(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
- eventOut.SetInt(0);
- eventOut.SetExtraLong(m_eventType);
- eventOut.SetEventObject(this);
- GetEventHandler()->ProcessEvent(eventOut);
- }
-}
-
-wxBitmap wxCustomButton::CreateBitmapDisabled(const wxBitmap &bitmap) const
-{
- wxCHECK_MSG(bitmap.Ok(), wxNullBitmap, wxT("invalid bitmap"));
-
- unsigned char br = GetBackgroundColour().Red();
- unsigned char bg = GetBackgroundColour().Green();
- unsigned char bb = GetBackgroundColour().Blue();
-
- wxImage image = bitmap.ConvertToImage();
- int pos, width = image.GetWidth(), height = image.GetHeight();
- unsigned char *img_data = image.GetData();
-
- for (int j=0; j<height; j++)
- {
- for (int i=j%2; i<width; i+=2)
- {
- pos = (j*width+i)*3;
- img_data[pos ] = br;
- img_data[pos+1] = bg;
- img_data[pos+2] = bb;
- }
- }
-
- return wxBitmap(image);
-}
-
-void wxCustomButton::SetBitmapLabel(const wxBitmap& bitmap)
-{
- m_bmpLabel = bitmap;
- CalcLayout(TRUE);
-}
-
-void wxCustomButton::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
- wxPaintDC dc(this);
- Paint(dc);
-}
-
-void wxCustomButton::Redraw()
-{
- wxClientDC dc(this);
- Paint(dc);
-}
-
-void wxCustomButton::Paint( wxDC &dc )
-{
-#if (wxMINOR_VERSION<8)
- dc.BeginDrawing();
-#endif
-
- int w, h;
- GetSize(&w,&h);
-
- wxColour foreColour = GetForegroundColour();
- wxColour backColour = GetBackgroundColour();
-
- if (m_focused)
- {
- backColour.Set( wxMin(backColour.Red() + 20, 255),
- wxMin(backColour.Green() + 20, 255),
- wxMin(backColour.Blue() + 20, 255) );
- }
-
- wxBitmap bitmap;
-
- if (IsEnabled())
- {
- if (GetValue() && m_bmpSelected.Ok())
- bitmap = m_bmpSelected;
- else if (m_focused && m_bmpFocus.Ok())
- bitmap = m_bmpFocus;
- else if (m_bmpLabel.Ok())
- bitmap = m_bmpLabel;
- }
- else
- {
- // try to create disabled if it doesn't exist
- if (!m_bmpDisabled.Ok() && m_bmpLabel.Ok())
- m_bmpDisabled = CreateBitmapDisabled(m_bmpLabel);
-
- if (m_bmpDisabled.Ok())
- bitmap = m_bmpDisabled;
- else if (m_bmpLabel.Ok())
- bitmap = m_bmpLabel;
-
- foreColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
- }
-
- wxBrush brush(backColour, wxSOLID);
- dc.SetBackground(brush);
- dc.SetBrush(brush);
- dc.SetPen(*wxTRANSPARENT_PEN);
-
- dc.DrawRectangle(0, 0, w, h);
-
- if (bitmap.Ok())
- dc.DrawBitmap(bitmap, m_bitmapPos.x, m_bitmapPos.y, TRUE );
-
- if (!GetLabel().IsEmpty())
- {
- dc.SetFont(GetFont());
- dc.SetTextBackground(backColour);
- dc.SetTextForeground(foreColour);
- dc.DrawText(GetLabel(), m_labelPos.x, m_labelPos.y);
- }
-
- if (GetValue()) // draw sunken border
- {
- dc.SetPen(*wxGREY_PEN);
- dc.DrawLine(0,h-1,0,0);
- dc.DrawLine(0,0,w,0);
- dc.SetPen(*wxWHITE_PEN);
- dc.DrawLine(w-1,1,w-1,h-1);
- dc.DrawLine(w-1,h-1,0,h-1);
- dc.SetPen(*wxBLACK_PEN);
- dc.DrawLine(1,h-2,1,1);
- dc.DrawLine(1,1,w-1,1);
- }
- else if (((m_button_style & wxCUSTBUT_FLAT) == 0) || m_focused) // draw raised border
- {
- dc.SetPen(*wxWHITE_PEN);
- dc.DrawLine(0,h-2,0,0);
- dc.DrawLine(0,0,w-1,0);
- dc.SetPen(*wxBLACK_PEN);
- dc.DrawLine(w-1,0,w-1,h-1);
- dc.DrawLine(w-1,h-1,-1,h-1);
- dc.SetPen(*wxGREY_PEN);
- dc.DrawLine(2,h-2,w-2,h-2);
- dc.DrawLine(w-2,h-2,w-2,1);
- }
-
- dc.SetBackground(wxNullBrush);
- dc.SetBrush(wxNullBrush);
- dc.SetPen(wxNullPen);
-#if (wxMINOR_VERSION<8)
- dc.EndDrawing();
-#endif
-}
-
-void wxCustomButton::OnSize( wxSizeEvent &event )
-{
- CalcLayout(TRUE);
- event.Skip();
-}
-
-void wxCustomButton::SetMargins(const wxSize &margin, bool fit)
-{
- m_labelMargin = margin;
- m_bitmapMargin = margin;
- CalcLayout(TRUE);
- if (fit) SetSize(DoGetBestSize());
-}
-void wxCustomButton::SetLabelMargin(const wxSize &margin, bool fit)
-{
- m_labelMargin = margin;
- CalcLayout(TRUE);
- if (fit) SetSize(DoGetBestSize());
-}
-void wxCustomButton::SetBitmapMargin(const wxSize &margin, bool fit)
-{
- m_bitmapMargin = margin;
- CalcLayout(TRUE);
- if (fit) SetSize(DoGetBestSize());
-}
-
-wxSize wxCustomButton::DoGetBestSize() const
-{
- int lw=0, lh=0;
- int bw=0, bh=0;
- bool has_bitmap = FALSE;
- bool has_label = FALSE;
-
- if (!GetLabel().IsEmpty())
- {
- GetTextExtent(GetLabel(), &lw, &lh);
- lw += 2*m_labelMargin.x;
- lh += 2*m_labelMargin.y;
- has_label = TRUE;
- }
- if (m_bmpLabel.Ok())
- {
- bw = m_bmpLabel.GetWidth() + 2*m_bitmapMargin.x;
- bh = m_bmpLabel.GetHeight() + 2*m_bitmapMargin.y;
- has_bitmap = TRUE;
- }
-
- if ((m_button_style & wxCUSTBUT_LEFT) || (m_button_style & wxCUSTBUT_RIGHT))
- {
- int h = bh > lh ? bh : lh;
- if (has_bitmap && has_label) lw -= wxMin(m_labelMargin.x, m_bitmapMargin.x);
- return wxSize(lw+bw, h);
- }
-
- int w = bw > lw ? bw : lw;
- if (has_bitmap && has_label) lh -= wxMin(m_labelMargin.y, m_bitmapMargin.y);
- return wxSize(w, lh+bh);
-}
-
-void wxCustomButton::CalcLayout(bool refresh)
-{
- int w, h;
- GetSize(&w,&h);
-
- int bw = 0, bh = 0;
- int lw = 0, lh = 0;
-
- if (m_bmpLabel.Ok()) // assume they're all the same size
- {
- bw = m_bmpLabel.GetWidth();
- bh = m_bmpLabel.GetHeight();
- }
- wxString label = GetLabel();
- if (!label.IsEmpty())
- {
- GetTextExtent(label, &lw, &lh);
- }
-
- // Center the label or bitmap if only one or the other
- if (!m_bmpLabel.Ok())
- {
- m_bitmapPos = wxPoint(0,0);
- m_labelPos = wxPoint((w-lw)/2, (h-lh)/2);
- }
- else if (label.IsEmpty())
- {
- m_bitmapPos = wxPoint((w-bw)/2, (h-bh)/2);
- m_labelPos = wxPoint(0,0);
- }
- else if (m_button_style & wxCUSTBUT_LEFT)
- {
- int mid_margin = wxMax(m_labelMargin.x, m_bitmapMargin.x);
- m_labelPos = wxPoint((w - (bw+lw+m_labelMargin.x+m_bitmapMargin.x+mid_margin))/2 + m_labelMargin.x, (h - lh)/2);
- m_bitmapPos = wxPoint(m_labelPos.x + lw + mid_margin, (h - bh)/2);
- }
- else if (m_button_style & wxCUSTBUT_RIGHT)
- {
- int mid_margin = wxMax(m_labelMargin.x, m_bitmapMargin.x);
- m_bitmapPos = wxPoint((w - (bw+lw+m_labelMargin.x+m_bitmapMargin.x+mid_margin))/2 + m_bitmapMargin.x, (h - bh)/2);
- m_labelPos = wxPoint(m_bitmapPos.x + bw + mid_margin, (h - lh)/2);
- }
- else if (m_button_style & wxCUSTBUT_TOP)
- {
- int mid_margin = wxMax(m_labelMargin.y, m_bitmapMargin.y);
- m_labelPos = wxPoint((w - lw)/2, (h - (bh+lh+m_labelMargin.y+m_bitmapMargin.y+mid_margin))/2 + m_labelMargin.y);
- m_bitmapPos = wxPoint((w - bw)/2, m_labelPos.y + lh + mid_margin);
- }
- else // if (m_button_style & wxCUSTBUT_BOTTOM) DEFAULT
- {
- int mid_margin = wxMax(m_labelMargin.y, m_bitmapMargin.y);
- m_bitmapPos = wxPoint((w - bw)/2, (h - (bh+lh+m_labelMargin.y+m_bitmapMargin.y+mid_margin))/2 + m_bitmapMargin.y);
- m_labelPos = wxPoint((w - lw)/2, m_bitmapPos.y + bh + mid_margin);
- }
-
- if (refresh) Refresh(FALSE);
-}
-
-
-/* XPM */
-static const char *down_arrow_xpm_data[] = {
- /* columns rows colors chars-per-pixel */
- "5 3 2 1",
- " c None",
- "a c Black",
- /* pixels */
- "aaaaa",
- " aaa ",
- " a "
-};
-
-static wxBitmap s_dropdownBitmap; // all buttons share the same bitmap
-
-enum
-{
- IDD_DROPDOWN_BUTTON = 100
-};
-
-//-----------------------------------------------------------------------------
-// wxMenuButtonEvents
-//-----------------------------------------------------------------------------
-
-DEFINE_LOCAL_EVENT_TYPE(wxEVT_MENUBUTTON_OPEN)
-
-// ==========================================================================
-// MenuDropButton
-// ==========================================================================
-
-class MenuDropButton : public wxCustomButton
-{
-public:
- MenuDropButton( wxWindow *parent, wxWindowID id, long style) : wxCustomButton()
- {
- if (!s_dropdownBitmap.Ok())
- s_dropdownBitmap = wxBitmap(down_arrow_xpm_data);
-
- Create( parent, id, wxEmptyString, s_dropdownBitmap, wxDefaultPosition,
- wxSize(wxMENUBUTTON_DROP_WIDTH, wxMENUBUTTON_DROP_HEIGHT), style);
- }
-
- virtual void Paint( wxDC &dc )
- {
- wxCustomButton *labelBut = ((wxMenuButton*)GetParent())->GetLabelButton();
-
- // pretend that both buttons have focus (for flat style)
- if (labelBut)
- {
- wxPoint p = GetParent()->ScreenToClient(wxGetMousePosition());
-
-#if (wxMINOR_VERSION<8)
- if (GetRect().Inside(p) || labelBut->GetRect().Inside(p))
-#else
- if (GetRect().Contains(p) || labelBut->GetRect().Contains(p))
-#endif
- {
- m_focused = TRUE;
-
- if (!labelBut->GetFocused())
- labelBut->SetFocused(TRUE);
- }
- else
- {
- m_focused = FALSE;
-
- if (labelBut->GetFocused())
- labelBut->SetFocused(FALSE);
- }
- }
-
- wxCustomButton::Paint(dc);
- }
-};
-
-// ==========================================================================
-// MenuLabelButton
-// ==========================================================================
-
-class MenuLabelButton : public wxCustomButton
-{
-public:
- MenuLabelButton( wxWindow* parent, wxWindowID id,
- const wxString &label,
- const wxBitmap &bitmap,
- long style ) : wxCustomButton()
- {
- Create(parent, id, label, bitmap, wxDefaultPosition, wxDefaultSize, style);
- }
-
- virtual void Paint( wxDC &dc )
- {
- wxCustomButton *dropBut = ((wxMenuButton*)GetParent())->GetDropDownButton();
-
- // pretend that both buttons have focus (for flat style)
- if (dropBut)
- {
- wxPoint p = GetParent()->ScreenToClient(wxGetMousePosition());
-
-#if (wxMINOR_VERSION<8)
- if (GetRect().Inside(p) || dropBut->GetRect().Inside(p))
-#else
- if (GetRect().Contains(p) || dropBut->GetRect().Contains(p))
-#endif
- {
- m_focused = TRUE;
-
- if (!dropBut->GetFocused())
- dropBut->SetFocused(TRUE);
- }
- else
- {
- m_focused = FALSE;
-
- if (dropBut->GetFocused())
- dropBut->SetFocused(FALSE);
- }
- }
-
- wxCustomButton::Paint(dc);
- }
-};
-
-// ==========================================================================
-// wxMenuButton
-// ==========================================================================
-
-IMPLEMENT_DYNAMIC_CLASS( wxMenuButton, wxControl )
-
-BEGIN_EVENT_TABLE(wxMenuButton,wxControl)
- EVT_BUTTON(wxID_ANY, wxMenuButton::OnButton)
-
-#ifdef __WXMSW__
- EVT_MENU(wxID_ANY, wxMenuButton::OnMenu)
-#endif
-END_EVENT_TABLE()
-
-wxMenuButton::~wxMenuButton()
-{
- AssignMenu(NULL, TRUE);
-}
-
-void wxMenuButton::Init()
-{
- m_labelButton = NULL;
- m_dropdownButton = NULL;
- m_menu = NULL;
- m_menu_static = FALSE;
- m_style = 0;
-}
-
-bool wxMenuButton::Create( wxWindow* parent, wxWindowID id,
- const wxString &label,
- const wxBitmap &bitmap,
- const wxPoint& pos,
- const wxSize& size,
- long style,
- const wxValidator& val,
- const wxString& name)
-{
- m_style = style;
-
- long flat = style & wxMENUBUT_FLAT;
-
- wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name);
- wxControl::SetLabel(label);
- SetBackgroundColour(parent->GetBackgroundColour());
- SetForegroundColour(parent->GetForegroundColour());
- SetFont(parent->GetFont());
-
- m_labelButton = new MenuLabelButton(this, id, label, bitmap, wxCUSTBUT_BUTTON|flat);
- m_dropdownButton = new MenuDropButton(this, IDD_DROPDOWN_BUTTON, wxCUSTBUT_BUTTON|flat);
-
- wxSize bestSize = DoGetBestSize();
- SetSize( wxSize(size.x < 0 ? bestSize.x : size.x,
- size.y < 0 ? bestSize.y : size.y) );
-
-#if (wxMINOR_VERSION<8)
- SetBestSize(GetSize());
-#else
- SetInitialSize(GetSize());
-#endif
-
- return TRUE;
-}
-
-#ifdef __WXMSW__
-// FIXME - I think there was a patch to fix this
-void wxMenuButton::OnMenu( wxCommandEvent &event )
-{
- event.Skip();
- wxMenuItem *mi = m_menu->FindItem(event.GetId());
- if (mi && (mi->GetKind() == wxITEM_RADIO))
- m_menu->Check(event.GetId(), TRUE);
-}
-#endif // __WXMSW__
-
-void wxMenuButton::OnButton( wxCommandEvent &event)
-{
- int win_id = event.GetId();
-
- if (win_id == IDD_DROPDOWN_BUTTON)
- {
- wxNotifyEvent mevent(wxEVT_MENUBUTTON_OPEN, GetId());
- mevent.SetEventObject(this);
- if (GetEventHandler()->ProcessEvent(mevent) && !mevent.IsAllowed())
- return;
-
- if (!m_menu)
- return;
-
- PopupMenu(m_menu, wxPoint(0, GetSize().y));
-
- m_labelButton->Refresh(FALSE);
- m_dropdownButton->Refresh(FALSE);
- }
- else if (win_id == m_labelButton->GetId())
- {
-
- wxCommandEvent cevent(wxEVT_COMMAND_MENU_SELECTED, win_id);
- cevent.SetEventObject(this);
- cevent.SetId(win_id);
- GetParent()->GetEventHandler()->ProcessEvent(cevent);
-
- if (!m_menu) return;
-
- const wxMenuItemList &items = m_menu->GetMenuItems();
- int first_radio_id = -1;
- int checked_id = -1;
- bool check_next = FALSE;
-
- // find the next available radio item to check
- for (wxMenuItemList::Node *node = items.GetFirst(); node; node = node->GetNext())
- {
- wxMenuItem *mi = (wxMenuItem*)node->GetData();
- if (mi && (mi->GetKind() == wxITEM_RADIO))
- {
- if (first_radio_id == -1)
- first_radio_id = mi->GetId();
-
- if (check_next)
- {
- check_next = FALSE;
- checked_id = mi->GetId();
- break;
- }
- else if (mi->IsChecked())
- check_next = TRUE;
- }
- }
- // the last item was checked, go back to the first
- if (check_next && (first_radio_id != -1))
- checked_id = first_radio_id;
-
- if (checked_id != -1)
- {
- m_menu->Check(checked_id, TRUE);
-
- wxCommandEvent mevent( wxEVT_COMMAND_MENU_SELECTED, checked_id);
- mevent.SetEventObject( m_menu );
- mevent.SetInt(1);
- GetEventHandler()->ProcessEvent(mevent);
- }
- }
-}
-
-int wxMenuButton::GetSelection() const
-{
- wxCHECK_MSG(m_menu != NULL, wxNOT_FOUND, wxT("No attached menu in wxMenuButton::GetSelection"));
-
- const wxMenuItemList &items = m_menu->GetMenuItems();
-
- for (wxMenuItemList::Node *node = items.GetFirst(); node; node = node->GetNext())
- {
- wxMenuItem *mi = (wxMenuItem*)node->GetData();
- if (mi && (mi->GetKind() == wxITEM_RADIO))
- {
- if (mi->IsChecked())
- return mi->GetId();
- }
- }
-
- return wxNOT_FOUND;
-}
-
-void wxMenuButton::AssignMenu(wxMenu *menu, bool static_menu)
-{
- if (!m_menu_static && m_menu)
- delete m_menu;
-
- m_menu = menu;
- m_menu_static = static_menu;
-}
-
-void wxMenuButton::SetToolTip(const wxString &tip)
-{
- wxWindow::SetToolTip(tip);
- ((wxWindow*)m_labelButton)->SetToolTip(tip);
- ((wxWindow*)m_dropdownButton)->SetToolTip(tip);
-}
-void wxMenuButton::SetToolTip(wxToolTip *tip)
-{
- wxWindow::SetToolTip(tip);
- ((wxWindow*)m_labelButton)->SetToolTip(tip);
- ((wxWindow*)m_dropdownButton)->SetToolTip(tip);
-}
-
-void wxMenuButton::DoSetSize(int x, int y, int width, int height, int sizeFlags)
-{
- wxSize curSize( GetSize() );
- wxSize bestSize( DoGetBestSize() );
-
- if (width == -1)
- width = curSize.GetWidth();
- if (width < 10)
- width = bestSize.GetWidth();
-
- if (height == -1)
- height = curSize.GetHeight();
- if (height < 5)
- height = bestSize.GetHeight();
-
- wxWindow::DoSetSize(x, y, width, height, sizeFlags);
-
- if (m_labelButton)
- m_labelButton->SetSize(0, 0, width - wxMENUBUTTON_DROP_WIDTH, height);
- if (m_dropdownButton)
- m_dropdownButton->SetSize(width-wxMENUBUTTON_DROP_WIDTH, 0, wxMENUBUTTON_DROP_WIDTH, height);
-}
-
-wxSize wxMenuButton::DoGetBestSize()
-{
- if (!m_labelButton || !m_dropdownButton)
- return wxSize(wxMENUBUTTON_DROP_WIDTH+wxMENUBUTTON_DROP_HEIGHT, wxMENUBUTTON_DROP_HEIGHT);
-
- wxSize size = m_labelButton->GetBestSize();
- size.x += wxMENUBUTTON_DROP_WIDTH;
- return size;
-}
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: wxMenuButton
-// Purpose: A button with a dropdown wxMenu
-// Author: John Labenski
-// Modified by:
-// Created: 11/05/2002
-// Copyright: (c) John Labenski
-// Licence: wxWidgets licence
-/////////////////////////////////////////////////////////////////////////////
-
-/*
-
-wxMenuButton is a button that drops down an assigned wxMenu
-
-Create the button with either a text or bitmap label.
- Create a new wxMenu and call AssignMenu and thats it. When you press the
- dropdown button the menu appears. When you press the label button the next
- wxITEM_RADIO (ie wxMenuItem::GetKind) in the menu is selected round robin.
- If there are no radio items then it really just acts like a menubar, though
- this is probably not too useful. The events sent in this case are EVT_MENUs
- either generated by the menu when you click on it or created when you click
- on the label to select the next radio item.
-*/
-
-#ifndef _WX_MENUBTN_H_
-#define _WX_MENUBTN_H_
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma interface "menubtn.h"
-#endif
-
-class wxMenu;
-class wxBitmap;
-class wxCustomButton;
-
-//-----------------------------------------------------------------------------
-// wxCustomButton styles
-//-----------------------------------------------------------------------------
-
-enum wxCustomButton_Style
-{
- // Position of the label, use only one
- wxCUSTBUT_LEFT = 0x0001,
- wxCUSTBUT_RIGHT = 0x0002,
- wxCUSTBUT_TOP = 0x0004,
- wxCUSTBUT_BOTTOM = 0x0008,
- // Button style, use only one
- wxCUSTBUT_NOTOGGLE = 0x0100,
- wxCUSTBUT_BUTTON = 0x0200,
- wxCUSTBUT_TOGGLE = 0x0400,
- wxCUSTBUT_BUT_DCLICK_TOG = 0x0800,
- wxCUSTBUT_TOG_DCLICK_BUT = 0x1000,
- // drawing styles
- wxCUSTBUT_FLAT = 0x2000 // flat, mouseover raises if not depressed
-};
-
-//-----------------------------------------------------------------------------
-// wxCustomButton
-//-----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxCustomButton : public wxControl
-{
-public:
-
- wxCustomButton() : wxControl() {
- Init();
- }
-
- // wxToggleButton or wxButton compatible constructor (also wxTextCtrl)
- wxCustomButton(wxWindow* parent, wxWindowID id,
- const wxString& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxCUSTBUT_TOGGLE,
- const wxValidator& val = wxDefaultValidator,
- const wxString& name = wxT("wxCustomButton"))
- : wxControl()
- {
- Init();
- Create(parent,id,label,wxNullBitmap,pos,size,style,val,name);
- }
-
- // wxBitmapButton compatible constructor
- wxCustomButton(wxWindow *parent, wxWindowID id,
- const wxBitmap& bitmap,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxCUSTBUT_TOGGLE,
- const wxValidator& val = wxDefaultValidator,
- const wxString& name = wxT("wxCustomButton"))
- : wxControl()
- {
- Init();
- Create(parent,id,wxEmptyString,bitmap,pos,size,style,val,name);
- }
-
- // Native constructor
- wxCustomButton(wxWindow *parent, wxWindowID id,
- const wxString& label, const wxBitmap& bitmap,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxCUSTBUT_TOGGLE|wxCUSTBUT_BOTTOM,
- const wxValidator& val = wxDefaultValidator,
- const wxString& name = wxT("wxCustomButton"))
- : wxControl()
- {
- Init();
- Create(parent,id,label,bitmap,pos,size,style,val,name);
- }
-
- virtual ~wxCustomButton();
-
- bool Create(wxWindow* parent,
- wxWindowID id,
- const wxString& label,
- const wxBitmap &bitmap,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxValidator& val = wxDefaultValidator,
- const wxString& name = wxT("wxCustomButton"));
-
- bool GetValue() const {
- return m_down%2 != 0;
- }
- void SetValue( bool depressed );
-
- // Use combinations of wxCustomButton_Style(s)
- long GetButtonStyle() const {
- return m_button_style;
- }
- bool SetButtonStyle( long style );
-
- // Set the text label, wxEmptyString for none
- void SetLabel( const wxString &label );
-
- // set the bitmaps, ONLY this Label bitmap is used for calculating control size
- // all bitmaps will be centered accordingly in any case
- // call SetSet(GetBestSize()) if you change their size and want the control to resize appropriately
- void SetBitmapLabel(const wxBitmap& bitmap);
- void SetBitmapSelected(const wxBitmap& sel) {
- m_bmpSelected = sel;
- CalcLayout(TRUE);
- };
- void SetBitmapFocus(const wxBitmap& focus) {
- m_bmpFocus = focus;
- CalcLayout(TRUE);
- };
- void SetBitmapDisabled(const wxBitmap& disabled) {
- m_bmpDisabled = disabled;
- CalcLayout(TRUE);
- };
- // wxBitmapButton compatibility
- void SetLabel(const wxBitmap& bitmap) {
- SetBitmapLabel(bitmap);
- }
-
- // retrieve the bitmaps
- const wxBitmap& GetBitmapLabel() const {
- return m_bmpLabel;
- }
- const wxBitmap& GetBitmapSelected() const {
- return m_bmpSelected;
- }
- const wxBitmap& GetBitmapFocus() const {
- return m_bmpFocus;
- }
- const wxBitmap& GetBitmapDisabled() const {
- return m_bmpDisabled;
- }
-
- // Creates a "disabled" bitmap by dithering it with the background colour
- wxBitmap CreateBitmapDisabled(const wxBitmap &bitmap) const;
-
- // set/get the margins (in pixels) around the label and bitmap
- // if fit = TRUE then resize the button to fit
- void SetMargins(const wxSize &margin, bool fit = FALSE);
-
- // set/get the margins around the text label
- // the inter bitmap/label margin is the max of either margin, not the sum
- void SetLabelMargin(const wxSize &margin, bool fit = FALSE);
- wxSize GetLabelMargin() const {
- return m_labelMargin;
- }
- // set/get the margins around the bitmap
- // the inter bitmap/label margin is the max of either margin, not the sum
- void SetBitmapMargin(const wxSize &margin, bool fit = FALSE);
- wxSize GetBitmapMargin() const {
- return m_bitmapMargin;
- }
-
- // can be used to activate the focused behavior (see MenuButton)
- void SetFocused(bool focused) {
- m_focused = focused;
- Refresh(FALSE);
- }
- bool GetFocused() const {
- return m_focused;
- }
-
-protected:
- void OnPaint(wxPaintEvent &event);
- void Redraw();
- virtual void Paint( wxDC &dc );
-
- virtual wxSize DoGetBestSize() const;
-
- virtual void SendEvent();
-
- void OnMouseEvents(wxMouseEvent &event);
-
- void OnSize( wxSizeEvent &event );
-
- virtual void CalcLayout(bool refresh);
-
- long m_down; // toggle state if m_down%2 then depressed
- bool m_focused; // mouse in window
- long m_button_style;
-
- // the bitmaps for various states
- wxBitmap m_bmpLabel,
- m_bmpSelected,
- m_bmpFocus,
- m_bmpDisabled;
-
- // the margins around the label/bitmap
- wxSize m_labelMargin,
- m_bitmapMargin;
-
- wxPoint m_bitmapPos,
- m_labelPos;
-
- wxTimer *m_timer;
-
- wxEventType m_eventType; // store the mouse event type
-
-private:
- void Init();
- DECLARE_DYNAMIC_CLASS(wxCustomButton)
- DECLARE_EVENT_TABLE()
-};
-
-//-----------------------------------------------------------------------------
-// wxMenuButton styles
-//-----------------------------------------------------------------------------
-
-#define wxMENUBUTTON_DROP_WIDTH 10
-#define wxMENUBUTTON_DROP_HEIGHT 22
-
-enum wxMenuButton_Styles
-{
- wxMENUBUT_FLAT = wxCUSTBUT_FLAT
-};
-
-//-----------------------------------------------------------------------------
-// wxMenuButton
-//-----------------------------------------------------------------------------
-
-class wxMenuButton : public wxControl
-{
-public:
-
- wxMenuButton() : wxControl() {
- Init();
- }
-
- // Use this constructor if you need one compatible with a wxBitmapButton
- // setup the button later with AssignMenu
- wxMenuButton( wxWindow* parent, wxWindowID id,
- const wxBitmap &bitmap,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxValidator& val = wxDefaultValidator,
- const wxString& name = wxT("wxMenuButton"))
- : wxControl()
- {
- Init();
- Create(parent,id,wxEmptyString,bitmap,pos,size,style,val,name);
- }
-
- virtual ~wxMenuButton();
-
- bool Create( wxWindow* parent,
- wxWindowID id,
- const wxString &label,
- const wxBitmap &bitmap,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER,
- const wxValidator& val = wxDefaultValidator,
- const wxString& name = wxT("wxMenuButton"));
-
- // Gets the id of the first selected radio item or wxNOT_FOUND (-1) if none
- int GetSelection() const;
-
- // This menu will be displayed when the dropdown button is pressed.
- // if static_menu is FALSE it will be deleted when the buttton is destroyed.
- void AssignMenu(wxMenu *menu, bool static_menu = FALSE);
-
- wxMenu *GetMenu() const {
- return m_menu;
- }
-
- // get a pointer to the label button, for turning it into a toggle perhaps
- wxCustomButton *GetLabelButton() const {
- return m_labelButton;
- }
- wxCustomButton *GetDropDownButton() const {
- return m_dropdownButton;
- }
-
- void SetToolTip(const wxString &tip);
- void SetToolTip(wxToolTip *tip);
-
-protected:
- void OnButton(wxCommandEvent &event);
-
- virtual void DoSetSize(int x, int y, int width, int height,
- int sizeFlags = wxSIZE_AUTO);
-
- virtual wxSize DoGetBestSize();
-
-// FIXME! - in MSW the radio items don't check themselves
-#ifdef __WXMSW__
- void OnMenu( wxCommandEvent &event );
-#endif
-
- wxCustomButton *m_labelButton;
- wxCustomButton *m_dropdownButton;
-
- wxMenu *m_menu;
- bool m_menu_static;
- long m_style;
-
-private:
- void Init();
- DECLARE_DYNAMIC_CLASS(wxMenuButton)
- DECLARE_EVENT_TABLE()
-};
-
-//-----------------------------------------------------------------------------
-// wxMenuButtonEvents
-//
-// EVT_MENUBUTTON_OPEN(id, fn) - menu is about to be opened, (dis)(en)able items
-// or call Veto() to stop menu from popping up
-// this is a wxNotifyEvent
-//-----------------------------------------------------------------------------
-
-BEGIN_DECLARE_EVENT_TYPES()
-DECLARE_LOCAL_EVENT_TYPE( wxEVT_MENUBUTTON_OPEN, 0 )
-END_DECLARE_EVENT_TYPES()
-
-#define EVT_MENUBUTTON_OPEN(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_MENUBUTTON_OPEN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) & fn, (wxObject *) NULL ),
-
-#endif // _WX_MENUBTN_H_
+++ /dev/null
-/* XPM */
-static const char * osmo4[] = {
-"32 32 266 2",
-" c None",
-". c #990909",
-"+ c #A10505",
-"@ c #AB0404",
-"# c #AF0202",
-"$ c #B10303",
-"% c #AE0202",
-"& c #A90505",
-"* c #A10606",
-"= c #990E0E",
-"- c #990D0D",
-"; c #A80303",
-"> c #BD0000",
-", c #D40000",
-"' c #DE0000",
-") c #E20000",
-"! c #E10000",
-"~ c #DC0000",
-"{ c #CD0000",
-"] c #B80101",
-"^ c #A40909",
-"/ c #A20505",
-"( c #BD0101",
-"_ c #E00000",
-": c #CB0000",
-"< c #A80000",
-"[ c #7E0101",
-"} c #6B0202",
-"| c #670202",
-"1 c #720202",
-"2 c #920000",
-"3 c #B70000",
-"4 c #D70000",
-"5 c #B80303",
-"6 c #9D0B0B",
-"7 c #980909",
-"8 c #B00202",
-"9 c #DB0000",
-"0 c #B50909",
-"a c #8A1313",
-"b c #1C0505",
-"c c #070505",
-"d c #080808",
-"e c #0A0A0A",
-"f c #090909",
-"g c #070707",
-"h c #0C0404",
-"i c #5B1414",
-"j c #A70F0F",
-"k c #CC0303",
-"l c #CC0000",
-"m c #AB0505",
-"n c #950D0D",
-"o c #B60101",
-"p c #DD0000",
-"q c #CF0202",
-"r c #9C1414",
-"s c #141414",
-"t c #0C0C0C",
-"u c #0F0F0F",
-"v c #111111",
-"w c #101010",
-"x c #0E0E0E",
-"y c #B70707",
-"z c #DF0000",
-"A c #D50000",
-"B c #A90606",
-"C c #970E0E",
-"D c #B30202",
-"E c #C50505",
-"F c #812121",
-"G c #191919",
-"H c #161616",
-"I c #181818",
-"J c #171717",
-"K c #151515",
-"L c #AF0A0A",
-"M c #D70101",
-"N c #D60000",
-"O c #AD0606",
-"P c #AA0303",
-"Q c #DA0000",
-"R c #C80505",
-"S c #8E1E1E",
-"T c #1D1D1D",
-"U c #1F1F1F",
-"V c #202020",
-"W c #B00909",
-"X c #CE0000",
-"Y c #9F0A0A",
-"Z c #9B0808",
-"` c #D20000",
-" . c #D80101",
-".. c #8B1B1B",
-"+. c #2D2D2D",
-"@. c #272727",
-"#. c #262626",
-"$. c #252525",
-"%. c #BB0606",
-"&. c #BB0303",
-"*. c #AF0303",
-"=. c #AF0B0B",
-"-. c #303030",
-";. c #2B2B2B",
-">. c #323232",
-",. c #CD0202",
-"'. c #A60A0A",
-"). c #9E0909",
-"!. c #CF0000",
-"~. c #CE0404",
-"{. c #292929",
-"]. c #B10808",
-"^. c #A70303",
-"/. c #B60A0A",
-"(. c #961010",
-"_. c #B90000",
-":. c #9C1212",
-"<. c #1A1A1A",
-"[. c #222222",
-"}. c #1C1C1C",
-"|. c #C20202",
-"1. c #A30606",
-"2. c #C60000",
-"3. c #2A2A2A",
-"4. c #3B3B3B",
-"5. c #444444",
-"6. c #434343",
-"7. c #3A3A3A",
-"8. c #1E1E1E",
-"9. c #131313",
-"0. c #BB0A0A",
-"a. c #AD0707",
-"b. c #9A1515",
-"c. c #D30000",
-"d. c #353535",
-"e. c #484848",
-"f. c #5F5F5F",
-"g. c #6C6C6C",
-"h. c #646464",
-"i. c #565656",
-"j. c #343434",
-"k. c #212121",
-"l. c #121212",
-"m. c #B30505",
-"n. c #B10404",
-"o. c #9A1111",
-"p. c #424242",
-"q. c #555555",
-"r. c #6B6B6B",
-"s. c #757575",
-"t. c #6E6E6E",
-"u. c #606060",
-"v. c #4E4E4E",
-"w. c #3F3F3F",
-"x. c #2C2C2C",
-"y. c #B10909",
-"z. c #B60707",
-"A. c #9B1515",
-"B. c #D00000",
-"C. c #494949",
-"D. c #595959",
-"E. c #676767",
-"F. c #696969",
-"G. c #616161",
-"H. c #525252",
-"I. c #454545",
-"J. c #B20707",
-"K. c #363636",
-"L. c #626262",
-"M. c #5B5B5B",
-"N. c #505050",
-"O. c #282828",
-"P. c #B80B0B",
-"Q. c #AC0707",
-"R. c #AA1111",
-"S. c #0D0D0D",
-"T. c #585858",
-"U. c #545454",
-"V. c #4B4B4B",
-"W. c #BF0303",
-"X. c #9F0B0B",
-"Y. c #B90707",
-"Z. c #242424",
-"`. c #313131",
-" + c #3E3E3E",
-".+ c #474747",
-"++ c #4D4D4D",
-"@+ c #4F4F4F",
-"#+ c #4C4C4C",
-"$+ c #3D3D3D",
-"%+ c #D90000",
-"&+ c #8E1010",
-"*+ c #A00808",
-"=+ c #D00303",
-"-+ c #3C3C3C",
-";+ c #0B0B0B",
-">+ c #AE0808",
-",+ c #C10101",
-"'+ c #BB0202",
-")+ c #BA0A0A",
-"!+ c #1B1B1B",
-"~+ c #2F2F2F",
-"{+ c #C10303",
-"]+ c #A10A0A",
-"^+ c #9F0707",
-"/+ c #D80000",
-"(+ c #BE0303",
-"_+ c #821C1C",
-":+ c #C20404",
-"<+ c #232323",
-"[+ c #A90C0C",
-"}+ c #970C0C",
-"|+ c #960E0E",
-"1+ c #BE0101",
-"2+ c #C60505",
-"3+ c #131212",
-"4+ c #B00B0B",
-"5+ c #CE0101",
-"6+ c #A80707",
-"7+ c #990B0B",
-"8+ c #C40404",
-"9+ c #AD0909",
-"0+ c #D00101",
-"a+ c #B00505",
-"b+ c #7B1C1C",
-"c+ c #960C0C",
-"d+ c #BC0202",
-"e+ c #BC0808",
-"f+ c #962525",
-"g+ c #482E2E",
-"h+ c #1E1616",
-"i+ c #141010",
-"j+ c #2F2020",
-"k+ c #703636",
-"l+ c #A81212",
-"m+ c #A90707",
-"n+ c #8E1313",
-"o+ c #D30606",
-"p+ c #B91E1E",
-"q+ c #901919",
-"r+ c #661010",
-"s+ c #540F0F",
-"t+ c #4F0D0D",
-"u+ c #5A0F0F",
-"v+ c #7A1515",
-"w+ c #A21E1E",
-"x+ c #C51212",
-"y+ c #D60101",
-"z+ c #980D0D",
-"A+ c #930C0C",
-"B+ c #B30404",
-"C+ c #C60202",
-"D+ c #7B1919",
-"E+ c #8C1515",
-"F+ c #9F0909",
-"G+ c #B20303",
-"H+ c #C30000",
-"I+ c #CA0000",
-"J+ c #C90000",
-"K+ c #BC0101",
-"L+ c #AA0505",
-"M+ c #8F1111",
-"N+ c #7F1E1E",
-"O+ c #732626",
-"P+ c #762A2A",
-"Q+ c #6E2828",
-" ",
-" . + @ # $ % & * = ",
-" - ; > , ' ) ) ! ) ! ~ { ] ^ ",
-" / ( ' _ : < [ } | 1 2 3 4 ) , 5 6 ",
-" 7 8 9 ' 0 a b c d e e f g h i j k ) l m ",
-" n o p q r s t u v v w t x y z A B ",
-" C D ) E F G H I G J K L M N O ",
-" P Q R S T U U T V W ' X Y ",
-" Z ` ... +.@.#.$. %.! &. ",
-" *.) =. -.;.>. ,.4 '. ",
-" ).!.~. {. ].) ( ",
-" ^.z /. $. A ` (. ",
-" _.! :. K K <.V [.}.K K |.z 1. ",
-" 2.9 v <.3.4.5.6.7.;.8.9.J 0.) a. ",
-" b.!.c. w }.d.e.f.g.h.i.5.j.k.l. m._ n. ",
-" o.` !. u J 3.p.q.r.s.t.u.v.w.x.T w y._ z. ",
-" A.B.` u k.j.C.D.E.g.F.G.H.I.j.$.9.l. m._ J. ",
-" : 4 s v #.K.C.q.u.h.L.M.N.I.K.O.J x P.) Q. ",
-" > z R. S.9.#.d.5.v.i.D.T.U.V.p.j.{.G t W._ X. ",
-" % ) Y. l.9.Z.`. +.+++N.@+#+I.$+>.@.I t { %+&+ ",
-" *+, =+ x w V ;.K.$+6.I.I.p.-+K.;.[.H ;+ >+z ,+ ",
-" '+_ )+ x S.!+Z.~+d.7.-+-+7.d.~+#.8.9.;+ {+_ ]+ ",
-" ^+/+, e s }.$.;.~+`.`.-.;.#.U J S.w z.' (+_+ ",
-" ] ) :+ t S.K T [.@.O.O.@.<+U I v ;+ [+` ~ }+ ",
-" |+1+) 2+ e t 9.I }.T 8.}.G K u e 3+ 4+5+' 6+ ",
-" 7+l ) 8+ e ;+u 9.K K 9.v S.f w 9+0+) a+b+ ",
-" c+d+) N e+f+g+h+;+f e f i+j+k+l+|.~ /+m+ ",
-" n+D N ! o+p+q+r+s+t+u+v+w+x+y+! X z+ ",
-" A+B+X _ ! ~ /+N %+' ) ~ C+Y D+ ",
-" E+F+G+H+I+l J+K+L+M+N+ ",
-" O+P+Q+ ",
-" "};
+++ /dev/null
-/* XPM */
-static const char* pl_open[] = {
-"16 16 5 1",
-" c #000000",
-"! c #808000",
-"# c #C0C0C0",
-"$ c #FFFF00",
-"% c #FFFFFF",
-"################",
-"################",
-"######### ####",
-"######## ### # #",
-"############# #",
-"# ######## #",
-" %$% #####",
-" $%$%$%$%$ #####",
-" %$%$%$%$% #####",
-" $%$% #",
-" %$% !!!!!!!!! #",
-" $% !!!!!!!!! ##",
-" % !!!!!!!!! ###",
-" !!!!!!!!! ####",
-" #####",
-"################"};
-
-/* XPM */
-static const char* pl_save[] = {
-"16 16 3 1",
-" c #000000",
-"! c #808000",
-"# c #C0C0C0",
-"################",
-"# #",
-"# ! ######## # #",
-"# ! ######## #",
-"# ! ######## ! #",
-"# ! ######## ! #",
-"# ! ######## ! #",
-"# ! ######## ! #",
-"# !! !! #",
-"# !!!!!!!!!!!! #",
-"# !! ! #",
-"# !! ## ! #",
-"# !! ## ! #",
-"# !! ## ! #",
-"## #",
-"################"};
-
-/* XPM */
-static const char* pl_add[] = {
-"16 16 2 1",
-" c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!! !!!",
-"!! !!!",
-"!! !!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* pl_rem[] = {
-"16 16 2 1",
-" c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!! !!!",
-"!! !!!",
-"!! !!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* pl_up[] = {
-"16 16 2 1",
-" c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!! !!!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!! !!!!!!",
-"!!!! !!!!!",
-"!!! !!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* pl_down[] = {
-"16 16 2 1",
-" c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!! !!!!!!!",
-"!!! !!!!",
-"!!!! !!!!!",
-"!!!!! !!!!!!",
-"!!!!!! !!!!!!!",
-"!!!!!!! !!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* pl_sort[] = {
-"16 16 2 1",
-" c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!! !!!!! !!!!!",
-"!!!! !!!! !!!!",
-"!!!! !!! !!!",
-"!!!! !!!!! !!!!!",
-"!!!! !!!!! !!!!!",
-"!!!! !!!!! !!!!!",
-"!!!! !!!!! !!!!!",
-"!! !!! !!!!!",
-"!!! !!!! !!!!!",
-"!!!! !!!!! !!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
+++ /dev/null
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by wxOsmo4.rc
-//
-#define IDI_OSMO_ICON 101
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 104
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+++ /dev/null
-/* XPM */
-static const char* tool_open_file[] = {
-"16 16 2 1",
-" c #000000",
-"! c none",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!! !!!!!!!",
-"!!!!!! !!!!!!",
-"!!!!! !!!!!",
-"!!!! !!!!",
-"!!! !!!",
-"!! !!",
-"!! !!",
-"!!!!!!!!!!!!!!!!",
-"!! !!",
-"!! !!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_prev[] = {
-"16 16 3 1",
-" c #000000",
-"! c none",
-"# c #FF0000",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!! !!",
-"!!!!!!!!!! !!",
-"!!!!!!!! ## !!",
-"!!!!!! #### !!",
-"!!!! ###### !!",
-"!!! ######## !!",
-"!!!! ##### !!",
-"!!!!!! ### !!",
-"!!!!!!!! # !!",
-"!!!!!!!!!! !!",
-"!!!!!!!!!!!! !!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_next[] = {
-"16 16 3 1",
-" c #000000",
-"! c none",
-"# c #FF0000",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!! !!!!!!!!!!!!",
-"!! !!!!!!!!!!",
-"!! ## !!!!!!!!",
-"!! #### !!!!!!",
-"!! ###### !!!!",
-"!! ######## !!!",
-"!! ###### !!!!",
-"!! #### !!!!!!",
-"!! ## !!!!!!!!",
-"!! !!!!!!!!!!",
-"!! !!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_play[] = {
-"16 16 2 1",
-" c #000000",
-"! c none",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!! !!!!!!!!!!!!",
-"!! !!!!!!!!!!",
-"!! !!!!!!!!",
-"!! !!!!!!",
-"!! !!!!",
-"!! !!",
-"!! !!!!",
-"!! !!!!!!",
-"!! !!!!!!!!",
-"!! !!!!!!!!!!",
-"!! !!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_pause[] = {
-"16 16 3 1",
-" c #000000",
-"! c #808080",
-"# c none",
-"################",
-"################",
-"################",
-"### !##! ###",
-"### !##! ###",
-"### !##! ###",
-"### !##! ###",
-"### !##! ###",
-"### !##! ###",
-"### !##! ###",
-"### !##! ###",
-"### !##! ###",
-"### !##! ###",
-"### !##! ###",
-"################",
-"################"};
-
-
-/* XPM */
-static const char* tool_step[] = {
-"16 16 2 1",
-" c #000000",
-"! c none",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!! !!!!!!!!!!!",
-"!! !!!!!!!!!",
-"!! !!!!!!!",
-"!!!! !!!!!",
-"!!!!!! !!!",
-"!!!!!!!! !!",
-"!!!!!! !!!",
-"!!!! !!!!!",
-"!! !!!!!!!",
-"!! !!!!!!!!!",
-"!! !!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-
-/* XPM */
-static const char* tool_stop[] = {
-"16 16 2 1",
-" c #000000",
-"! c none",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!! !!",
-"!! !!",
-"!! !!",
-"!! !!",
-"!! !!",
-"!! !!",
-"!! !!",
-"!! !!",
-"!! !!",
-"!! !!",
-"!! !!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_info[] = {
-"16 16 3 1",
-" c #000000",
-"! c none",
-"# c #0000FF",
-"!!!!!!!!!!!!!!!!",
-"!!!!! !!!!!",
-"!!! !!!",
-"!! ###### !!",
-"! ####!!#### !",
-"! ####!!#### !",
-" ############ ",
-" #####!!##### ",
-" ######!!##### ",
-" #####!!##### ",
-" #####!!##### ",
-"! ####!!#### !",
-"! #####!!### !",
-"!! ###### !!",
-"!!! !!!",
-"!!!!! !!!!!"};
-
-
-/* XPM */
-static const char* tool_config[] = {
-"16 16 3 1",
-" c #000000",
-"! c #808080",
-"# c none",
-"################",
-"################",
-"## ## ######",
-"## ## # ## # ##",
-"## ## #",
-"## #!# ####### #",
-"## # #!# ## ## #",
-"## #!# #!# ! # #",
-"## # #!# ## ## #",
-"## #!# #!##### #",
-"## # #!# ## ## #",
-"## #!# #!# ! # #",
-"## # #!# ## ## #",
-"## #",
-"################",
-"################"};
-
-/* XPM */
-static const char* tool_sw_2d[] = {
-"16 16 4 1",
-" c #FF0000",
-". c #C0C0C0",
-"+ c #0000FF",
-"@ c #000000",
-" .............. ",
-". ..++..++++.. .",
-".. +..+..+..+ ..",
-"... ..+..+.. ...",
-".... +...+. +...",
-"...+. +..+ .+...",
-"...+++ .+ ++....",
-"....... .......",
-"....@@ @@ @.....",
-"...@. .@.@ .....",
-"...@ ....@. ....",
-"... ..@@.@.. ...",
-".. @...@.@.@. ..",
-". ..@@@@@@@@.. .",
-" .............. ",
-"................"};
-
-/* XPM */
-static const char* tool_sw_3d[] = {
-"16 16 4 1",
-" c #FFFFFF",
-". c #C0C0C0",
-"+ c #0000FF",
-"@ c #000000",
-" ",
-"................",
-"....++..++++....",
-"...+..+..+..+...",
-"......+..+..+...",
-"....++...+..+...",
-"...+..+..+..+...",
-"...++++.++++....",
-"................",
-"....@@@@@@@.....",
-"...@...@.@......",
-"...@.....@......",
-"...@..@@.@......",
-"...@...@.@.@....",
-"....@@@@@@@@....",
-"................"};
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-#include "wxOsmo4.h"
-#include <gpac/options.h>
-#include <gpac/modules/codec.h>
-#include <gpac/modules/raster2d.h>
-#include <gpac/modules/font.h>
-#include <gpac/modules/audio_out.h>
-#include <gpac/modules/video_out.h>
-
-#include <gpac/iso639.h>
-
-#include "wxGPACControl.h"
-
-
-#define NUM_RATES 11
-static const char *BIFSRates[11] =
-{
- "5.0",
- "7.5",
- "10.0",
- "12.5",
- "15.0",
- "24.0",
- "25.0",
- "30.0",
- "50.0",
- "60.0",
- "100.0"
-};
-
-void wxGPACControl::SetYUVLabel()
-{
- u32 yuv_format = gf_term_get_option(m_pApp->m_term, GF_OPT_YUV_FORMAT);
- if (!yuv_format) {
- m_yuvtxt->SetLabel(wxT("(No YUV used)"));
- } else {
- char str[100];
- sprintf(str, "(%s used)", gf_4cc_to_str(yuv_format));
- m_yuvtxt->SetLabel(wxString(str, wxConvUTF8) );
- }
-}
-
-wxGPACControl::wxGPACControl(wxWindow *parent)
- : wxDialog(parent, -1, wxString(wxT("GPAC Control Panel")))
-{
- const char *sOpt;
- SetSize(320, 240);
- u32 i;
- wxBoxSizer *bs;
- Centre();
-
- m_pApp = (wxOsmo4Frame *)parent;
-
- s_main = new wxBoxSizer(wxVERTICAL);
-
- s_header = new wxBoxSizer(wxHORIZONTAL);
- //s_header->Add(new wxStaticText(this, 0, wxT("Category"), wxDefaultPosition, wxSize(60, 20)), wxALIGN_CENTER);
- m_select = new wxComboBox(this, ID_SELECT, wxT(""), wxDefaultPosition, wxSize(120, 30), 0, NULL, wxCB_READONLY);
- s_header->Add(m_select, 2, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_header->Add( new wxButton(this, ID_APPLY, wxT("Apply"), wxDefaultPosition,
-#ifdef WIN32
- wxSize(40, 20)
-#else
- wxSize(40, 30)
-#endif
- ),
- 1, wxALIGN_TOP|wxALIGN_RIGHT|wxADJUST_MINSIZE);
- s_main->Add(s_header, 0, wxEXPAND, 0);
-
- /*general section*/
- s_general = new wxBoxSizer(wxVERTICAL);
- m_loop = new wxCheckBox(this, 0, wxT("Loop at End"), wxPoint(10, 40), wxSize(140, 20));
- s_general->Add(m_loop);
- m_lookforsubs = new wxCheckBox(this, 0, wxT("Look for Subtitles"), wxPoint(180, 40), wxSize(140, 20));
- s_general->Add(m_lookforsubs);
- m_noconsole = new wxCheckBox(this, 0, wxT("Disable console messages"), wxPoint(10, 80), wxSize(180, 20));
- s_general->Add(m_noconsole);
- m_viewxmt = new wxCheckBox(this, 0, wxT("View graph in XMT-A format"), wxPoint(10, 120), wxSize(180, 20));
- s_general->Add(m_viewxmt);
- s_main->Add(s_general, 0, wxEXPAND, 0);
-
- /*MPEG-4 systems*/
- s_mpeg4 = new wxBoxSizer(wxVERTICAL);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Prefered Stream Language")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_lang = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_lang, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_mpeg4->Add(bs, 0, wxALL|wxEXPAND, 2);
-
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Decoder Threading Mode")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_thread = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_thread, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_mpeg4->Add(bs, 0, wxALL|wxEXPAND, 2);
- m_bifsalwaysdrawn = new wxCheckBox(this, 0, wxT("Always draw late BIFS frames"));
- s_mpeg4->Add(m_bifsalwaysdrawn);
- m_singletime = new wxCheckBox(this, 0, wxT("Force Single Timeline"));
- s_mpeg4->Add(m_singletime);
- s_main->Add(s_mpeg4, 0, wxEXPAND, 0);
-
- /*media decoders*/
- s_mdec = new wxBoxSizer(wxVERTICAL);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Prefered Audio Output")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_decaudio = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_decaudio, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_mdec->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Prefered Video Output")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_decvideo = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_decvideo, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_mdec->Add(bs, 0, wxALL|wxEXPAND, 2);
- s_main->Add(s_mdec, 0, wxEXPAND, 0);
-
- /*Rendering*/
- s_rend = new wxBoxSizer(wxVERTICAL);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Target Frame Rate")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_fps = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_fps, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Anti-Aliasing")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_aa = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_aa, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Graphics Driver")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_graph = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_graph, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- m_draw_bounds = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(new wxStaticText(this, 0, wxT("Bounds")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- bs->Add(m_draw_bounds, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
- m_fast = new wxCheckBox(this, 0, wxT("Fast Rendering"));
- m_force_size = new wxCheckBox(this, 0, wxT("Force Scene Size"));
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(m_fast, wxALIGN_CENTER | wxADJUST_MINSIZE);
- bs->Add(m_force_size, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
- m_use3D = new wxCheckBox(this, 0, wxT("Use 3D Renderer"));
- s_rend->Add(m_use3D, 0, wxALL|wxEXPAND, 2);
- m_bWas3D = m_use3D->GetValue();
- s_main->Add(s_rend, 0, wxEXPAND, 0);
-
- /*Render 2D*/
- s_rend2d = new wxBoxSizer(wxVERTICAL);
- m_direct = new wxCheckBox(this, 0, wxT("Direct Rendering"));
- s_rend2d->Add(m_direct, 0, wxALL|wxEXPAND, 2);
- m_scalable = new wxCheckBox(this, 0, wxT("Scalable Zoom"));
- s_rend2d->Add(m_scalable, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- m_noyuv = new wxCheckBox(this, 0, wxT("Disable YUV hardware"));
- bs->Add(m_noyuv, wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_yuvtxt = new wxStaticText(this, 0, wxT("(No YUV used)"), wxDefaultPosition, wxSize(60, 20), wxALIGN_LEFT);
- bs->Add(m_yuvtxt, wxALIGN_CENTER|wxADJUST_MINSIZE);
- s_rend2d->Add(bs, 0, wxALL|wxEXPAND, 2);
- s_main->Add(s_rend2d, 0, wxEXPAND, 0);
-
- /*Render 3D*/
- s_rend3d = new wxBoxSizer(wxVERTICAL);
- m_raster_outlines = new wxCheckBox(this, 0, wxT("Use OpenGL Raster outlines"));
- s_rend3d->Add(m_raster_outlines, 0, wxALL|wxEXPAND, 2);
- m_polyaa = new wxCheckBox(this, 0, wxT("Enable polygon anti-aliasing"));
- s_rend3d->Add(m_polyaa, 0, wxALL|wxEXPAND, 2);
- m_nobackcull = new wxCheckBox(this, 0, wxT("Disable backface culling"));
- s_rend3d->Add(m_nobackcull, 0, wxALL|wxEXPAND, 2);
-
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Wireframe mode")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_wire = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_wire, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_rend3d->Add(bs, 0, wxALL|wxEXPAND, 2);
-
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Draw Normals")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_normals = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_normals, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_rend3d->Add(bs, 0, wxALL|wxEXPAND, 2);
-
- m_emulpow2 = new wxCheckBox(this, 0, wxT("Emulate power-of-two textures for video"));
- s_rend3d->Add(m_emulpow2, 0, wxALL|wxEXPAND, 2);
- m_norectext = new wxCheckBox(this, 0, wxT("Disable rectangular texture extensions"));
- s_rend3d->Add(m_norectext, 0, wxALL|wxEXPAND, 2);
- m_copypixels = new wxCheckBox(this, 0, wxT("Bitmap node uses direct pixel copy"));
- s_rend3d->Add(m_copypixels, 0, wxALL|wxEXPAND, 2);
- s_main->Add(s_rend3d, 0, wxEXPAND, 0);
-
- /*video*/
- s_video = new wxBoxSizer(wxVERTICAL);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Video Driver")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- m_video = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_video , wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_video->Add(bs, 0, wxALL|wxEXPAND, 2);
- m_switchres = new wxCheckBox(this, 0, wxT("Change video resolution in fullscreen"));
- s_video->Add(m_switchres, 0, wxALL|wxEXPAND, 2);
- m_usehwmem = new wxCheckBox(this, 0, wxT("Use hardware memory in 2D mode"));
- s_video->Add(m_usehwmem, 0, wxALL|wxEXPAND, 2);
- s_main->Add(s_video, 0, wxEXPAND, 0);
-
-
- /*audio*/
- s_audio = new wxBoxSizer(wxVERTICAL);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Audio Driver")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_audio = new wxComboBox(this, ID_AUDIO_DRIVER, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_audio, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_audio->Add(bs, 0, wxALL|wxEXPAND, 2);
- m_forcecfg = new wxCheckBox(this, ID_FORCE_AUDIO, wxT("Force Audio Config"));
- m_forcecfg->SetValue(1);
- s_audio->Add(m_forcecfg, 0, wxALL|wxEXPAND, 2);
-
-
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Number of buffers")), wxALIGN_CENTER|wxADJUST_MINSIZE);
- m_nbbuf = new wxSpinCtrl(this, -1, wxT(""), wxDefaultPosition, wxSize(20, 20), wxSP_WRAP | wxSP_ARROW_KEYS, 1, 30, 15);
- m_nbbuf->SetValue(8);
- bs->Add(m_nbbuf, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_audio->Add(bs, 0, wxALL|wxEXPAND, 2);
-
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Total length in ms")), wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_buflen = new wxSpinCtrl(this, -1, wxT(""), wxDefaultPosition, wxSize(20, 20), wxSP_WRAP | wxSP_ARROW_KEYS, 1, 1000);
- m_buflen->SetValue(400);
- bs->Add(m_buflen, wxALIGN_CENTER | wxADJUST_MINSIZE|wxLEFT,10);
- s_audio->Add(bs, 0, wxALL|wxEXPAND, 2);
-
- m_noresync = new wxCheckBox(this, -1, wxT("Disable Resynchronization"));
- s_audio->Add(m_noresync);
- m_nomulitch = new wxCheckBox(this, -1, wxT("Disable Multichannel"));
- s_audio->Add(m_nomulitch);
-#ifdef WIN32
- m_notifs = new wxCheckBox(this, -1, wxT("Disable DirectSound Notifications"));
- s_audio->Add(m_notifs);
-#endif
- s_main->Add(s_audio, 0, wxEXPAND, 0);
-
- /*font*/
- s_font = new wxBoxSizer(wxVERTICAL);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Font Engine")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- m_font = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_font, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_font->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("System Font Directory")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- m_fontdir = new wxButton(this, ID_FONT_DIR, wxT("..."), wxDefaultPosition, wxDefaultSize);
- bs->Add(m_fontdir, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_font->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Text Texturing Mode")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- m_texturemode = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
- bs->Add(m_texturemode, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_font->Add(bs, 0, wxALL|wxEXPAND, 2);
- s_main->Add(s_font, 0, wxEXPAND, 0);
-
- /*download*/
- s_dnld = new wxBoxSizer(wxVERTICAL);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Cache Directory")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- m_cachedir = new wxButton(this, ID_CACHE_DIR, wxT("..."));
- bs->Add(m_cachedir, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_dnld->Add(bs, 0, wxALL|wxEXPAND, 2);
- m_cleancache = new wxCheckBox(this, -1, wxT("Remove temp files on exit"));
- s_dnld->Add(m_cleancache);
- m_restartcache = new wxCheckBox(this, -1, wxT("Always redownload incomplete cached files"));
- s_dnld->Add(m_restartcache);
- bs = new wxBoxSizer(wxHORIZONTAL);
- m_progressive = new wxCheckBox(this, ID_PROGRESSIVE, wxT("XML progressive load"));
- bs->Add(m_progressive, wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_sax_duration = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 120), wxSize(60, 20));
- bs->Add(m_sax_duration, wxALIGN_CENTER | wxADJUST_MINSIZE);
- bs->Add(new wxStaticText(this, 0, wxT("max load slice (ms)")), wxADJUST_MINSIZE | wxALIGN_CENTER);
- s_dnld->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- m_use_proxy = new wxCheckBox(this, ID_USE_PROXY, wxT("Use proxy"));
- bs->Add(m_use_proxy, wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_proxy_name = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 120), wxSize(60, 20));
- bs->Add(m_proxy_name, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_dnld->Add(bs, 0, wxALL|wxEXPAND, 2);
- s_main->Add(s_dnld, 0, wxEXPAND, 0);
-
- /*streaming*/
- s_stream = new wxBoxSizer(wxVERTICAL);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Default RTSP port")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- m_port = new wxComboBox(this, ID_RTSP_PORT, wxT(""), wxPoint(160, 40), wxSize(140, 30), 0, NULL, wxCB_READONLY);
- bs->Add(m_port, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
- m_rtsp = new wxCheckBox(this, ID_RTP_OVER_RTSP, wxT("RTP over RTSP"), wxPoint(10, 80), wxSize(140, 20));
- m_reorder = new wxCheckBox(this, -1, wxT("use RTP reordering"), wxPoint(160, 80), wxSize(130, 20));
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(m_rtsp, wxALIGN_CENTER | wxADJUST_MINSIZE);
- bs->Add(m_reorder, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- m_timeout = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 120), wxSize(60, 20));
- bs->Add(new wxStaticText(this, 0, wxT("Control Timeout (ms): ")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- bs->Add(m_timeout, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- m_buffer = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 150), wxSize(60, 20));
- bs->Add(new wxStaticText(this, 0, wxT("Media Buffering (ms): ")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- bs->Add(m_buffer, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
- bs = new wxBoxSizer(wxHORIZONTAL);
- m_dorebuffer = new wxCheckBox(this, ID_RTSP_REBUFFER, wxT("Rebuffer if below"));
- bs->Add(m_dorebuffer, wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_rebuffer = new wxTextCtrl(this, 0, wxT(""), wxPoint(200, 180), wxSize(60, 20));
- bs->Add(m_rebuffer, wxALIGN_CENTER | wxADJUST_MINSIZE);
- m_rebuffer->Disable();
- s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
- s_main->Add(s_stream, 0, wxEXPAND, 0);
-
- /*streaming cache*/
- s_rec = new wxBoxSizer(wxVERTICAL);
- bs = new wxBoxSizer(wxHORIZONTAL);
- bs->Add(new wxStaticText(this, 0, wxT("Record To: ")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
- m_recdir = new wxButton(this, ID_RECORD_DIR, wxT("..."));
- bs->Add(m_recdir, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_rec->Add(bs, 0, wxALL|wxEXPAND, 2);
- m_overwrite = new wxCheckBox(this, -1, wxT("Overwrite existing files"));
- s_rec->Add(m_overwrite);
- bs = new wxBoxSizer(wxHORIZONTAL);
- m_usename = new wxCheckBox(this, ID_USE_FILENAME, wxT("Use filename"));
- m_recfile = new wxTextCtrl(this, 0, wxT(""));
- bs->Add(m_usename, wxALIGN_CENTER | wxADJUST_MINSIZE);
- bs->Add(m_recfile, wxALIGN_CENTER | wxADJUST_MINSIZE);
- s_rec->Add(bs, 0, wxALL|wxEXPAND, 2);
- s_main->Add(s_rec, 0, wxEXPAND, 0);
-
- /*load options*/
- GF_Config *cfg = m_pApp->m_user.config;
- /*general*/
- sOpt = gf_cfg_get_key(cfg, "General", "Loop");
- m_loop->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "General", "LookForSubtitles");
- m_lookforsubs->SetValue((sOpt && !stricmp(sOpt, "no")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "General", "ConsoleOff");
- m_noconsole->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "General", "ViewXMT");
- m_viewxmt->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- /*lang config*/
- u32 count = gf_lang_get_count();
- for (i=0; i<count; i++) {
- m_lang->Append(wxString(gf_lang_get_name(i), wxConvUTF8) );
- }
-
- sOpt = gf_cfg_get_key(cfg, "Systems", "Language3CC");
- if (!sOpt) sOpt = "eng";
- s32 select = gf_lang_find(sOpt);
- if (select<0) select = 0;
- m_lang->SetSelection(select);
-
- /*systems config*/
- sOpt = gf_cfg_get_key(cfg, "Systems", "ThreadingPolicy");
- select = 0;
- m_thread->Append(wxT("Single Thread"));
- m_thread->Append(wxT("Mutli Thread"));
- if (sOpt && !stricmp(sOpt, "Multi")) select = 1;
- m_thread->Append(wxT("Free"));
- if (sOpt && !stricmp(sOpt, "Free")) select = 2;
- m_thread->SetSelection(select);
- sOpt = gf_cfg_get_key(cfg, "Systems", "ForceSingleClock");
- m_singletime->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Systems", "AlwaysDrawBIFS");
- m_bifsalwaysdrawn->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-
- /*audio dec enum*/
- sOpt = gf_cfg_get_key(cfg, "Systems", "DefAudioDec");
- u32 count = gf_modules_get_count(m_pApp->m_user.modules);
- GF_BaseDecoder *ifc_d;
- select = 0;
- s32 to_sel = 0;
- for (i=0; i<count; i++) {
- ifc_d = (GF_BaseDecoder *) gf_modules_load_interface(m_pApp->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
- if (!ifc_d) continue;
- if (ifc_d->CanHandleStream(ifc_d, GF_STREAM_AUDIO, NULL, 0)) {
- if (sOpt && !stricmp(ifc_d->module_name, sOpt)) select = to_sel;
- m_decaudio->Append(wxString(ifc_d->module_name, wxConvUTF8) );
- to_sel++;
- }
- gf_modules_close_interface((GF_BaseInterface *) ifc_d);
- }
- m_decaudio->SetSelection(select);
-
- /*video dec enum*/
- sOpt = gf_cfg_get_key(cfg, "Systems", "DefVideoDec");
- select = to_sel = 0;
- for (i=0; i<count; i++) {
- ifc_d = (GF_BaseDecoder *) gf_modules_load_interface(m_pApp->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
- if (!ifc_d) continue;
- if (ifc_d->CanHandleStream(ifc_d, GF_STREAM_VISUAL, NULL, 0)) {
- if (sOpt && !stricmp(ifc_d->module_name, sOpt)) select = to_sel;
- m_decvideo->Append(wxString(ifc_d->module_name, wxConvUTF8) );
- to_sel++;
- }
- gf_modules_close_interface((GF_BaseInterface *) ifc_d);
- }
- m_decvideo->SetSelection(select);
-
- /*rendering FIXME*/
- m_bWas3D = 0;
- m_use3D->SetValue(m_bWas3D ? 1 : 0);
-
- sOpt = gf_cfg_get_key(cfg, "Compositor", "ForceSceneSize");
- m_force_size->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(cfg, "Compositor", "FrameRate");
- if (!sOpt) sOpt = "30.0";
- select = 0;
- for (i = 0; i<NUM_RATES; i++) {
- m_fps->Append(wxString(BIFSRates[i], wxConvUTF8) );
- if (sOpt && !stricmp(sOpt, BIFSRates[i]) ) select = i;
- }
- m_fps->SetSelection(select);
-
- sOpt = gf_cfg_get_key(cfg, "Compositor", "HighSpeed");
- m_fast->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- sOpt = gf_cfg_get_key(cfg, "Compositor", "AntiAlias");
- m_aa->Append(wxT("None"));
- m_aa->Append(wxT("Text only"));
- m_aa->Append(wxT("Complete"));
- select = 2;
- if (sOpt && !stricmp(sOpt, "Text")) select = 1;
- else if (sOpt && !stricmp(sOpt, "None")) select = 0;
- m_aa->SetSelection(select);
-
- sOpt = gf_cfg_get_key(cfg, "Compositor", "BoundingVolume");
- m_draw_bounds->Append(wxT("None"));
- m_draw_bounds->Append(wxT("Box/Rect"));
- m_draw_bounds->Append(wxT("AABB Tree"));
- select = 0;
- if (sOpt && !stricmp(sOpt, "Box")) select = 1;
- else if (sOpt && !stricmp(sOpt, "AABB")) select = 2;
- m_draw_bounds->SetSelection(select);
-
- /*render2d*/
- sOpt = gf_cfg_get_key(cfg, "Compositor", "DirectDraw");
- m_direct->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Compositor", "ScalableZoom");
- m_scalable->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Compositor", "DisableYUV");
- m_noyuv->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- SetYUVLabel();
-
- /*graphics driver enum*/
- sOpt = gf_cfg_get_key(cfg, "core", "raster2d");
- GF_BaseInterface *ifce;
- select = to_sel = 0;
- for (i=0; i<count; i++) {
- ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_RASTER_2D_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
- m_graph->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) );
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_graph->SetSelection(select);
-
- /*render3d*/
- sOpt = gf_cfg_get_key(cfg, "Compositor", "RasterOutlines");
- m_raster_outlines->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Compositor", "EmulatePOW2");
- m_emulpow2->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Compositor", "PolygonAA");
- m_polyaa->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Compositor", "BackFaceCulling");
- m_nobackcull->SetValue((sOpt && !stricmp(sOpt, "Off")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Compositor", "Wireframe");
- sOpt = gf_cfg_get_key(cfg, "Compositor", "BitmapCopyPixels");
- m_copypixels->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Compositor", "DisableRectExt");
- m_norectext->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- m_wire->Append(wxT("No Wireframe"));
- m_wire->Append(wxT("Wireframe Only"));
- m_wire->Append(wxT("Solid and Wireframe"));
- sOpt = gf_cfg_get_key(cfg, "Compositor", "Wireframe");
- if (sOpt && !stricmp(sOpt, "WireOnly")) m_wire->SetSelection(1);
- else if (sOpt && !stricmp(sOpt, "WireOnSolid")) m_wire->SetSelection(2);
- else m_wire->SetSelection(0);
- m_normals->Append(wxT("Never"));
- m_normals->Append(wxT("Per Face"));
- m_normals->Append(wxT("Per Vertex"));
- sOpt = gf_cfg_get_key(cfg, "Compositor", "DrawNormals");
- if (sOpt && !stricmp(sOpt, "PerFace")) m_normals->SetSelection(1);
- else if (sOpt && !stricmp(sOpt, "PerVertex")) m_normals->SetSelection(2);
- else m_normals->SetSelection(0);
-
- /*video*/
- m_switchres->SetValue( gf_cfg_get_bool(cfg, "core", "switch-vres") );
- sOpt = gf_cfg_get_key(cfg, "core", "hwvmem");
- m_usehwmem->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "core", "video-output");
- select = to_sel = 0;
- for (i=0; i<count; i++) {
- ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_VIDEO_OUTPUT_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
- m_video->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) );
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_video->SetSelection(select);
-
- /*audio*/
- sOpt = gf_cfg_get_key(cfg, "Audio", "ForceConfig");
- m_forcecfg->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Audio", "NumBuffers");
- m_nbbuf->SetValue( sOpt ? wxString(sOpt, wxConvUTF8) : wxT("2"));
- sOpt = gf_cfg_get_key(cfg, "Audio", "TotalDuration");
- m_buflen->SetValue( sOpt ? wxString(sOpt, wxConvUTF8) : wxT("120"));
- wxCommandEvent event;
- ForceAudio(event);
- sOpt = gf_cfg_get_key(cfg, "Audio", "NoResync");
- m_noresync->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Audio", "DisableMultiChannel");
- m_nomulitch->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
- /*driver enum*/
- sOpt = gf_cfg_get_key(cfg, "core", "audio-output");
- select = to_sel = 0;
- for (i=0; i<count; i++) {
- ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_AUDIO_OUTPUT_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
- m_audio->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) );
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_audio->SetSelection(select);
-#ifdef WIN32
- sOpt = gf_cfg_get_key(cfg, "Audio", "DisableNotification");
- m_notifs->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- wxCommandEvent audevt;
- OnSetAudioDriver(audevt);
-#endif
-
- /*font*/
- sOpt = gf_cfg_get_key(cfg, "FontCache", "FontReader");
- to_sel = select = 0;
- for (i=0; i<count; i++) {
- ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_FONT_READER_INTERFACE);
- if (!ifce) continue;
- if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
- m_font->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) );
- gf_modules_close_interface(ifce);
- to_sel++;
- }
- m_font->SetSelection(select);
- sOpt = gf_cfg_get_key(cfg, "FontCache", "FontDirectory");
- if (sOpt) m_fontdir->SetLabel(wxString(sOpt, wxConvUTF8) );
- sOpt = gf_cfg_get_key(cfg, "Compositor", "TextureTextMode");
- m_texturemode->Append(wxT("Default"));
- m_texturemode->Append(wxT("Never"));
- m_texturemode->Append(wxT("Always"));
- if (sOpt && !stricmp(sOpt, "Always")) m_texturemode->SetSelection(2);
- else if (sOpt && !stricmp(sOpt, "3D")) m_texturemode->SetSelection(1);
- else m_texturemode->SetSelection(0);
-
- /*downloader*/
- sOpt = gf_cfg_get_key(cfg, "Core", "CacheDirectory");
- if (sOpt) m_cachedir->SetLabel(wxString(sOpt, wxConvUTF8) );
- sOpt = gf_cfg_get_key(cfg, "Core", "CleanCache");
- m_cleancache->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "Core", "RestartFiles");
- m_restartcache->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "SAXLoader", "Progressive");
- m_progressive->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- sOpt = gf_cfg_get_key(cfg, "SAXLoader", "MaxDuration");
- m_sax_duration->SetValue(sOpt ? wxString(sOpt, wxConvUTF8) : wxT("30"));
- if (! m_progressive->GetValue()) m_sax_duration->Enable(0);
-
- sOpt = gf_cfg_get_key(cfg, "Core", "HTTPProxyEnabled");
- m_use_proxy->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
- char szProxy[GF_MAX_PATH];
- strcpy(szProxy, "");
- sOpt = gf_cfg_get_key(cfg, "Core", "HTTPProxyName");
- if (sOpt) {
- strcat(szProxy, sOpt);
- sOpt = gf_cfg_get_key(cfg, "Core", "HTTPProxyPort");
- if (sOpt) {
- strcat(szProxy, ":");
- strcat(szProxy, sOpt);
- }
- } else {
- m_use_proxy->SetValue(0);
- }
- m_proxy_name->SetValue( wxString((char *)szProxy, wxConvUTF8) );
- if (! m_use_proxy->GetValue()) m_proxy_name->Enable(0);
-
- /*streaming*/
- m_port->Append(wxT("554 (RTSP standard)"));
- m_port->Append(wxT("7070 (RTSP ext)"));
- m_port->Append(wxT("80 (RTSP / HTTP tunnel)"));
- m_port->Append(wxT("8080 (RTSP / HTTP tunnel)"));
- sOpt = gf_cfg_get_key(cfg, "Streaming", "DefaultPort");
- u32 port = 554;
- Bool force_rtsp = 0;
- if (sOpt) port = atoi(sOpt);
- switch (port) {
- case 8080:
- m_port->SetSelection(3);
- force_rtsp = 1;
- break;
- case 80:
- m_port->SetSelection(2);
- force_rtsp = 1;
- break;
- case 7070:
- m_port->SetSelection(1);
- break;
- default:
- m_port->SetSelection(0);
- break;
- }
-
- Bool use_rtsp = 0;
- sOpt = gf_cfg_get_key(cfg, "Streaming", "RTPoverRTSP");
- if (sOpt && !stricmp(sOpt, "yes")) use_rtsp = 1;
-
- if (force_rtsp) {
- m_rtsp->SetValue(1);
- m_rtsp->Enable(0);
- m_reorder->SetValue(0);
- m_reorder->Enable(0);
- } else {
- m_rtsp->SetValue(use_rtsp ? 1 : 0);
- m_rtsp->Enable(1);
- m_reorder->Enable(1);
- sOpt = gf_cfg_get_key(cfg, "Streaming", "ReorderSize");
- m_reorder->SetValue( (sOpt && !stricmp(sOpt, "0")) ? 1 : 0);
- }
- sOpt = gf_cfg_get_key(cfg, "Streaming", "RTSPTimeout");
- m_timeout->SetValue(sOpt ? wxString(sOpt, wxConvUTF8) : wxT("30000"));
- sOpt = gf_cfg_get_key(cfg, "Network", "BufferLength");
- m_buffer->SetValue(sOpt ? wxString(sOpt, wxConvUTF8) : wxT("3000"));
- sOpt = gf_cfg_get_key(cfg, "Network", "RebufferLength");
- u32 buf_len = 0;
- if (sOpt) buf_len = atoi(sOpt);
- if (buf_len) {
- m_dorebuffer->SetValue(1);
- m_rebuffer->SetValue(wxString(sOpt, wxConvUTF8));
- m_rebuffer->Enable(1);
- } else {
- m_dorebuffer->SetValue(0);
- m_rebuffer->SetValue(wxT("0"));
- m_rebuffer->Enable(0);
- }
-
- RTPoverRTSP(event);
-
- sOpt = gf_cfg_get_key(cfg, "StreamingCache", "RecordDirectory");
- if (!sOpt) sOpt = gf_cfg_get_key(cfg, "Core", "CacheDirectory");
- if (sOpt) m_recdir->SetLabel(wxString(sOpt, wxConvUTF8));
- sOpt = gf_cfg_get_key(cfg, "StreamingCache", "KeepExistingFiles");
- m_overwrite->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 0 : 1);
-
- sOpt = gf_cfg_get_key(cfg, "StreamingCache", "BaseFileName");
- if (sOpt) {
- m_usename->SetValue(1);
- m_recfile->Enable(1);
- m_recfile->SetValue(wxString(sOpt, wxConvUTF8));
- } else {
- m_usename->SetValue(0);
- m_recfile->Enable(0);
- m_recfile->SetValue(wxT("uses service URL"));
- }
-
- m_select->Append(wxT("General"));
- m_select->Append(wxT("MPEG-4 Systems"));
- m_select->Append(wxT("Media Decoders"));
- m_select->Append(wxT("Compositor"));
- m_select->Append(wxT("Renderer 2D"));
- m_select->Append(wxT("Renderer 3D"));
- m_select->Append(wxT("Video Output"));
- m_select->Append(wxT("Audio Output"));
- m_select->Append(wxT("Text Engine"));
- m_select->Append(wxT("File Download"));
- m_select->Append(wxT("Real-Time Streaming"));
- m_select->Append(wxT("Streaming Cache"));
-
- sOpt = gf_cfg_get_key(cfg, "General", "ConfigPanel");
- m_sel = sOpt ? atoi(sOpt) : 0;
- if (m_sel>11) m_sel=11;
- m_select->SetSelection(m_sel);
-
- DoSelect();
-}
-
-BEGIN_EVENT_TABLE(wxGPACControl, wxDialog)
- EVT_BUTTON(ID_APPLY, wxGPACControl::Apply)
- EVT_COMBOBOX(ID_SELECT, wxGPACControl::OnSetSelection)
- EVT_CHECKBOX(ID_FORCE_AUDIO, wxGPACControl::ForceAudio)
- EVT_COMBOBOX(ID_AUDIO_DRIVER, wxGPACControl::OnSetAudioDriver)
- EVT_BUTTON(ID_FONT_DIR, wxGPACControl::FontDir)
- EVT_BUTTON(ID_CACHE_DIR, wxGPACControl::CacheDir)
- EVT_CHECKBOX(ID_PROGRESSIVE, wxGPACControl::OnProgressive)
- EVT_CHECKBOX(ID_USE_PROXY, wxGPACControl::OnUseProxy)
- EVT_CHECKBOX(ID_RTP_OVER_RTSP, wxGPACControl::RTPoverRTSP)
- EVT_CHECKBOX(ID_RTSP_REBUFFER, wxGPACControl::Rebuffer)
- EVT_COMBOBOX(ID_RTSP_PORT, wxGPACControl::OnSetRTSPPort)
- EVT_CHECKBOX(ID_USE_FILENAME, wxGPACControl::OnUseFileName)
- EVT_BUTTON(ID_RECORD_DIR, wxGPACControl::OnRecDir)
-END_EVENT_TABLE()
-
-
-wxGPACControl::~wxGPACControl()
-{
- char str[20];
- sprintf(str, "%d", m_sel);
- gf_cfg_set_key(m_pApp->m_user.config, "General", "ConfigPanel", str);
-}
-
-
-void wxGPACControl::DoSelect()
-{
-
- /*hide everything*/
- s_main->Show(s_general, false);
- s_main->Show(s_mpeg4, false);
- s_main->Show(s_mdec, false);
- s_main->Show(s_rend, false);
- s_main->Show(s_rend2d, false);
- s_main->Show(s_rend3d, false);
- s_main->Show(s_video, false);
- s_main->Show(s_audio, false);
- s_main->Show(s_font, false);
- s_main->Show(s_dnld, false);
- s_main->Show(s_stream, false);
- s_main->Show(s_rec, false);
- switch (m_sel) {
- case 0:
- s_main->Show(s_general, true);
- break;
- case 1:
- s_main->Show(s_mpeg4, true);
- break;
- case 2:
- s_main->Show(s_mdec, true);
- break;
- case 3:
- s_main->Show(s_rend, true);
- break;
- case 4:
- s_main->Show(s_rend2d, true);
- break;
- case 5:
- s_main->Show(s_rend3d, true);
- break;
- case 6:
- s_main->Show(s_video, true);
- break;
- case 7:
- s_main->Show(s_audio, true);
- break;
- case 8:
- s_main->Show(s_font, true);
- break;
- case 9:
- s_main->Show(s_dnld, true);
- break;
- case 10:
- s_main->Show(s_stream, true);
- break;
- case 11:
- s_main->Show(s_rec, true);
- break;
- }
- SetSizer(s_main);
- s_main->Fit(this);
- //s_main->Layout();
- return;
-
-}
-
-void wxGPACControl::OnSetSelection(wxCommandEvent &WXUNUSED(event))
-{
- m_sel = m_select->GetSelection();
- DoSelect();
-}
-
-void wxGPACControl::FontDir(wxCommandEvent &WXUNUSED(event))
-{
- wxDirDialog dlg(this);
- dlg.SetPath(m_fontdir->GetLabel());
- if (dlg.ShowModal() == wxID_OK) {
- m_fontdir->SetLabel(dlg.GetPath());
- }
-}
-void wxGPACControl::CacheDir(wxCommandEvent &WXUNUSED(event))
-{
- wxDirDialog dlg(this);
- dlg.SetPath(m_cachedir->GetLabel());
- if (dlg.ShowModal() == wxID_OK) {
- m_cachedir->SetLabel(dlg.GetPath());
- }
-}
-
-void wxGPACControl::OnProgressive(wxCommandEvent &WXUNUSED(event))
-{
- m_sax_duration->Enable(m_progressive->GetValue() ? 1 : 0);
-}
-
-void wxGPACControl::OnUseProxy(wxCommandEvent &WXUNUSED(event))
-{
- m_proxy_name->Enable(m_use_proxy->GetValue() ? 1 : 0);
-}
-
-void wxGPACControl::RTPoverRTSP(wxCommandEvent &WXUNUSED(event))
-{
- m_reorder->Enable(m_rtsp->GetValue() ? 0 : 1);
-}
-
-void wxGPACControl::Rebuffer(wxCommandEvent &WXUNUSED(event))
-{
- if (m_dorebuffer->GetValue()) {
- m_rebuffer->Enable();
- } else {
- m_rebuffer->Disable();
- }
-}
-
-void wxGPACControl::OnSetRTSPPort(wxCommandEvent &WXUNUSED(event))
-{
- if (m_port->GetSelection() > 1) {
- m_rtsp->Enable(0);
- m_reorder->Enable(0);
- } else {
- m_rtsp->Enable(1);
- m_reorder->Enable(1);
- }
-}
-
-void wxGPACControl::OnRecDir(wxCommandEvent &WXUNUSED(event))
-{
- wxDirDialog dlg(this);
- dlg.SetPath(m_recdir->GetLabel());
- if (dlg.ShowModal() == wxID_OK) {
- m_recdir->SetLabel(dlg.GetPath());
- }
-}
-
-void wxGPACControl::OnUseFileName(wxCommandEvent &WXUNUSED(event))
-{
- if (m_usename->GetValue()) {
- m_recfile->Enable();
- m_recfile->SetValue(wxT("record"));
- } else {
- m_recfile->Disable();
- m_recfile->SetValue(wxT("uses service URL"));
- }
-}
-
-void wxGPACControl::ForceAudio(wxCommandEvent &WXUNUSED(event))
-{
- if (m_forcecfg->GetValue()) {
- m_nbbuf->Enable();
- m_buflen->Enable();
- } else {
- m_nbbuf->Disable();
- m_buflen->Disable();
- }
-}
-
-void wxGPACControl::OnSetAudioDriver(wxCommandEvent &WXUNUSED(event))
-{
-#ifdef WIN32
- if (strstr(m_audio->GetStringSelection().mb_str(wxConvUTF8), "DirectSound")) {
- m_notifs->Enable(1);
- } else {
- m_notifs->Enable(0);
- }
-#endif
-}
-
-
-
-void wxGPACControl::Apply(wxCommandEvent &WXUNUSED(event))
-{
- /*save options*/
- GF_Config *cfg = m_pApp->m_user.config;
-
- m_pApp->m_loop = m_loop->GetValue() ? 1 : 0;
- gf_cfg_set_key(cfg, "General", "Loop", m_loop->GetValue() ? "yes" : "no");
- m_pApp->m_lookforsubs = m_lookforsubs->GetValue() ? 1 : 0;
- gf_cfg_set_key(cfg, "General", "LookForSubtitles", m_lookforsubs->GetValue() ? "yes" : "no");
- m_pApp->m_console_off = m_noconsole->GetValue() ? 1 : 0;
- gf_cfg_set_key(cfg, "General", "ConsoleOff", m_noconsole->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "General", "ViewXMT", m_viewxmt->GetValue() ? "yes" : "no");
-
- s32 sel = m_lang->GetSelection();
- gf_cfg_set_key(cfg, "Systems", "LanguageName", gf_lang_get_name(sel) );
- gf_cfg_set_key(cfg, "Systems", "Language3CC", gf_lang_get_3cc(sel) );
- gf_cfg_set_key(cfg, "Systems", "Language2CC", gf_lang_get_2cc(sel) );
-
-
- sel = m_thread->GetSelection();
- gf_cfg_set_key(cfg, "Systems", "ThreadingPolicy", (sel==0) ? "Single" : ( (sel==1) ? "Multi" : "Free"));
- gf_cfg_set_key(cfg, "Systems", "ForceSingleClock", m_singletime->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Systems", "AlwaysDrawBIFS", m_bifsalwaysdrawn->GetValue() ? "yes" : "no");
-
- gf_cfg_set_key(cfg, "Systems", "DefAudioDec", m_decaudio->GetStringSelection().mb_str(wxConvUTF8));
- gf_cfg_set_key(cfg, "Systems", "DefVideoDec", m_decvideo->GetStringSelection().mb_str(wxConvUTF8));
-
-
- gf_cfg_set_key(cfg, "Compositor", "HighSpeed", m_fast->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Compositor", "ForceSceneSize", m_force_size->GetValue() ? "yes" : "no");
-
- gf_cfg_set_key(cfg, "Compositor", "FrameRate", BIFSRates[m_fps->GetSelection()]);
- sel = m_aa->GetSelection();
- gf_cfg_set_key(cfg, "Compositor", "AntiAlias", (sel==0) ? "None" : ( (sel==1) ? "Text" : "All"));
- sel = m_draw_bounds->GetSelection();
- gf_cfg_set_key(cfg, "Compositor", "BoundingVolume", (sel==2) ? "AABB" : (sel==1) ? "Box" : "None");
-
- Bool is_3D = m_use3D->GetValue() ? 1 : 0;
- if (m_bWas3D != is_3D) {
- /*FIXME*/
- }
- gf_cfg_set_key(cfg, "core", "raster2d", m_graph->GetStringSelection().mb_str(wxConvUTF8));
-
- gf_cfg_set_key(cfg, "Compositor", "DirectDraw", m_direct->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Compositor", "ScalableZoom", m_scalable->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Compositor", "DisableYUV", m_noyuv->GetValue() ? "yes" : "no");
-
- gf_cfg_set_key(cfg, "Compositor", "RasterOutlines", m_raster_outlines->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Compositor", "EmulatePOW2", m_emulpow2->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Compositor", "PolygonAA", m_polyaa->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Compositor", "DisableRectExt", m_norectext->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Compositor", "BitmapCopyPixels", m_copypixels->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Compositor", "BackFaceCulling", m_nobackcull->GetValue() ? "Off" : "On");
-
- sel = m_wire->GetSelection();
- gf_cfg_set_key(cfg, "Compositor", "Wireframe", (sel==2) ? "WireOnSolid" : ( (sel==1) ? "WireOnly" : "WireNone" ) );
- sel = m_normals->GetSelection();
- gf_cfg_set_key(cfg, "Compositor", "DrawNormals", (sel==2) ? "PerVertex" : ( (sel==1) ? "PerFace" : "Never" ) );
-
- gf_cfg_set_key(cfg, "core", "switch-vres", m_switchres->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "core", "hwvmem", m_usehwmem->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "core", "video-output", m_video->GetStringSelection().mb_str(wxConvUTF8));
-
-
- gf_cfg_set_key(cfg, "Audio", "ForceConfig", m_forcecfg->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Audio", "NoResync", m_noresync->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Audio", "DisableMultiChannel", m_nomulitch->GetValue() ? "yes" : "no");
-
- gf_cfg_set_key(cfg, "Audio", "NumBuffers", wxString::Format(wxT("%d"), m_nbbuf->GetValue()).mb_str(wxConvUTF8) );
- gf_cfg_set_key(cfg, "Audio", "TotalDuration", wxString::Format(wxT("%d"), m_buflen->GetValue()).mb_str(wxConvUTF8) );
- gf_cfg_set_key(cfg, "core", "audio-output", m_audio->GetStringSelection().mb_str(wxConvUTF8));
-#ifdef WIN32
- if (m_notifs->IsEnabled())
- gf_cfg_set_key(cfg, "Audio", "DisableNotification", m_notifs->GetValue() ? "yes" : "no");
-#endif
-
- gf_cfg_set_key(cfg, "FontCache", "FontReader", m_font->GetStringSelection().mb_str(wxConvUTF8));
- gf_cfg_set_key(cfg, "FontCache", "FontDirectory", m_fontdir->GetLabel().mb_str(wxConvUTF8));
- switch (m_texturemode->GetSelection()) {
- case 2:
- gf_cfg_set_key(cfg, "Compositor", "TextureTextMode", "Always");
- break;
- case 1:
- gf_cfg_set_key(cfg, "Compositor", "TextureTextMode", "Never");
- break;
- default:
- gf_cfg_set_key(cfg, "Compositor", "TextureTextMode", "Default");
- break;
- }
-
- gf_cfg_set_key(cfg, "Core", "CleanCache", m_cleancache->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "Core", "RestartFiles", m_restartcache->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "SAXLoader", "Progressive", m_progressive->GetValue() ? "yes" : "no");
- gf_cfg_set_key(cfg, "SAXLoader", "MaxDuration", m_sax_duration->GetLabel().mb_str(wxConvUTF8));
- gf_cfg_set_key(cfg, "Core", "CacheDirectory", m_cachedir->GetLabel().mb_str(wxConvUTF8));
-
-
- Bool force_rtsp = 0;
- switch (m_port->GetSelection()) {
- case 3:
- gf_cfg_set_key(cfg, "Streaming", "DefaultPort", "8080");
- force_rtsp = 1;
- break;
- case 2:
- gf_cfg_set_key(cfg, "Streaming", "DefaultPort", "80");
- force_rtsp = 1;
- break;
- case 1:
- gf_cfg_set_key(cfg, "Streaming", "DefaultPort", "7070");
- break;
- default:
- gf_cfg_set_key(cfg, "Streaming", "DefaultPort", "554");
- break;
- }
-
- if (force_rtsp) {
- gf_cfg_set_key(cfg, "Streaming", "RTPoverRTSP", "yes");
- } else {
- gf_cfg_set_key(cfg, "Streaming", "RTPoverRTSP", m_rtsp->GetValue() ? "yes" : "no");
- if (!m_rtsp->GetValue()) gf_cfg_set_key(cfg, "Streaming", "ReorderSize", m_dorebuffer->GetValue() ? "30" : "0");
- }
-
- gf_cfg_set_key(cfg, "Streaming", "RTSPTimeout", m_timeout->GetValue().mb_str(wxConvUTF8));
- gf_cfg_set_key(cfg, "Network", "BufferLength", m_buffer->GetValue().mb_str(wxConvUTF8));
- if (m_dorebuffer->GetValue()) {
- gf_cfg_set_key(cfg, "Network", "RebufferLength", m_rebuffer->GetValue().mb_str(wxConvUTF8));
- } else {
- gf_cfg_set_key(cfg, "Network", "RebufferLength", "0");
- }
-
- gf_cfg_set_key(cfg, "StreamingCache", "KeepExistingFiles", m_overwrite->GetValue() ? "no" : "yes");
- if (m_usename->GetValue()) {
- gf_cfg_set_key(cfg, "StreamingCache", "BaseFileName", m_recfile->GetValue().mb_str(wxConvUTF8));
- } else {
- gf_cfg_set_key(cfg, "StreamingCache", "BaseFileName", NULL);
- }
- gf_cfg_set_key(cfg, "StreamingCache", "RecordDirectory", m_recdir->GetLabel().mb_str(wxConvUTF8));
-
-
- gf_term_set_option(m_pApp->m_term, GF_OPT_RELOAD_CONFIG, 1);
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-#ifndef _OPTIONS_H
-#define _OPTIONS_H
-
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-
-#include <wx/spinbutt.h>
-#include <wx/spinctrl.h>
-
-enum
-{
- ID_SELECT = 1000,
- ID_APPLY,
-
- ID_MAKE_DEF,
- ID_FORCE_AUDIO,
- ID_AUDIO_DRIVER,
- ID_FONT_DIR,
- ID_CACHE_DIR,
- ID_PROGRESSIVE,
- ID_RTSP_PORT,
- ID_RTP_OVER_RTSP,
- ID_RTSP_REBUFFER,
- ID_RECORD_DIR,
- ID_USE_FILENAME,
- ID_USE_PROXY,
-};
-
-class wxOsmo4Frame;
-class wxGPACControl : public wxDialog
-{
-public:
- wxGPACControl(wxWindow *parent);
- virtual ~wxGPACControl();
-
-private:
- DECLARE_EVENT_TABLE()
-
- wxOsmo4Frame *m_pApp;
-
- wxComboBox *m_select;
- Bool m_bWas3D;
-
- void Apply(wxCommandEvent &event);
- void OnSetSelection(wxCommandEvent &event);
- void ForceAudio(wxCommandEvent &event);
- void OnSetAudioDriver(wxCommandEvent &event);
- void FontDir(wxCommandEvent &event);
- void CacheDir(wxCommandEvent &event);
- void OnProgressive(wxCommandEvent &event);
- void OnUseProxy(wxCommandEvent &event);
- void RTPoverRTSP(wxCommandEvent &event);
- void Rebuffer(wxCommandEvent &event);
- void OnSetRTSPPort(wxCommandEvent &event);
- void OnUseFileName(wxCommandEvent &event);
- void OnRecDir(wxCommandEvent &event);
- void DoSelect();
- s32 m_sel;
- void SetYUVLabel();
-
- wxBoxSizer *s_header, *s_main, *s_general, *s_mpeg4, *s_mdec, *s_rend, *s_rend2d, *s_rend3d, *s_audio, *s_video, *s_font, *s_dnld, *s_stream, *s_rec;
-
- /*general section*/
- wxCheckBox *m_loop, *m_lookforsubs, *m_noconsole, *m_viewxmt;
- /*MPEG-4 systems*/
- wxCheckBox *m_bifsalwaysdrawn, *m_singletime;
- wxComboBox *m_lang, *m_thread;
- /*media decoders*/
- wxComboBox *m_decaudio, *m_decvideo;
- /*Rendering*/
- wxComboBox *m_fps, *m_aa, *m_draw_bounds;
- wxCheckBox *m_use3D, *m_fast, *m_force_size;
- /*Renderer 2D*/
- wxComboBox *m_graph;
- wxCheckBox *m_noyuv, *m_direct, *m_scalable;
- wxStaticText *m_yuvtxt;
- /*Renderer 3D*/
- wxCheckBox *m_raster_outlines, *m_polyaa, *m_nobackcull, *m_emulpow2, *m_norectext, *m_copypixels;
- wxComboBox *m_wire, *m_normals;
- /*video*/
- wxComboBox *m_video;
- wxCheckBox *m_switchres, *m_usehwmem;
- /*audio*/
- wxSpinCtrl *m_nbbuf, *m_buflen;
- wxComboBox *m_audio;
- wxCheckBox *m_forcecfg, *m_noresync, *m_nomulitch;
-#ifdef WIN32
- wxCheckBox *m_notifs;
-#endif
- /*font*/
- wxComboBox *m_font;
- wxButton *m_fontdir;
- wxComboBox *m_texturemode;
- /*file download*/
- wxButton *m_cachedir;
- wxCheckBox *m_cleancache, *m_restartcache, *m_progressive, *m_use_proxy;
- wxTextCtrl *m_sax_duration, *m_proxy_name;
- /*streaming*/
- wxComboBox *m_port;
- wxCheckBox *m_rtsp, *m_reorder, *m_dorebuffer;
- wxTextCtrl *m_timeout, *m_buffer, *m_rebuffer;
- /*file recorder*/
- wxButton *m_recdir;
- wxCheckBox *m_overwrite, *m_usename;
- wxTextCtrl *m_recfile;
-};
-
-#endif
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- * GPAC is gf_free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-
-#include "wxOsmo4.h"
-#include "wxGPACControl.h"
-#include "fileprops.h"
-#include <wx/image.h>
-#include <gpac/modules/service.h>
-#include <gpac/network.h>
-#include <gpac/constants.h>
-#include <gpac/options.h>
-
-
-IMPLEMENT_APP(wxOsmo4App)
-
-#include "osmo4.xpm"
-
-#include <wx/dnd.h>
-
-
-
-
-
-#include <wx/filename.h>
-#include <wx/clipbrd.h>
-
-#include "toolbar.xpm"
-
-#include "Playlist.h"
-
-#ifdef WIN32
-#define FRAME_H 140
-#else
-#define FRAME_H 110
-#endif
-
-
-wxString get_pref_browser(GF_Config *cfg)
-{
- const char *sOpt = gf_cfg_get_key(cfg, "General", "Browser");
- if (sOpt) return wxString(sOpt, wxConvUTF8);
- return wxEmptyString;
- /*
- #ifdef __WXMAC__
- return wxT("safari");
- #else
- #ifdef WIN32
- return wxT("explorer.exe");
- #else
- return wxT("mozilla");
- #endif
- #endif*/
-}
-
-
-IMPLEMENT_DYNAMIC_CLASS(wxGPACEvent, wxEvent )
-
-wxGPACEvent::wxGPACEvent(wxWindow* win)
-{
- SetEventType(GPAC_EVENT);
- SetEventObject(win);
- gpac_evt.type = 0;
- to_url = wxT("");
-}
-wxEvent *wxGPACEvent::Clone() const
-{
- wxGPACEvent *evt = new wxGPACEvent((wxWindow *) m_eventObject);
- evt->to_url = to_url;
- evt->gpac_evt = gpac_evt;
- return evt;
-}
-
-#include <wx/wx.h>
-
-/*open file dlg*/
-BEGIN_EVENT_TABLE(OpenURLDlg, wxDialog)
- EVT_BUTTON(ID_URL_GO, OpenURLDlg::OnGo)
-END_EVENT_TABLE()
-
-OpenURLDlg::OpenURLDlg(wxWindow *parent, GF_Config *cfg)
- : wxDialog(parent, -1, wxString(wxT("Enter remote presentation location")))
-{
-#ifndef WIN32
- SetSize(430, 35);
-#else
- SetSize(430, 55);
-#endif
- Centre();
- m_url = new wxComboBox(this, -1, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN);
- m_url->SetSize(0, 2, 340, 18, wxSIZE_AUTO);
- m_go = new wxButton(this, ID_URL_GO, wxT("Go !"));
-#ifndef WIN32
- m_go->SetSize(344, 2, 20, 18, wxSIZE_AUTO);
-#else
- m_go->SetSize(364, 2, 30, 18, wxSIZE_AUTO);
-#endif
- m_urlVal = wxT("");
-
- m_cfg = cfg;
-
- const char *sOpt;
- u32 i=0;
-
- while (1) {
- sOpt = gf_cfg_get_key_name(m_cfg, "RecentFiles", i);
- if (!sOpt) break;
- m_url->Append(wxString(sOpt, wxConvUTF8) );
- i++;
- }
-}
-
-#define MAX_LAST_FILES 20
-void UpdateLastFiles(GF_Config *cfg, const char *URL)
-{
- u32 nb_entries;
- gf_cfg_set_key(cfg, "RecentFiles", URL, NULL);
- gf_cfg_insert_key(cfg, "RecentFiles", URL, "", 0);
- /*remove last entry if needed*/
- nb_entries = gf_cfg_get_key_count(cfg, "RecentFiles");
- if (nb_entries>MAX_LAST_FILES) {
- gf_cfg_set_key(cfg, "RecentFiles", gf_cfg_get_key_name(cfg, "RecentFiles", nb_entries-1), NULL);
- }
-}
-
-void OpenURLDlg::OnGo(wxCommandEvent& event)
-{
- m_urlVal = m_url->GetValue();
- UpdateLastFiles(m_cfg, m_urlVal.mb_str(wxConvUTF8));
- EndModal(wxID_OK);
-}
-/*end open file dlg*/
-
-#ifdef WIN32
-u32 get_sys_col(int idx)
-{
- u32 res;
- DWORD val = GetSysColor(idx);
- res = (val)&0xFF;
- res<<=8;
- res |= (val>>8)&0xFF;
- res<<=8;
- res |= (val>>16)&0xFF;
- return res;
-}
-#endif
-
-static void wxOsmo4_progress_cbk(const void *usr, const char *title, u64 done, u64 total)
-{
- if (!total) return;
- wxOsmo4Frame *app = (wxOsmo4Frame *)usr;
- s32 prog = (s32) ( (100 * (u64)done) / total);
- if (app->m_last_prog < prog) {
- app->m_last_prog = prog;
-
- if (prog<100) {
- /*appears to crash wxWidgets / X11 when refreshing the text too often*/
- if (app->m_LastStatusTime + 200 > gf_sys_clock()) return;
- char msg[1024];
- sprintf(msg, "%s %02d %%)", title, prog);
- //app->SetStatus(wxString(msg, wxConvUTF8));
- } else {
- app->SetStatus(wxT("Ready"));
- app->m_last_prog = -1;
- }
- }
-}
-
-Bool GPAC_EventProc(void *ptr, GF_Event *evt)
-{
- wxCommandEvent event;
- wxOsmo4Frame *app = (wxOsmo4Frame *)ptr;
-
- switch (evt->type) {
- case GF_EVENT_DURATION:
- app->m_duration = (u32) (evt->duration.duration*1000);
- app->m_can_seek = evt->duration.can_seek;
- if (app->m_duration<1100) app->m_can_seek = 0;
- app->m_pProg->Enable(app->m_can_seek ? 1 : 0);
- app->m_pPlayList->SetDuration((u32) evt->duration.duration);
- break;
- case GF_EVENT_MESSAGE:
- {
- const char *servName;
- if (!evt->message.service || !strcmp(evt->message.service, app->m_pPlayList->GetURL().mb_str(wxConvUTF8))) {
- servName = "main service";
- } else {
- servName = evt->message.service;
- }
- if (!evt->message.message) return 0;
-
- if (evt->message.error) {
- app->SetStatus(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(")") );
- if (!app->m_connected) app->m_pPlayList->SetDead();
- }
- else if (!app->m_console_off) {
- if (strstr(evt->message.message, "100 %")) {
- app->SetStatus(wxT(""));
- } else {
- app->SetStatus(wxString(evt->message.message, wxConvUTF8) );
- }
- }
-
-#if 0
- /*log*/
- if (evt->message.error)
- ::wxLogMessage(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(") ") + wxString(gf_error_to_string(evt->message.error), wxConvUTF8) );
- else
- ::wxLogMessage(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(")"));
-#endif
- }
- break;
- case GF_EVENT_PROGRESS:
- {
- const char *sTitle;
- if (evt->progress.progress_type==0) sTitle = (char *)"Buffer";
- else if (evt->progress.progress_type==1) sTitle = (char *)"Download";
- else if (evt->progress.progress_type==2) sTitle = (char *)"Import";
- gf_set_progress(sTitle, evt->progress.done, evt->progress.total);
- }
- break;
- case GF_EVENT_KEYDOWN:
- if (app->m_can_seek && (evt->key.flags & GF_KEY_MOD_ALT)) {
- s32 res;
- switch (evt->key.key_code) {
- case GF_KEY_LEFT:
- res = gf_term_get_time_in_ms(app->m_term) - 5*app->m_duration/100;
- if (res<0) res=0;
- gf_term_play_from_time(app->m_term, res, 0);
- break;
- case GF_KEY_RIGHT:
- res = gf_term_get_time_in_ms(app->m_term) + 5*app->m_duration/100;
- if ((u32) res>=app->m_duration) res = 0;
- gf_term_play_from_time(app->m_term, res, 0);
- break;
- case GF_KEY_DOWN:
- res = gf_term_get_time_in_ms(app->m_term) - 60000;
- if (res<0) res=0;
- gf_term_play_from_time(app->m_term, res, 0);
- break;
- case GF_KEY_UP:
- res = gf_term_get_time_in_ms(app->m_term) + 60000;
- if ((u32) res>=app->m_duration) res = 0;
- gf_term_play_from_time(app->m_term, res, 0);
- break;
- }
- } else if (evt->key.flags & GF_KEY_MOD_CTRL) {
- switch (evt->key.key_code) {
- case GF_KEY_LEFT:
- app->m_pPlayList->PlayPrev();
- break;
- case GF_KEY_RIGHT:
- app->m_pPlayList->PlayNext();
- break;
- }
- } else {
- switch (evt->key.key_code) {
- case GF_KEY_HOME:
- gf_term_set_option(app->m_term, GF_OPT_NAVIGATION_TYPE, 1);
- break;
- case GF_KEY_ESCAPE:
- if (gf_term_get_option(app->m_term, GF_OPT_FULLSCREEN))
- gf_term_set_option(app->m_term, GF_OPT_FULLSCREEN, 0);
- break;
- default:
- {
- wxGPACEvent wxevt(app);
- wxevt.gpac_evt = *evt;
- app->AddPendingEvent(wxevt);
- }
- break;
- }
- }
- break;
-
- case GF_EVENT_CONNECT:
- {
- wxGPACEvent wxevt(app);
- wxevt.gpac_evt.type = GF_EVENT_CONNECT;
- wxevt.gpac_evt.connect.is_connected = evt->connect.is_connected;
- if (!evt->connect.is_connected) app->m_duration = 0;
- app->AddPendingEvent(wxevt);
- }
- break;
- case GF_EVENT_NAVIGATE:
- {
- wxGPACEvent wxevt(app);
- wxevt.to_url = wxString(evt->navigate.to_url, wxConvUTF8);
- wxevt.gpac_evt.type = evt->type;
- app->AddPendingEvent(wxevt);
- }
- return 1;
- case GF_EVENT_SET_CAPTION:
- {
- wxGPACEvent wxevt(app);
- wxevt.to_url = wxString(evt->caption.caption, wxConvUTF8);
- wxevt.gpac_evt.type = evt->type;
- app->AddPendingEvent(wxevt);
- }
- return 1;
-
- case GF_EVENT_QUIT:
- case GF_EVENT_VIEWPOINTS:
- case GF_EVENT_STREAMLIST:
- case GF_EVENT_SCENE_SIZE:
-// case GF_EVENT_SIZE:
- {
- wxGPACEvent wxevt(app);
- wxevt.gpac_evt = *evt;
- app->AddPendingEvent(wxevt);
- }
- break;
- case GF_EVENT_DBLCLICK:
- gf_term_set_option(app->m_term, GF_OPT_FULLSCREEN, !gf_term_get_option(app->m_term, GF_OPT_FULLSCREEN));
- return 0;
- case GF_EVENT_MOUSEDOWN:
- if (!gf_term_get_option(app->m_term, GF_OPT_FULLSCREEN)) {
-#ifdef __WXGTK__
- app->m_pVisual->SetFocus();
-#else
- app->m_pView->SetFocus();
-#endif
- }
- break;
- case GF_EVENT_AUTHORIZATION:
- {
- wxGPACEvent wxevt(app);
- wxTextEntryDialog user_d (0,
- wxT("Please set the user name for connection"),
- wxString(evt->auth.site_url, wxConvUTF8),
- wxString(evt->auth.user, wxConvUTF8));
- if (user_d.ShowModal() != wxID_OK)
- return 0;
- strncpy(evt->auth.user, user_d.GetValue().mb_str(wxConvUTF8), 50);
- wxPasswordEntryDialog passwd_d(0,
- wxT("Please enter password"),
- wxString(evt->auth.site_url, wxConvUTF8),
- wxString(evt->auth.password, wxConvUTF8));
- if (passwd_d.ShowModal() != wxID_OK)
- return 0;
- strncpy(evt->auth.password, passwd_d.GetValue().mb_str(wxConvUTF8), 50);
- return 1;
- }
- case GF_EVENT_SYS_COLORS:
-#ifdef WIN32
- evt->sys_cols.sys_colors[0] = get_sys_col(COLOR_ACTIVEBORDER);
- evt->sys_cols.sys_colors[1] = get_sys_col(COLOR_ACTIVECAPTION);
- evt->sys_cols.sys_colors[2] = get_sys_col(COLOR_APPWORKSPACE);
- evt->sys_cols.sys_colors[3] = get_sys_col(COLOR_BACKGROUND);
- evt->sys_cols.sys_colors[4] = get_sys_col(COLOR_BTNFACE);
- evt->sys_cols.sys_colors[5] = get_sys_col(COLOR_BTNHIGHLIGHT);
- evt->sys_cols.sys_colors[6] = get_sys_col(COLOR_BTNSHADOW);
- evt->sys_cols.sys_colors[7] = get_sys_col(COLOR_BTNTEXT);
- evt->sys_cols.sys_colors[8] = get_sys_col(COLOR_CAPTIONTEXT);
- evt->sys_cols.sys_colors[9] = get_sys_col(COLOR_GRAYTEXT);
- evt->sys_cols.sys_colors[10] = get_sys_col(COLOR_HIGHLIGHT);
- evt->sys_cols.sys_colors[11] = get_sys_col(COLOR_HIGHLIGHTTEXT);
- evt->sys_cols.sys_colors[12] = get_sys_col(COLOR_INACTIVEBORDER);
- evt->sys_cols.sys_colors[13] = get_sys_col(COLOR_INACTIVECAPTION);
- evt->sys_cols.sys_colors[14] = get_sys_col(COLOR_INACTIVECAPTIONTEXT);
- evt->sys_cols.sys_colors[15] = get_sys_col(COLOR_INFOBK);
- evt->sys_cols.sys_colors[16] = get_sys_col(COLOR_INFOTEXT);
- evt->sys_cols.sys_colors[17] = get_sys_col(COLOR_MENU);
- evt->sys_cols.sys_colors[18] = get_sys_col(COLOR_MENUTEXT);
- evt->sys_cols.sys_colors[19] = get_sys_col(COLOR_SCROLLBAR);
- evt->sys_cols.sys_colors[20] = get_sys_col(COLOR_3DDKSHADOW);
- evt->sys_cols.sys_colors[21] = get_sys_col(COLOR_3DFACE);
- evt->sys_cols.sys_colors[22] = get_sys_col(COLOR_3DHIGHLIGHT);
- evt->sys_cols.sys_colors[23] = get_sys_col(COLOR_3DLIGHT);
- evt->sys_cols.sys_colors[24] = get_sys_col(COLOR_3DSHADOW);
- evt->sys_cols.sys_colors[25] = get_sys_col(COLOR_WINDOW);
- evt->sys_cols.sys_colors[26] = get_sys_col(COLOR_WINDOWFRAME);
- evt->sys_cols.sys_colors[27] = get_sys_col(COLOR_WINDOWTEXT);
- return 1;
-#else
- memset(evt->sys_cols.sys_colors, 0, sizeof(u32)*28);
- return 1;
-#endif
- }
- return 0;
-}
-
-
-
-bool wxOsmo4App::OnInit()
-{
-#ifdef __WXGTK__
- XSynchronize((Display *) wxGetDisplay(), 1);
-#endif
- wxFrame *frame = new wxOsmo4Frame();
- frame->Show(TRUE);
- SetTopWindow(frame);
- return true;
-}
-
-
-class myDropfiles : public wxFileDropTarget
-{
-public:
- myDropfiles() : wxFileDropTarget() {}
- virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
- wxOsmo4Frame *m_pMain;
-};
-
-bool myDropfiles::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
-{
- u32 count = filenames.GetCount();
-
- if (count==1) {
- const char *ext = strrchr(filenames.Item(0).mb_str(wxConvUTF8) , '.');
- /*if playing and sub d&d, open sub in current presentation*/
- if (m_pMain->m_connected && ext && ( !stricmp(ext, ".srt") || !stricmp(ext, ".sub") || !stricmp(ext, ".ttxt") || !stricmp(ext, ".xml") ) ) {
- m_pMain->AddSubtitle(filenames.Item(0).mb_str(wxConvUTF8) , 1);
- return TRUE;
- }
- }
-
- for (u32 i=0; i<count; i++)
- m_pMain->m_pPlayList->QueueURL(filenames.Item(i));
-
- m_pMain->m_pPlayList->RefreshList();
- m_pMain->m_pPlayList->PlayNext();
- return TRUE;
-}
-
-bool GPACLogs::OnFrameClose(wxFrame *frame)
-{
- Show(FALSE);
- return 0;
-}
-
-void wxOsmo4Frame::ShowViewWindow(Bool do_show)
-{
- m_pView->Show(do_show ? 1 : 0);
-#ifdef __WXGTK__
- //m_pView->Show(0);
-#endif
-}
-
-#ifdef __WXGTK__
-extern "C" {
-#ifdef __WXGTK20__
- int gdk_x11_drawable_get_xid( void * );
- void *gdk_x11_drawable_get_xdisplay( void * );
-#endif
- void *gtk_widget_get_parent_window( void * );
-}
-#endif
-
-
-void wxOsmo4Frame::CheckVideoOut()
-{
- const char *sOpt = gf_cfg_get_key(m_user.config, "core", "video-output");
- void *os_handle = NULL;
- void *os_display = NULL;
- /*build a child window for embed display*/
- if (sOpt && stricmp(sOpt, "SDL Video Output")) {
- if (m_user.os_window_handler) return;
- m_bExternalView = 0;
-
-#ifdef __WXGTK__
- GtkWidget* widget = m_pVisual->GetHandle();
-
-#ifdef __WXGTK20__
- os_handle = (void *) gdk_x11_drawable_get_xid(gtk_widget_get_parent_window(widget));
-#else
- os_handle = (void *)*(int *)( (char *)gtk_widget_get_parent_window(widget) + 2 * sizeof(void *) );
-#endif
-
-#elif defined (WIN32)
- os_handle = m_pView->GetHandle();
-#endif
- if (os_handle) {
- m_user.os_window_handler = os_handle;
- m_user.os_display = os_display;
- ShowViewWindow(1);
- m_pView->SetSize(320, 240);
- SetSize(wxSize(320, 240+FRAME_H));
- SetWindowStyle(wxDEFAULT_FRAME_STYLE);
- DoLayout(320, 240);
- return;
- }
- }
- /*we're using SDL, don't use SDL hack*/
- m_bExternalView = 1;
- m_user.os_window_handler = 0;
- m_user.os_display = NULL;
- SetSize(wxSize(320,FRAME_H));
- m_pView->SetSize(0, 0);
- ShowViewWindow(0);
- DoLayout();
- SetWindowStyle(wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX | wxRESIZE_BORDER));
-}
-
-static void wxOsmo4_do_log(void *cbk, GF_LOG_Level level, GF_LOG_Tool tool, const char *fmt, va_list list)
-{
- wxOsmo4Frame *osmo = (wxOsmo4Frame *)cbk;
-
- if (osmo->m_logs) {
- vfprintf(osmo->m_logs, fmt, list);
- fflush(osmo->m_logs);
- } else {
- ::wxVLogMessage(wxString(fmt, wxConvUTF8), list);
- }
-}
-
-
-Bool wxOsmo4Frame::LoadTerminal()
-{
- m_term = NULL;
- memset(&m_user, 0, sizeof(GF_User));
-
- /*locate exec dir for cfg file*/
- wxPathList pathList;
- wxString currentDir(wxGetCwd());
- wxString abs_gpac_path = wxT("");
- char *gpac_cfg, *sep;
-
- ::wxLogMessage(wxT("Looking for GPAC configuration file"));
-
- /*load config*/
- Bool first_launch = 0;
- m_user.config = gf_cfg_init(NULL, &first_launch);
-
- if (!m_user.config) {
- wxMessageDialog(NULL, wxT("Cannot open GPAC configuration file"), wxT("Init error"), wxOK);
- return 0;
- }
-
- gpac_cfg = gf_cfg_get_filename(m_user.config);
- sep = strrchr(gpac_cfg, '/');
- if (!sep) sep = strrchr(gpac_cfg, '\\');
- if (sep) sep[0] = 0;
- strcpy(szAppPath, gpac_cfg);
- if (sep) sep[0] = '/';
-
- /*check log file*/
- const char *str = gf_cfg_get_key(m_user.config, "General", "LogFile");
- if (str) m_logs = gf_fopen(str, "wt");
- gf_log_set_callback(this, wxOsmo4_do_log);
-
- /*set log level*/
- gf_log_set_tools_levels( gf_cfg_get_key(m_user.config, "General", "Logs") );
-
- gf_sys_init(GF_MemTrackerNone);
-
- ::wxLogMessage(wxT("GPAC configuration file opened - looking for modules"));
-
- m_user.modules = gf_modules_new(str, m_user.config);
- /*initial launch*/
- if (!m_user.modules || !gf_modules_get_count(m_user.modules)) {
- wxMessageDialog(NULL, wxT("No modules available - system cannot work"), wxT("Fatal Error"), wxOK).ShowModal();
- if (m_user.modules) gf_modules_del(m_user.modules);
- gf_cfg_del(m_user.config);
- m_user.config = NULL;
- return 0;
- }
-
- if (first_launch) {
- u32 i;
- for (i=0; i<gf_modules_get_count(m_user.modules); i++) {
- GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(m_user.modules, i, GF_NET_CLIENT_INTERFACE);
- if (!ifce) continue;
- if (ifce) {
- ifce->CanHandleURL(ifce, "test.test");
- gf_modules_close_interface((GF_BaseInterface *) ifce);
- }
- }
- }
-
-
-
- ::wxLogMessage(wxT("%d modules found:"), gf_modules_get_count(m_user.modules));
- for (u32 i=0; i<gf_modules_get_count(m_user.modules); i++) {
- ::wxLogMessage(wxT("\t") + wxString(gf_modules_get_file_name(m_user.modules, i), wxConvUTF8) );
- }
-
- ::wxLogMessage(wxT("Starting GPAC Terminal"));
- /*now load terminal*/
- m_user.opaque = this;
- m_user.EventProc = GPAC_EventProc;
-
- CheckVideoOut();
-
- m_term = gf_term_new(&m_user);
- if (!m_term) {
- wxMessageDialog(NULL, wxT("Fatal Error"), wxT("Cannot load GPAC Terminal"), wxOK).ShowModal();
- return 0;
- } else {
- ::wxLogMessage(wxT("GPAC Terminal started") );
- }
- return 1;
-}
-
-
-
-wxOsmo4Frame::wxOsmo4Frame() :
- wxFrame((wxFrame *) NULL, -1, wxT("Osmo4 - GPAC"), wxPoint(-1, -1), wxSize(320, FRAME_H), //wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX | wxRESIZE_BORDER)
- wxDEFAULT_FRAME_STYLE
- )
-
-{
- int ws[3];
- m_Address = NULL;
- m_pView = NULL;
- m_term = NULL;
- SetIcon(wxIcon(osmo4));
- m_bExternalView = 0;
- m_last_prog = -1;
- m_num_chapters = 0;
- m_chapters_start = NULL;
- m_bViewRTI = 0;
- m_logs = NULL;
- m_bStartupFile = 0;
- gf_set_progress_callback(this, wxOsmo4_progress_cbk);
-
- myDropfiles *droptarget = new myDropfiles();
- droptarget->m_pMain = this;
- SetDropTarget(droptarget);
- m_pLogs = new GPACLogs(this);
- m_bGrabbed = 0;
-
- /*new menu bar*/
- wxMenuBar *b = new wxMenuBar();
- /*file*/
- wxMenu *menu = new wxMenu();
- menu->Append(GWX_FILE_OPEN, wxT("&Open File\tCtrl+O"), wxT("Open local presentation"));
- menu->Append(GWX_FILE_OPEN_URL, wxT("&Open URL\tCtrl+U"), wxT("Open remote presentation"));
- menu->AppendSeparator();
- menu->Append(FILE_PROPERTIES, wxT("&Properties\tCtrl+I"), wxT("Show presentation properties"));
- menu->Enable(FILE_PROPERTIES, 0);
- wxMenu *smenu = new wxMenu();
- smenu->Append(ID_MCACHE_ENABLE, wxT("&Enable"), wxT("Turns Recorder On/Off"));
- smenu->Append(ID_MCACHE_STOP, wxT("&Stop"), wxT("Stops recording and saves"));
- smenu->Append(ID_MCACHE_ABORT, wxT("&Abort"), wxT("Stops recording and discards"));
- menu->Append(0, wxT("&Streaming Cache"), smenu);
- menu->AppendSeparator();
- menu->Append(FILE_COPY, wxT("&Copy\tCtrl+C"), wxT("Copy selected text"));
- menu->Append(FILE_PASTE, wxT("&Paste\tCtrl+V"), wxT("Copy selected text"));
- menu->AppendSeparator();
- menu->Append(FILE_QUIT, wxT("E&xit"), wxT("Quit the application"));
- b->Append(menu, wxT("&File"));
- /*view*/
- menu = new wxMenu();
- vp_list = new wxMenu();
- menu->Append(0, wxT("&Viewpoint"), vp_list);
- smenu = new wxMenu();
- smenu->Append(ID_HEADLIGHT, wxT("Headlight"), wxT("Turns headlight on/off"), wxITEM_CHECK);
- smenu->AppendSeparator();
- smenu->Append(ID_NAVIGATE_NONE, wxT("None"), wxT("Disables Navigation"), wxITEM_CHECK);
- smenu->Append(ID_NAVIGATE_WALK, wxT("Walk"), wxT("Walk Navigation"), wxITEM_CHECK);
- smenu->Append(ID_NAVIGATE_FLY, wxT("Fly"), wxT("Fly Navigation"), wxITEM_CHECK);
- smenu->Append(ID_NAVIGATE_EXAMINE, wxT("Examine"), wxT("Examine Navigation"), wxITEM_CHECK);
- smenu->Append(ID_NAVIGATE_PAN, wxT("Pan"), wxT("Pan Navigation"), wxITEM_CHECK);
- smenu->Append(ID_NAVIGATE_SLIDE, wxT("Slide"), wxT("Slide Navigation"), wxITEM_CHECK);
- smenu->Append(ID_NAVIGATE_ORBIT, wxT("Orbit"), wxT("Orbit Navigation"), wxITEM_CHECK);
- smenu->Append(ID_NAVIGATE_GAME, wxT("Game"), wxT("Game Navigation"), wxITEM_CHECK);
- smenu->AppendSeparator();
- wxMenu *ssmenu = new wxMenu();
- ssmenu->Append(ID_COLLIDE_NONE, wxT("None"), wxT("No Collision detection"), wxITEM_CHECK);
- ssmenu->Append(ID_COLLIDE_REG, wxT("Regular"), wxT("Regular Collision detection"), wxITEM_CHECK);
- ssmenu->Append(ID_COLLIDE_DISP, wxT("Displacement"), wxT("Collision detecion with camera displacement"), wxITEM_CHECK);
- smenu->Append(0, wxT("&Collision"), ssmenu);
- smenu->Append(ID_GRAVITY, wxT("Gravity"), wxT("Turns gravity on/off"), wxITEM_CHECK);
- smenu->AppendSeparator();
- smenu->Append(ID_NAVIGATE_RESET, wxT("Reset"), wxT("Reset Navigation"));
-
- menu->Append(0, wxT("&Navigation"), smenu);
- menu->AppendSeparator();
- menu->Append(VIEW_FULLSCREEN, wxT("&Fullscreen"), wxT("Toggles Fullscreen"), wxITEM_CHECK);
- menu->Append(VIEW_ORIGINAL, wxT("&Original Size"), wxT("Restore original size"));
- smenu = new wxMenu();
- smenu->Append(VIEW_AR_KEEP, wxT("Keep Original\tCtrl+1"), wxT("Keep original aspect ratio"), wxITEM_CHECK);
- smenu->Append(VIEW_AR_FILL, wxT("Fill Screen\tCtrl+2"), wxT("Stretch presentation to fill screen"), wxITEM_CHECK);
- smenu->Append(VIEW_AR_43, wxT("Ratio 4/3\tCtrl+3"), wxT("Force aspect ratio to 4/3"), wxITEM_CHECK);
- smenu->Append(VIEW_AR_169, wxT("Ratio 16/9\tCtrl+4"), wxT("Force aspect ratio to 16/9"), wxITEM_CHECK);
- menu->Append(0, wxT("&Aspect Ratio"), smenu);
- smenu->Check(VIEW_AR_KEEP, 1);
- menu->AppendSeparator();
- menu->Append(VIEW_OPTIONS, wxT("&Options"), wxT("View Options"));
- menu->AppendSeparator();
- menu->Append(VIEW_RTI, wxT("&Resource Usage"), wxT("View Resource Usage"), wxITEM_CHECK);
- menu->Append(VIEW_LOGS, wxT("&Logs"), wxT("View GPAC logs"));
- b->Append(menu, wxT("&View"));
-
- /*play*/
- menu = new wxMenu();
- sel_menu = new wxMenu();
- sel_menu->Append(0, wxT("&Audio"), new wxMenu());
- sel_menu->Append(0, wxT("&Video"), new wxMenu());
- sel_menu->Append(0, wxT("&Subtitles"), new wxMenu());
- sel_menu->AppendSeparator();
- sel_menu->Append(ID_ADD_SUB, wxT("&Add Subtitle"), wxT("Adds subtitle"));
- menu->Append(ID_STREAM_MENU, wxT("&Streams Selection"), sel_menu);
- chap_menu = new wxMenu();
- menu->Append(ID_CHAPTER_MENU, wxT("&Chapters"), chap_menu);
-
- menu->AppendSeparator();
- menu->Append(VIEW_PLAYLIST, wxT("&Playlist\tCtrl+L"), wxT("Show navigation history as playlist"), wxITEM_CHECK);
- menu->Append(ID_CLEAR_NAV, wxT("&Clear History"), wxT("Clear navigation history"));
- menu->AppendSeparator();
- menu->Append(FILE_PLAY, wxT("&Play/Pause\tCtrl+P"), wxT("Play/Pause/Resume Presentation"));
- menu->Append(FILE_STEP, wxT("&Step-by-Step\tCtrl+S"), wxT("Play/Pause/Resume Presentation"));
- menu->Append(FILE_STOP, wxT("&Stop"), wxT("Stop Presentation"));
- menu->AppendSeparator();
- menu->Append(FILE_RELOAD_CONFIG, wxT("&Reload Config\tCtrl+R"), wxT("Reload Configuration File"));
- menu->Append(FILE_RELOAD, wxT("&Reload File\tCtrl+R"), wxT("Reload Presentation"));
- b->Append(menu, wxT("&Play"));
-
- menu = new wxMenu();
- menu->Append(APP_SHORTCUTS, wxT("&Shortcuts"), wxT("Show keyboard shortcuts"));
- menu->Append(APP_NAV_KEYS, wxT("&Navigation Keys"), wxT("Show navigation keys"));
- menu->AppendSeparator();
- menu->Append(APP_ABOUT, wxT("&About"), wxT("Display information and copyright"));
- b->Append(menu, wxT("&?"));
-
- SetMenuBar(b);
-
- m_pStatusbar = CreateStatusBar(1, 0, -1, wxT("statusBar"));
- ws[0] = 60;
- ws[1] = 70;
- ws[2] = -1;
- m_pStatusbar->SetFieldsCount(3, ws);
-
- SetStatusBarPane(2);
- wxColour foreCol = m_pStatusbar->GetBackgroundColour();
- SetBackgroundColour(foreCol);
-
-
- m_pTimer = new wxTimer();
- m_pTimer->SetOwner(this, ID_CTRL_TIMER);
- m_bGrabbed = 0;
-
- /*create toolbar*/
- m_pToolBar = CreateToolBar(wxTB_FLAT|wxTB_HORIZONTAL);
- m_pOpenFile = new wxBitmap(tool_open_file);
- m_pPrev = new wxBitmap(tool_prev);
- m_pNext = new wxBitmap(tool_next);
- m_pPlay = new wxBitmap(tool_play);
- m_pPause = new wxBitmap(tool_pause);
- m_pStep = new wxBitmap(tool_step);
- m_pStop = new wxBitmap(tool_stop);
- m_pInfo = new wxBitmap(tool_info);
- m_pConfig = new wxBitmap(tool_config);
- m_pSW2D = new wxBitmap(tool_sw_2d);
- m_pSW3D = new wxBitmap(tool_sw_3d);
-
- m_pToolBar->AddTool(GWX_FILE_OPEN, wxT(""), *m_pOpenFile, wxT("Open File"));
- m_pToolBar->AddSeparator();
- m_pPrevBut = new wxMenuButton(m_pToolBar, FILE_PREV, *m_pPrev);
- m_pPrevBut->SetToolTip(wxT("Previous Location"));
- m_pToolBar->AddControl(m_pPrevBut);
- m_pNextBut = new wxMenuButton(m_pToolBar, FILE_NEXT, *m_pNext);
- m_pNextBut->SetToolTip(wxT("Next Location"));
- m_pToolBar->AddControl(m_pNextBut);
-
- m_pToolBar->AddSeparator();
- m_pToolBar->AddTool(FILE_PLAY, wxT(""), *m_pPlay, wxT("Play/Pause File"));
- m_pToolBar->AddTool(FILE_STEP, wxT(""), *m_pStep, wxT("Step-by-Step Mode"));
- m_pToolBar->AddTool(FILE_STOP, wxT(""), *m_pStop, wxT("Stop File"));
- m_pToolBar->AddSeparator();
- m_pToolBar->AddTool(FILE_PROPERTIES, wxT(""), *m_pInfo, wxT("Show File Information"));
- m_pToolBar->AddSeparator();
- m_pToolBar->AddTool(VIEW_OPTIONS, wxT(""), *m_pConfig, wxT("GPAC Configuration"));
- m_pToolBar->AddTool(SWITCH_RENDER, wxT(""), *m_pSW3D, wxT("Switch 2D/3D Renderers"));
-
- m_pToolBar->Realize();
-
- m_Address = new wxMyComboBox(this, ID_ADDRESS, wxT(""), wxPoint(50, 0), wxSize(80, 20));
- wxStaticText *add_text = new wxStaticText(this, -1, wxT("URL"), wxPoint(0, 0), wxSize(40, 20));
- add_text->SetBackgroundColour(foreCol);
-
- m_pAddBar = new wxBoxSizer(wxHORIZONTAL);
- m_pAddBar->Add(add_text, 0, wxALIGN_TOP);
- m_pAddBar->Add(m_Address, 2, wxALIGN_CENTER|wxEXPAND|wxADJUST_MINSIZE);
- m_pAddBar->SetMinSize(80, 32);
- m_pAddBar->Layout();
-
- m_pProg = new wxSlider(this, ID_SLIDER, 0, 0, 1000, wxPoint(0, 22), wxSize(80, 22), wxSL_HORIZONTAL|wxSUNKEN_BORDER);
- m_pProg->Enable(0);
- m_pProg->Show();
- m_pProg->SetBackgroundColour(foreCol);
-
- m_pView = new wxWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
- m_pView->SetBackgroundColour(wxColour(wxT("BLACK")));
-#ifdef __WXGTK__
- m_pVisual = new wxWindow(m_pView, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
- m_pVisual->SetBackgroundColour(wxColour(wxT("BLACK")));
-#endif
-
- m_pPlayList = new wxPlaylist(this);
- m_pPlayList->SetIcon(wxIcon(osmo4));
- m_pPlayList->Hide();
- Raise();
- Show();
-
- m_connected = 0;
- if (!LoadTerminal()) {
- Close(TRUE);
- return;
- }
-
-
-
- if (m_bExternalView) SetWindowStyle(wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX | wxRESIZE_BORDER));
- DoLayout(320, 240);
- UpdateRenderSwitch();
-
- const char *sOpt = gf_cfg_get_key(m_user.config, "General", "ConsoleOff");
- m_console_off = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
- sOpt = gf_cfg_get_key(m_user.config, "General", "Loop");
- m_loop = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
- sOpt = gf_cfg_get_key(m_user.config, "General", "LookForSubtitles");
- m_lookforsubs = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
- gf_term_set_option(m_term, GF_OPT_AUDIO_VOLUME, 100);
-
- ReloadURLs();
- Raise();
- m_pStatusbar->SetStatusText(wxT("Ready"), 2);
- m_LastStatusTime = 0;
-
- m_pPrevBut->Refresh();
- m_pNextBut->Refresh();
-
- wxOsmo4App &app = wxGetApp();
- if (app.argc>1) {
- m_pPlayList->QueueURL(wxString(app.argv[1]));
- m_pPlayList->RefreshList();
- m_pPlayList->PlayNext();
- } else {
- char sPL[GF_MAX_PATH];
- strcpy((char *) sPL, szAppPath);
-#ifdef WIN32
- strcat(sPL, "gpac_pl.m3u");
-#else
- strcat(sPL, ".gpac_pl.m3u");
-#endif
- m_pPlayList->OpenPlaylist(wxString(sPL, wxConvUTF8) );
- const char *sOpt = gf_cfg_get_key(m_user.config, "General", "PLEntry");
- if (sOpt) {
- m_pPlayList->m_cur_entry = atoi(sOpt);
- if (m_pPlayList->m_cur_entry>=(s32)gf_list_count(m_pPlayList->m_entries))
- m_pPlayList->m_cur_entry = -1;
- }
-
- sOpt = gf_cfg_get_key(m_user.config, "General", "StartupFile");
- if (sOpt) {
- gf_term_connect(m_term, sOpt);
- m_bStartupFile = 1;
- }
- }
-
- sOpt = gf_cfg_get_key(m_user.config, "core", "audio-output");
-
- if (!strcmp(sOpt, "No Audio Output Available")) {
- ::wxLogMessage(wxT("WARNING: no audio output availble - make sure no other program is locking the sound card"));
- SetStatus(wxT("No audio ouput available"));
-
- } else {
- SetStatus(wxT("Ready"));
- }
-}
-
-wxOsmo4Frame::~wxOsmo4Frame()
-{
- vp_list = NULL;
- sel_menu = NULL;
-
- if (m_user.modules) gf_modules_del(m_user.modules);
- gf_sys_close();
- if (m_user.config) gf_cfg_del(m_user.config);
-
- if (m_chapters_start) gf_free(m_chapters_start);
- if (m_pView) delete m_pView;
-
- //m_pToolBar->RemoveTool(FILE_PREV);
- //m_pToolBar->RemoveTool(FILE_NEXT);
-
- delete m_pPrevBut;
- delete m_pNextBut;
- delete m_pPlayList;
- delete m_pTimer;
- delete m_pOpenFile;
- delete m_pPrev;
- delete m_pNext;
- delete m_pPlay;
- delete m_pPause;
- delete m_pStep;
- delete m_pStop;
- delete m_pInfo;
- delete m_pConfig;
- delete m_pSW2D;
- delete m_pSW3D;
-}
-
-
-BEGIN_EVENT_TABLE(wxOsmo4Frame, wxFrame)
- EVT_CLOSE(wxOsmo4Frame::OnCloseApp)
- EVT_MENU(GWX_FILE_OPEN, wxOsmo4Frame::OnFileOpen)
- EVT_MENU(GWX_FILE_OPEN_URL, wxOsmo4Frame::OnFileOpenURL)
- EVT_MENU(FILE_RELOAD_CONFIG, wxOsmo4Frame::OnFileReloadConfig)
- EVT_MENU(FILE_RELOAD, wxOsmo4Frame::OnFileReload)
- EVT_MENU(FILE_PROPERTIES, wxOsmo4Frame::OnFileProperties)
- EVT_MENU(FILE_QUIT, wxOsmo4Frame::OnFileQuit)
- EVT_MENU(VIEW_FULLSCREEN, wxOsmo4Frame::OnFullScreen)
- EVT_MENU(VIEW_OPTIONS, wxOsmo4Frame::OnOptions)
- EVT_MENU(VIEW_AR_KEEP, wxOsmo4Frame::OnViewARKeep)
- EVT_MENU(VIEW_AR_FILL, wxOsmo4Frame::OnViewARFill)
- EVT_MENU(VIEW_AR_169, wxOsmo4Frame::OnViewAR169)
- EVT_MENU(VIEW_AR_43, wxOsmo4Frame::OnViewAR43)
- EVT_MENU(VIEW_ORIGINAL, wxOsmo4Frame::OnViewOriginal)
- EVT_MENU(VIEW_PLAYLIST, wxOsmo4Frame::OnPlaylist)
- EVT_UPDATE_UI(VIEW_PLAYLIST, wxOsmo4Frame::OnUpdatePlayList)
- EVT_MENU(FILE_COPY, wxOsmo4Frame::OnFileCopy)
- EVT_UPDATE_UI(FILE_COPY, wxOsmo4Frame::OnUpdateFileCopy)
- EVT_MENU(FILE_PASTE, wxOsmo4Frame::OnFilePaste)
- EVT_UPDATE_UI(FILE_PASTE, wxOsmo4Frame::OnUpdateFilePaste)
-
- EVT_MENU(ID_CLEAR_NAV, wxOsmo4Frame::OnClearNav)
- EVT_UPDATE_UI(ID_STREAM_MENU, wxOsmo4Frame::OnUpdateStreamMenu)
- EVT_UPDATE_UI(ID_CHAPTER_MENU, wxOsmo4Frame::OnUpdateChapterMenu)
- EVT_MENU(ID_ADD_SUB, wxOsmo4Frame::OnAddSub)
-
- EVT_MENU(ID_MCACHE_ENABLE, wxOsmo4Frame::OnCacheEnable)
- EVT_UPDATE_UI(ID_MCACHE_ENABLE, wxOsmo4Frame::OnUpdateCacheEnable)
- EVT_MENU(ID_MCACHE_STOP, wxOsmo4Frame::OnCacheStop)
- EVT_MENU(ID_MCACHE_ABORT, wxOsmo4Frame::OnCacheAbort)
- EVT_UPDATE_UI(ID_MCACHE_STOP, wxOsmo4Frame::OnUpdateCacheAbort)
- EVT_UPDATE_UI(ID_MCACHE_ABORT, wxOsmo4Frame::OnUpdateCacheAbort)
-
-
- EVT_MENU(APP_SHORTCUTS, wxOsmo4Frame::OnShortcuts)
- EVT_MENU(APP_NAV_KEYS, wxOsmo4Frame::OnNavInfo)
- EVT_MENU(APP_ABOUT, wxOsmo4Frame::OnAbout)
- EVT_GPACEVENT(wxOsmo4Frame::OnGPACEvent)
- EVT_TIMER(ID_CTRL_TIMER, wxOsmo4Frame::OnTimer)
- EVT_COMMAND_SCROLL(ID_SLIDER, wxOsmo4Frame::OnSlide)
- EVT_MENU(VIEW_LOGS, wxOsmo4Frame::OnLogs)
- EVT_MENU(VIEW_RTI, wxOsmo4Frame::OnRTI)
-
- EVT_MENUBUTTON_OPEN(FILE_PREV, wxOsmo4Frame::OnFilePrevOpen)
- EVT_MENUBUTTON_OPEN(FILE_NEXT, wxOsmo4Frame::OnFileNextOpen)
- EVT_MENU(FILE_PREV, wxOsmo4Frame::OnNavPrev)
- EVT_UPDATE_UI(FILE_PREV, wxOsmo4Frame::OnUpdateNavPrev)
- EVT_MENU_RANGE(ID_NAV_PREV_0, ID_NAV_PREV_9, wxOsmo4Frame::OnNavPrevMenu)
- EVT_MENU(FILE_NEXT, wxOsmo4Frame::OnNavNext)
- EVT_UPDATE_UI(FILE_NEXT, wxOsmo4Frame::OnUpdateNavNext)
- EVT_MENU_RANGE(ID_NAV_NEXT_0, ID_NAV_NEXT_9, wxOsmo4Frame::OnNavNextMenu)
-
- EVT_TOOL(FILE_PLAY, wxOsmo4Frame::OnFilePlay)
- EVT_TOOL(FILE_STEP, wxOsmo4Frame::OnFileStep)
- EVT_TOOL(FILE_STOP, wxOsmo4Frame::OnFileStop)
- EVT_TOOL(SWITCH_RENDER, wxOsmo4Frame::OnRenderSwitch)
-
- EVT_COMBOBOX(ID_ADDRESS, wxOsmo4Frame::OnURLSelect)
-
- EVT_MENU_RANGE(ID_SELSTREAM_0, ID_SELSTREAM_9, wxOsmo4Frame::OnStreamSel)
- EVT_UPDATE_UI_RANGE(ID_SELSTREAM_0, ID_SELSTREAM_9, wxOsmo4Frame::OnUpdateStreamSel)
-
- EVT_MENU_RANGE(ID_SETCHAP_FIRST, ID_SETCHAP_LAST, wxOsmo4Frame::OnChapterSel)
- EVT_UPDATE_UI_RANGE(ID_SETCHAP_FIRST, ID_SETCHAP_LAST, wxOsmo4Frame::OnUpdateChapterSel)
-
- EVT_MENU_RANGE(ID_VIEWPOINT_FIRST, ID_VIEWPOINT_LAST, wxOsmo4Frame::OnViewport)
- EVT_UPDATE_UI_RANGE(ID_VIEWPOINT_FIRST, ID_VIEWPOINT_LAST, wxOsmo4Frame::OnUpdateViewport)
-
- EVT_MENU_RANGE(ID_NAVIGATE_NONE, ID_NAVIGATE_GAME, wxOsmo4Frame::OnNavigate)
- EVT_UPDATE_UI_RANGE(ID_NAVIGATE_NONE, ID_NAVIGATE_GAME, wxOsmo4Frame::OnUpdateNavigation)
- EVT_MENU(ID_NAVIGATE_RESET, wxOsmo4Frame::OnNavigateReset)
-
- EVT_MENU_RANGE(ID_COLLIDE_NONE, ID_COLLIDE_DISP, wxOsmo4Frame::OnCollide)
- EVT_UPDATE_UI_RANGE(ID_COLLIDE_NONE, ID_COLLIDE_DISP, wxOsmo4Frame::OnUpdateCollide)
-
- EVT_MENU(ID_HEADLIGHT, wxOsmo4Frame::OnHeadlight)
- EVT_UPDATE_UI(ID_HEADLIGHT, wxOsmo4Frame::OnUpdateHeadlight)
- EVT_MENU(ID_GRAVITY, wxOsmo4Frame::OnGravity)
- EVT_UPDATE_UI(ID_GRAVITY, wxOsmo4Frame::OnUpdateGravity)
-
- EVT_UPDATE_UI(FILE_PROPERTIES, wxOsmo4Frame::OnUpdateNeedsConnect)
- EVT_UPDATE_UI(FILE_RELOAD, wxOsmo4Frame::OnUpdateNeedsConnect)
- EVT_UPDATE_UI(FILE_PLAY, wxOsmo4Frame::OnUpdatePlay)
- EVT_UPDATE_UI(FILE_STOP, wxOsmo4Frame::OnUpdateNeedsConnect)
- EVT_UPDATE_UI(FILE_STEP, wxOsmo4Frame::OnUpdateNeedsConnect)
- EVT_UPDATE_UI(VIEW_ORIGINAL, wxOsmo4Frame::OnUpdateNeedsConnect)
- EVT_UPDATE_UI(VIEW_FULLSCREEN, wxOsmo4Frame::OnUpdateFullScreen)
- EVT_UPDATE_UI(VIEW_AR_KEEP, wxOsmo4Frame::OnUpdateAR)
- EVT_UPDATE_UI(VIEW_AR_FILL, wxOsmo4Frame::OnUpdateAR)
- EVT_UPDATE_UI(VIEW_AR_169, wxOsmo4Frame::OnUpdateAR)
- EVT_UPDATE_UI(VIEW_AR_43, wxOsmo4Frame::OnUpdateAR)
-
- EVT_SIZE(wxOsmo4Frame::OnSize)
-END_EVENT_TABLE()
-
-void wxOsmo4Frame::DoLayout(u32 v_width, u32 v_height)
-{
- wxPoint pos;
- if (!m_Address || !m_pProg) return;
-
- int t_h = m_pToolBar->GetSize().y;
- int a_h = m_pAddBar->GetSize().y;
- int p_h = m_pProg->GetSize().y;
-
- if (m_bExternalView) {
- if (v_width && v_height) {
- m_orig_width = v_width;
- m_orig_height = v_height;
- }
- SetClientSize(320, a_h+p_h+t_h);
- m_pAddBar->SetDimension(0,0, 320, a_h);
- m_pProg->SetSize(0, t_h+a_h, 320, p_h, 0);
- return;
- }
-
- if (v_width && v_height) {
- m_orig_width = v_width;
- m_orig_height = v_height;
- v_height += a_h + p_h + t_h;
- SetClientSize(v_width, v_height);
- m_pView->SetSize(0, a_h+t_h, v_width, v_height, 0);
- m_pAddBar->SetDimension(0, t_h, v_width, a_h);
- m_pProg->SetSize(0, v_height - p_h, v_width, p_h, 0);
- }
- wxSize s = GetClientSize();
- s.y -= a_h + p_h + t_h;
- if (m_pView) {
- m_pView->SetSize(0, a_h+t_h, s.x, s.y, 0);
- m_pAddBar->SetDimension(0, 0, s.x, a_h);
- m_pAddBar->SetDimension(0, 0, s.x, a_h);
- m_pAddBar->Layout();
- m_pProg->SetSize(0, s.y+t_h+a_h, s.x, p_h, 0);
- if (m_term) gf_term_set_size(m_term, s.x, s.y);
- }
-}
-
-void wxOsmo4Frame::OnSize(wxSizeEvent &event)
-{
- DoLayout();
-}
-
-void wxOsmo4Frame::OnCloseApp(wxCloseEvent &WXUNUSED(event))
-{
- if (m_term) gf_term_del(m_term);
- m_term = NULL;
- Destroy();
-}
-
-
-wxString wxOsmo4Frame::GetFileFilter()
-{
- u32 keyCount, i;
- wxString sFiles, sSupportedFiles, sExts;
-
- /*force MP4 and 3GP files at beginning to make sure they are selected (Win32 bug with too large filters)*/
- sSupportedFiles = wxT("All Known Files|*.m3u;*.pls;*.mp4;*.3gp;*.3g2");
- sExts = wxT("");
- sFiles = wxT("");
- keyCount = gf_cfg_get_key_count(m_user.config, "MimeTypes");
- for (i=0; i<keyCount; i++) {
- Bool first = 1;
- const char *sMime;
- char *sKey;
- const char *opt;
- char szKeyList[1000], sDesc[1000];
- sMime = gf_cfg_get_key_name(m_user.config, "MimeTypes", i);
- if (!sMime) continue;
- opt = gf_cfg_get_key(m_user.config, "MimeTypes", sMime);
- /*remove module name*/
- strcpy(szKeyList, opt+1);
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- sKey[0] = 0;
- /*get description*/
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- strcpy(sDesc, sKey+1);
- sKey[0] = 0;
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- sKey[0] = 0;
-
- /*if same description for # mime types skip (means an old mime syntax)*/
- if (sFiles.Find(wxString(sDesc, wxConvUTF8) )>=0) continue;
- /*if same extensions for # mime types skip (don't polluate the file list)*/
- if (sExts.Find(wxString(szKeyList, wxConvUTF8) )>=0) continue;
-
- sExts += wxString(szKeyList, wxConvUTF8);
- sExts += wxT(" ");
- sFiles += wxString(sDesc, wxConvUTF8);
- sFiles += wxT("|");
-
- wxString sOpt = wxString(szKeyList, wxConvUTF8);
- while (1) {
- wxString ext = sOpt.BeforeFirst(' ');
- if (ext.Find('.')<0) {
- if (first) first = 0;
- else sFiles += wxT(";");
- sFiles += wxT("*.");
- sFiles += ext;
- wxString sext = ext;
- sext += wxT(";");
- if (sSupportedFiles.Find(sext)<0) {
- sSupportedFiles += wxT(";*.");
- sSupportedFiles += ext;
- }
- }
- if (sOpt==ext) break;
- wxString rem = ext + wxT(" ");
- sOpt.Replace(rem, wxT(""), TRUE);
- }
- sFiles += wxT("|");
- }
- sSupportedFiles += wxT("|");
- sSupportedFiles += sFiles;
- sSupportedFiles += wxT("M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|All Files|*.*||");
- return sSupportedFiles;
-}
-
-void wxOsmo4Frame::OnFileOpen(wxCommandEvent & WXUNUSED(event))
-{
- wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), GetFileFilter(), wxOPEN | wxMULTIPLE | wxCHANGE_DIR /*| wxHIDE_READONLY*/);
-
- if (dlg.ShowModal() != wxID_OK) return;
-
- wxArrayString stra;
- dlg.GetPaths(stra);
- if (stra.GetCount() == 1) {
- m_pPlayList->Truncate();
- } else {
- m_pPlayList->Clear();
- }
- for (u32 i=0; i<stra.GetCount(); i++)
- m_pPlayList->QueueURL(stra[i]);
-
- m_pPlayList->RefreshList();
- m_pPlayList->PlayNext();
-}
-
-void wxOsmo4Frame::OnFileOpenURL(wxCommandEvent & WXUNUSED(event))
-{
- OpenURLDlg dlg(this, m_user.config);
- if (dlg.ShowModal()==wxID_OK) {
- m_pPlayList->Truncate();
- m_pPlayList->QueueURL(dlg.m_urlVal);
- m_pPlayList->RefreshList();
- m_pPlayList->PlayNext();
- }
-}
-
-void wxOsmo4Frame::OnFileProperties(wxCommandEvent & WXUNUSED(event))
-{
- wxFileProps dlg(this);
- dlg.SetIcon(wxIcon(osmo4));
- dlg.ShowModal();
-}
-
-void wxOsmo4Frame::OnFileReload(wxCommandEvent & WXUNUSED(event))
-{
- gf_term_disconnect(m_term);
- m_connected = 0;
- DoConnect();
-}
-
-void wxOsmo4Frame::OnFileReloadConfig(wxCommandEvent & WXUNUSED(event))
-{
- gf_term_set_option(m_term, GF_OPT_RELOAD_CONFIG, 1);
-}
-
-void wxOsmo4Frame::OnFileQuit(wxCommandEvent & WXUNUSED(event))
-{
- Close(FALSE);
-}
-
-void wxOsmo4Frame::OnViewOriginal(wxCommandEvent & WXUNUSED(event))
-{
- if (!m_bExternalView) {
- DoLayout(m_orig_width, m_orig_height);
- } else {
- gf_term_set_option(m_term, GF_OPT_ORIGINAL_VIEW, 1);
- }
-}
-
-void wxOsmo4Frame::OnOptions(wxCommandEvent & WXUNUSED(event))
-{
- wxGPACControl dlg(this);
- dlg.SetIcon(wxIcon(osmo4));
- dlg.ShowModal();
-}
-
-void wxOsmo4Frame::DoConnect()
-{
- //if (m_connected) { gf_term_disconnect(m_term); m_connected = 0; }
-
- wxString url = m_pPlayList->GetURL();
- m_Address->SetValue(url);
-#ifdef __WXGTK__
- m_pVisual->SetFocus();
-#else
- m_pView->SetFocus();
-#endif
- wxString txt = wxT("Osmo4 - ");
- txt += m_pPlayList->GetDisplayName();
- SetTitle(txt);
- m_bStartupFile = 0;
- gf_term_connect(m_term, url.mb_str(wxConvUTF8));
-}
-
-void wxOsmo4Frame::OnLogs(wxCommandEvent & WXUNUSED(event))
-{
- m_pLogs->Show();
-}
-
-void wxOsmo4Frame::OnUpdateNeedsConnect(wxUpdateUIEvent &event)
-{
- event.Enable(m_connected ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnUpdatePlay(wxUpdateUIEvent &event)
-{
- event.Enable( (m_connected || m_pPlayList->HasValidEntries()) ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnUpdateFullScreen(wxUpdateUIEvent &event)
-{
- if (m_connected) {
- event.Enable(1);
- event.Check(gf_term_get_option(m_term, GF_OPT_FULLSCREEN) ? 1 : 0);
- } else {
- event.Enable(0);
- }
-}
-
-void wxOsmo4Frame::OnFullScreen(wxCommandEvent & WXUNUSED(event))
-{
- Bool isFS = gf_term_get_option(m_term, GF_OPT_FULLSCREEN) ? 1 : 0;
- gf_term_set_option(m_term, GF_OPT_FULLSCREEN, isFS ? 0 : 1);
-}
-
-void wxOsmo4Frame::OnViewARKeep(wxCommandEvent & WXUNUSED(event))
-{
- gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
-}
-void wxOsmo4Frame::OnViewARFill(wxCommandEvent & WXUNUSED(event))
-{
- gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN);
-}
-void wxOsmo4Frame::OnViewAR169(wxCommandEvent & WXUNUSED(event))
-{
- gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);
-}
-void wxOsmo4Frame::OnViewAR43(wxCommandEvent & WXUNUSED(event))
-{
- gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3);
-}
-
-void wxOsmo4Frame::OnUpdateAR(wxUpdateUIEvent &event)
-{
- if (!m_connected) {
- event.Enable(0);
- return;
- }
- event.Enable(1);
- u32 val = gf_term_get_option(m_term, GF_OPT_ASPECT_RATIO);
- if ((event.GetId() == VIEW_AR_FILL) && (val==GF_ASPECT_RATIO_FILL_SCREEN))
- event.Check(1);
- else if ((event.GetId() == VIEW_AR_KEEP) && (val==GF_ASPECT_RATIO_KEEP))
- event.Check(1);
- else if ((event.GetId() == VIEW_AR_169) && (val==GF_ASPECT_RATIO_16_9))
- event.Check(1);
- else if ((event.GetId() == VIEW_AR_43) && (val==GF_ASPECT_RATIO_4_3))
- event.Check(1);
- else event.Check(0);
-}
-
-void wxOsmo4Frame::OnShortcuts(wxCommandEvent & WXUNUSED(event))
-{
- wxMessageDialog dlg(this,
- wxT("Shortcuts with focus on main frame:\n")
- wxT("Open File: Ctrl + O\n")
- wxT("Show File Information: Ctrl + I\n")
- wxT("Reload File: Ctrl + R\n")
- wxT("Pause/Resume File: Ctrl + P\n")
- wxT("Step by Step: Ctrl + S\n")
- wxT("Fullscreen On/Off: Alt + Return\n")
- wxT("View Playlist: Ctrl + L\n")
- wxT("Aspect Ratio Normal: Ctrl + 1\n")
- wxT("Aspect Ratio Fill: Ctrl + 2\n")
- wxT("Aspect Ratio 4/3: Ctrl + 3\n")
- wxT("Aspect Ratio 16/9: Ctrl + 4\n")
- wxT("\n")
- wxT("Shortcuts with focus on video frame:\n")
- wxT("Seek +5% into presentation: Alt + right arrow\n")
- wxT("Seek -5% into presentation: Alt + left arrow\n")
- wxT("Seek +1min into presentation: Alt + up arrow\n")
- wxT("Seek -1min into presentation: Alt + down arrow\n")
- wxT("Next Playlist Entry: Ctrl + right arrow\n")
- wxT("Prev Playlist Entry: Ctrl + left arrow\n")
-
- , wxT("Shortcuts Available on Osmo4")
- , wxOK);
-
- dlg.ShowModal();
-}
-
-void wxOsmo4Frame::OnNavInfo(wxCommandEvent & WXUNUSED(event))
-{
- wxMessageDialog dlg(this,
- wxT("* Walk & Fly modes:\n")
- wxT("\tH move: H pan - V move: Z-translate - V move+CTRL or Wheel: V pan - Right Click (Walk only): Jump\n")
- wxT("\tleft/right: H pan - left/right+CTRL: H translate - up/down: Z-translate - up/down+CTRL: V pan\n")
- wxT("* Pan mode:\n")
- wxT("\tH move: H pan - V move: V pan - V move+CTRL or Wheel: Z-translate\n")
- wxT("\tleft/right: H pan - left/right+CTRL: H translate - up/down: V pan - up/down+CTRL: Z-translate\n")
- wxT("* Slide mode:\n")
- wxT("\tH move: H translate - V move: V translate - V move+CTRL or Wheel: Z-translate\n")
- wxT("\tleft/right: H translate - left/right+CTRL: H pan - up/down: V translate - up/down+CTRL: Z-translate\n")
- wxT("* Examine & Orbit mode:\n")
- wxT("\tH move: Y-Axis rotate - H move+CTRL: No move - V move: X-Axis rotate - V move+CTRL or Wheel: Z-translate\n")
- wxT("\tleft/right: Y-Axis rotate - left/right+CTRL: H translate - up/down: X-Axis rotate - up/down+CTRL: Y-translate\n")
- wxT("* VR mode:\n")
- wxT("\tH move: H pan - V move: V pan - V move+CTRL or Wheel: Camera Zoom\n")
- wxT("\tleft/right: H pan - up/down: V pan - up/down+CTRL: Camera Zoom\n")
- wxT("* Game mode (press END to escape):\n")
- wxT("\tH move: H pan - V move: V pan\n")
- wxT("\tleft/right: H translate - up/down: Z-translate\n")
- wxT("\n")
- wxT("* All 3D modes: CTRL+PGUP/PGDOWN will zoom in/out camera (field of view) \n")
- wxT("\n")
- wxT("*Slide Mode in 2D:\n")
- wxT("\tH move: H translate - V move: V translate - V move+CTRL: zoom\n")
- wxT("\tleft/right: H translate - up/down: V translate - up/down+CTRL: zoom\n")
- wxT("*Examine Mode in 2D (3D renderer only):\n")
- wxT("\tH move: Y-Axis rotate - V move: X-Axis rotate\n")
- wxT("\tleft/right: Y-Axis rotate - up/down: X-Axis rotate\n")
- wxT("\n")
- wxT("HOME: reset navigation to last viewpoint (2D or 3D navigation)\n")
- wxT("SHIFT key in all modes: fast movement\n")
-
- , wxT("3D navigation keys (\'H\'orizontal and \'V\'ertical) used in GPAC")
- , wxOK );
- dlg.ShowModal();
-}
-
-
-/*open file dlg*/
-class AboutDlg : public wxDialog {
-public:
- AboutDlg(wxWindow *parent);
-
-private:
- wxStaticText *m_info;
- wxButton *m_close;
- void OnClose(wxCommandEvent& event);
- DECLARE_EVENT_TABLE()
-};
-
-BEGIN_EVENT_TABLE(AboutDlg, wxDialog)
- EVT_BUTTON(ID_ABOUT_CLOSE, AboutDlg::OnClose)
-END_EVENT_TABLE()
-
-AboutDlg::AboutDlg(wxWindow *parent)
- : wxDialog(parent, -1, wxString(wxT("GPAC/Osmo4 V ")wxT(GPAC_FULL_VERSION)))
-{
- SetSize(220, 320);
- Centre();
- wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
-
- m_info = new wxStaticText(this, -1, wxT("http://gpac.io"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
- sizer->Add(m_info, 1, wxEXPAND|wxADJUST_MINSIZE, 0);
- m_close = new wxButton(this, ID_ABOUT_CLOSE, wxT("Close"), wxDefaultPosition, wxSize(120, 20));
- sizer->Add(m_close, 0, wxEXPAND, 0);
-
- SetIcon(wxIcon(osmo4));
- m_info->SetLabel(
- wxT("Osmo4 Player\n")
- wxT("GPAC Multimedia Framework\n")
- wxT("\n")
- wxT("This program is gf_free software and may\n")
- wxT("be distributed according to the terms\n")
- wxT("of the GNU Lesser General Public License\n")
- wxT("\n")
- wxT("Authors: Jean Le Feuvre\n")
- wxT("(c) Telecom ParisTech 2005-2012\n")
- wxT("All Rights Reserved\n")
- wxT("http://gpac.io\n")
- wxT("\n")
- wxT(" ** With Many Thanks To ** \n\n")
- wxT("Mozilla SpiderMonkey (JavaScript)\n")
- wxT("The FreeType Project\n")
- wxT("The PNG Group, The I.J.G.\n")
- wxT("FFMPEG, FAAD, XVID, MAD\n")
- );
-
- SetSizer(sizer);
- sizer->Fit(this);
-}
-void AboutDlg::OnClose(wxCommandEvent& WXUNUSED(event))
-{
- Close(FALSE);
-}
-
-void wxOsmo4Frame::OnAbout(wxCommandEvent & WXUNUSED(event))
-{
- AboutDlg dlg(this);
- dlg.ShowModal();
-}
-
-
-void wxOsmo4Frame::OnGPACEvent(wxGPACEvent &event)
-{
- wxString cmd;
- wxCommandEvent evt;
- if (!m_term) return;
-
- switch (event.gpac_evt.type) {
- case GF_EVENT_NAVIGATE:
- if (gf_term_is_supported_url(m_term, event.to_url.mb_str(wxConvUTF8), 1, 0)) {
- char *str = gf_url_concatenate(m_pPlayList->GetURL().mb_str(wxConvUTF8), event.to_url.mb_str(wxConvUTF8));
- if (str) {
- m_pPlayList->Truncate();
- m_pPlayList->QueueURL(wxString(str, wxConvUTF8));
- m_pPlayList->RefreshList();
- gf_free(str);
- m_pPlayList->PlayNext();
- }
- return;
- }
- cmd = get_pref_browser(m_user.config);
- if (cmd.IsEmpty()) {
- cmd += wxT(" ");
- cmd += event.to_url;
- wxExecute(cmd);
- } else {
-#ifdef wxLaunchDefaultBrowser
- wxLaunchDefaultBrowser(event.to_url);
-#endif
- }
- break;
- case GF_EVENT_QUIT:
- Close(TRUE);
- break;
- case GF_EVENT_SET_CAPTION:
- SetTitle(event.to_url);
- break;
- case GF_EVENT_CONNECT:
- BuildStreamList(0);
- ConnectAcknowledged(event.gpac_evt.connect.is_connected);
- break;
- case GF_EVENT_KEYDOWN:
- if (!(event.gpac_evt.key.flags & GF_KEY_MOD_CTRL)) return;
- switch (event.gpac_evt.key.key_code) {
- case GF_KEY_R:
- gf_term_set_option(m_term, GF_OPT_REFRESH, 1);
- break;
- case GF_KEY_P:
- OnFilePlay(evt);
- break;
- case GF_KEY_S:
- OnFileStep(evt);
- break;
- }
- break;
- case GF_EVENT_SCENE_SIZE:
- m_orig_width = event.gpac_evt.size.width;
- m_orig_height = event.gpac_evt.size.height;
- case GF_EVENT_SIZE:
- if (! gf_term_get_option(m_term, GF_OPT_FULLSCREEN)) {
- DoLayout(event.gpac_evt.size.width, event.gpac_evt.size.height);
- }
- break;
- case GF_EVENT_VIEWPOINTS:
- BuildViewList();
- break;
- case GF_EVENT_STREAMLIST:
- BuildStreamList(0);
- break;
- }
-}
-
-
-static wxString format_time(u32 duration, u32 timescale)
-{
- u32 h, m, s;
- Float time = duration;
- time /= timescale;
- time *= 1000;
- h = (u32) (time / 1000 / 3600);
- m = (u32) (time / 1000 / 60 - h*60);
- s = (u32) (time / 1000 - h*3600 - m*60);
- return wxString::Format(wxT("%02d:%02d:%02d"), h, m, s);
-}
-
-void wxOsmo4Frame::SetStatus(wxString str)
-{
- //m_pStatusbar->SetStatusText(str, 2);
- m_LastStatusTime = gf_sys_clock();
-}
-
-#define RTI_REFRESH_MS 500
-void wxOsmo4Frame::OnRTI(wxCommandEvent & event)
-{
- m_bViewRTI = event.IsChecked();
- if (m_bViewRTI) {
- if (!m_pTimer->IsRunning()) m_pTimer->Start(RTI_REFRESH_MS, 0);
- } else if (!m_connected && m_pTimer->IsRunning()) {
- m_LastStatusTime = 0;
- m_pStatusbar->SetStatusText(wxT("Ready"), 2);
- m_pTimer->Stop();
- }
-}
-
-void wxOsmo4Frame::OnTimer(wxTimerEvent& WXUNUSED(event))
-{
- wxString str;
- u32 now;
- if (m_LastStatusTime) {
- now = gf_sys_clock();
- if (now > 1000+m_LastStatusTime) {
- m_LastStatusTime = 0;
- m_pStatusbar->SetStatusText(wxT("Ready"), 2);
- }
- }
-
- if (m_bViewRTI) {
- GF_SystemRTInfo rti;
- if (!gf_sys_get_rti(RTI_REFRESH_MS, &rti, 0)) return;
- if (rti.gpac_memory) rti.process_memory = rti.gpac_memory;
-
- str = wxString::Format(wxT("CPU %02d (%02d) - Mem %d kB" ),
- rti.total_cpu_usage, rti.process_cpu_usage, rti.gpac_memory/1024);
-
- m_pStatusbar->SetStatusText(str, 2);
- }
- if (!m_connected) return;
-
- now = gf_term_get_time_in_ms(m_term);
- if (!now) return;
-
- if (!m_duration) {
- str = format_time(now, 1000);
- m_pStatusbar->SetStatusText(str);
- str = wxString::Format(wxT("FPS %.2f"), gf_term_get_framerate(m_term, 0));
- m_pStatusbar->SetStatusText(str, 1);
- return;
- }
-#ifdef __WXGTK__
- if (m_bGrabbed) {
- u32 now = gf_sys_clock() - m_last_grab_time;
- if (now>200) {
- m_bGrabbed = 0;
- Double res = (Double) m_last_grab_pos;
- res /= 1000;
- res *= m_duration;
- if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
- m_bToReset = 0;
- }
- gf_term_play_from_time(m_term, (u32) res, 0);
- return;
- }
- }
-#endif
-
- if (!m_bGrabbed) {
- if ((now >= m_duration + 500) && gf_term_get_option(m_term, GF_OPT_IS_FINISHED)) {
- m_pPlayList->PlayNext();
- } else {
- Double val = now * 1000;
- val /= m_duration;
- m_pProg->SetValue((val<=1000) ? (u32) val : 1000);
-
- if (0) {
- str = format_time(m_duration-now, 1000);
- } else {
- str = format_time(now, 1000);
- }
- m_pStatusbar->SetStatusText(str);
- str = wxString::Format(wxT("FPS %.2f"), gf_term_get_framerate(m_term, 0));
- m_pStatusbar->SetStatusText(str, 1);
- }
- }
-}
-
-void wxOsmo4Frame::ConnectAcknowledged(Bool bOk)
-{
- if (bOk) {
- m_pTimer->Start(RTI_REFRESH_MS, 0);
- m_connected = 1;
- m_bToReset = 0;
- UpdatePlay();
- BuildChapterList(0);
- } else {
- BuildChapterList(1);
- if (!m_connected) {
- UpdatePlay();
- m_pTimer->Stop();
- //m_pProg->Enable(0);
- }
- }
-}
-
-void wxOsmo4Frame::OnFilePlay(wxCommandEvent & WXUNUSED(event))
-{
- wxCommandEvent evt;
- if (m_connected) {
- if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
- if (m_bToReset) {
- m_pTimer->Start(100, 0);
- gf_term_play_from_time(m_term, 0, 0);
- }
- m_bToReset = 0;
- UpdatePlay();
- } else {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
- UpdatePlay();
- }
- } else {
- m_pPlayList->Play();
- }
-}
-
-void wxOsmo4Frame::OnFileStep(wxCommandEvent & WXUNUSED(event))
-{
- wxCommandEvent evt;
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_STEP_PAUSE);
- UpdatePlay();
-}
-
-void wxOsmo4Frame::OnFileStop(wxCommandEvent &WXUNUSED(event))
-{
- Stop();
-}
-
-void wxOsmo4Frame::Stop()
-{
- if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
- }
- m_bToReset = 1;
- m_pTimer->Stop();
- m_pProg->SetValue(0);
- UpdatePlay();
-}
-
-void wxOsmo4Frame::OnSlide(wxScrollEvent &event)
-{
- if (!m_duration) return;
-
- /*wxSlider on GTK is buggy, so track a release timeout*/
-#ifdef __WXGTK__
- m_last_grab_time = gf_sys_clock();
- m_bGrabbed = 1;
- m_last_grab_pos = event.GetPosition();
- Double now = (Double) m_last_grab_pos;
- now /= 1000;
- now *= m_duration;
- wxString str = format_time((u32) (now), 1000);
- m_pStatusbar->SetStatusText(str);
- if (!m_pTimer->IsRunning()) m_pTimer->Start(100, 0);
-#else
- s32 type = event.GetEventType();
- if (type == wxEVT_SCROLL_THUMBTRACK) {
- m_bGrabbed = 1;
- Double now = (Double) event.GetPosition();
- now /= 1000;
- now *= m_duration;
- wxString str = format_time((u32) (now), 1000);
- m_pStatusbar->SetStatusText(str);
- }
- else if (m_bGrabbed) {
- m_bGrabbed = 0;
- Double res = (Double) m_pProg->GetValue();
- res /= 1000;
- res *= m_duration;
- if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) {
- gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
- m_bToReset = 0;
- if (!m_pTimer->IsRunning()) m_pTimer->Start(100, 0);
- }
- gf_term_play_from_time(m_term, (u32) res, 0);
- }
-#endif
-}
-
-
-void wxOsmo4Frame::BuildViewList()
-{
- if (!vp_list || !m_connected) return;
-
- while (vp_list->GetMenuItemCount()) {
- wxMenuItem* it = vp_list->FindItemByPosition(0);
- vp_list->Delete(it);
- }
-
- s32 id = ID_VIEWPOINT_FIRST;
- nb_viewpoints = 0;
- while (1) {
- const char *szName;
- Bool bound;
- GF_Err e = gf_term_get_viewpoint(m_term, nb_viewpoints+1, &szName, &bound);
- if (e) break;
- if (szName) {
- vp_list->AppendCheckItem(id+nb_viewpoints, wxString(szName, wxConvUTF8) );
- } else {
- vp_list->AppendCheckItem(id+nb_viewpoints, wxString::Format(wxT("Viewpoint #%d"), nb_viewpoints+1) );
- }
- nb_viewpoints++;
- }
-}
-
-void wxOsmo4Frame::OnViewport(wxCommandEvent & event)
-{
- u32 ID = event.GetId() - ID_VIEWPOINT_FIRST;
- gf_term_set_viewpoint(m_term, ID+1, NULL);
-}
-
-void wxOsmo4Frame::OnUpdateViewport(wxUpdateUIEvent & event)
-{
- u32 ID = event.GetId() - ID_VIEWPOINT_FIRST;
- const char *szName;
- Bool bound;
- gf_term_get_viewpoint(m_term, ID+1, &szName, &bound);
- event.Enable(1);
- if (bound) event.Check(1);
-}
-
-void wxOsmo4Frame::OnNavigate(wxCommandEvent & event)
-{
- switch (event.GetId()) {
- case ID_NAVIGATE_NONE:
- gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE);
- break;
- case ID_NAVIGATE_WALK:
- gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_WALK);
- break;
- case ID_NAVIGATE_FLY:
- gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_FLY);
- break;
- case ID_NAVIGATE_EXAMINE:
- gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_EXAMINE);
- break;
- case ID_NAVIGATE_PAN:
- gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_PAN);
- break;
- case ID_NAVIGATE_SLIDE:
- gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE);
- break;
- case ID_NAVIGATE_ORBIT:
- gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_ORBIT);
- break;
- case ID_NAVIGATE_GAME:
- gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_GAME);
- break;
- }
-}
-void wxOsmo4Frame::OnNavigateReset(wxCommandEvent & WXUNUSED(event))
-{
- gf_term_set_option(m_term, GF_OPT_NAVIGATION_TYPE, 0);
-}
-void wxOsmo4Frame::OnUpdateNavigation(wxUpdateUIEvent & event)
-{
- u32 ID = event.GetId();
- event.Enable(0);
- if (!m_connected) return;
- u32 type = gf_term_get_option(m_term, GF_OPT_NAVIGATION_TYPE);
- bool enable = type ? 1 : 0;
-
- u32 mode = gf_term_get_option(m_term, GF_OPT_NAVIGATION);
- /*common 2D/3D modes*/
- if (ID==ID_NAVIGATE_NONE) {
- event.Enable(enable);
- event.Check(mode ? 0 : 1);
- }
- else if (ID==ID_NAVIGATE_EXAMINE) {
- event.Enable(enable);
- event.Check((mode==GF_NAVIGATE_EXAMINE) ? 1 : 0);
- }
- else if (ID==ID_NAVIGATE_SLIDE) {
- event.Enable(enable);
- event.Check((mode==GF_NAVIGATE_SLIDE) ? 1 : 0);
- }
-
- if (type==GF_NAVIGATE_TYPE_2D) return;
- event.Enable(enable);
- if (ID==ID_NAVIGATE_WALK) event.Check((mode==GF_NAVIGATE_WALK) ? 1 : 0);
- else if (ID==ID_NAVIGATE_FLY) event.Check((mode==GF_NAVIGATE_FLY) ? 1 : 0);
- else if (ID==ID_NAVIGATE_PAN) event.Check((mode==GF_NAVIGATE_PAN) ? 1 : 0);
- else if (ID==ID_NAVIGATE_ORBIT) event.Check((mode==GF_NAVIGATE_ORBIT) ? 1 : 0);
- else if (ID==ID_NAVIGATE_GAME) event.Check((mode==GF_NAVIGATE_GAME) ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnRenderSwitch(wxCommandEvent &WXUNUSED(event))
-{
- const char *opt = gf_cfg_get_key(m_user.config, "Compositor", "ForceOpenGL");
- Bool use_gl = (opt && !stricmp(opt, "yes")) ? 1 : 0;
- gf_cfg_set_key(m_user.config, "Compositor", "ForceOpenGL", use_gl ? "no" : "yes");
-
- gf_term_set_option(m_term, GF_OPT_USE_OPENGL, !use_gl);
-
- UpdateRenderSwitch();
-}
-
-void wxOsmo4Frame::UpdateRenderSwitch()
-{
- const char *opt = gf_cfg_get_key(m_user.config, "Compositor", "ForceOpenGL");
- m_pToolBar->RemoveTool(SWITCH_RENDER);
- if (opt && !stricmp(opt, "yes"))
- m_pToolBar->InsertTool(12, SWITCH_RENDER, *m_pSW2D, wxNullBitmap, FALSE, NULL, wxT("2D Rasterizer"));
- else
- m_pToolBar->InsertTool(12, SWITCH_RENDER, *m_pSW3D, wxNullBitmap, FALSE, NULL, wxT("OpenGL Rendering"));
-
-#ifdef WIN32
- /*there's a display bug with the menubtn, remove and reinsert*/
- m_pToolBar->RemoveTool(FILE_PREV);
- m_pToolBar->RemoveTool(FILE_NEXT);
- m_pToolBar->InsertControl(2, m_pPrevBut);
- m_pToolBar->InsertControl(3, m_pNextBut);
-#endif
- m_pToolBar->Realize();
-}
-
-void wxOsmo4Frame::UpdatePlay()
-{
- m_pToolBar->RemoveTool(FILE_PLAY);
- if (m_connected) {
- if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED)
- m_pToolBar->InsertTool(5, FILE_PLAY, *m_pPlay, wxNullBitmap, FALSE, NULL, wxT("Pause File"));
- else
- m_pToolBar->InsertTool(5, FILE_PLAY, *m_pPause, wxNullBitmap, FALSE, NULL, wxT("Play File"));
- } else {
- m_pToolBar->InsertTool(5, FILE_PLAY, *m_pPlay, wxNullBitmap, FALSE, NULL, wxT("Pause File"));
- }
-
-#ifdef WIN32
- /*there's a display bug with the menubtn, remove and reinsert*/
- m_pToolBar->RemoveTool(FILE_PREV);
- m_pToolBar->RemoveTool(FILE_NEXT);
- m_pToolBar->InsertControl(2, m_pPrevBut);
- m_pToolBar->InsertControl(3, m_pNextBut);
-#endif
- m_pToolBar->Realize();
-}
-
-void wxOsmo4Frame::OnCollide(wxCommandEvent & event)
-{
- u32 ID = event.GetId();
- if (ID==ID_COLLIDE_NONE) gf_term_set_option(m_term, GF_OPT_COLLISION, GF_COLLISION_NONE);
- else if (ID==ID_COLLIDE_REG) gf_term_set_option(m_term, GF_OPT_COLLISION, GF_COLLISION_NORMAL);
- else if (ID==ID_COLLIDE_DISP) gf_term_set_option(m_term, GF_OPT_COLLISION, GF_COLLISION_DISPLACEMENT);
-}
-void wxOsmo4Frame::OnUpdateCollide(wxUpdateUIEvent & event)
-{
- u32 ID = event.GetId();
- event.Enable(0);
- if (!m_connected) return;
- event.Enable(1);
- u32 mode = gf_term_get_option(m_term, GF_OPT_COLLISION);
- if (ID==ID_COLLIDE_NONE) {
- event.Check((mode==GF_COLLISION_NONE) ? 1 : 0);
- }
- else if (ID==ID_COLLIDE_REG) {
- event.Check((mode==GF_COLLISION_NORMAL) ? 1 : 0);
- }
- else if (ID==ID_COLLIDE_DISP) {
- event.Check((mode==GF_COLLISION_DISPLACEMENT) ? 1 : 0);
- }
-}
-
-void wxOsmo4Frame::OnHeadlight(wxCommandEvent &WXUNUSED(event))
-{
- Bool val = !gf_term_get_option(m_term, GF_OPT_HEADLIGHT);
- gf_term_set_option(m_term, GF_OPT_HEADLIGHT, val);
-}
-void wxOsmo4Frame::OnUpdateHeadlight(wxUpdateUIEvent & event)
-{
- event.Enable(0);
- if (!m_connected) return;
- u32 type = gf_term_get_option(m_term, GF_OPT_NAVIGATION_TYPE);
- if (type!=GF_NAVIGATE_TYPE_3D) return;
-
- event.Enable(1);
- event.Check(gf_term_get_option(m_term, GF_OPT_HEADLIGHT) ? 1 : 0);
-}
-void wxOsmo4Frame::OnGravity(wxCommandEvent & WXUNUSED(event))
-{
- Bool val = gf_term_get_option(m_term, GF_OPT_GRAVITY) ? 0 : 1;
- gf_term_set_option(m_term, GF_OPT_GRAVITY, val);
-}
-void wxOsmo4Frame::OnUpdateGravity(wxUpdateUIEvent & event)
-{
- event.Enable(0);
- if (!m_connected) return;
- u32 type = gf_term_get_option(m_term, GF_OPT_NAVIGATION_TYPE);
- if (type!=GF_NAVIGATE_TYPE_3D) return;
- type = gf_term_get_option(m_term, GF_OPT_NAVIGATION);
- if (type != GF_NAVIGATE_WALK) return;
- event.Enable(1);
- event.Check(gf_term_get_option(m_term, GF_OPT_GRAVITY) ? 1 : 0);
-}
-
-
-BEGIN_EVENT_TABLE(wxMyComboBox, wxComboBox)
- EVT_KEY_UP(wxMyComboBox::OnKeyUp)
-END_EVENT_TABLE()
-
-void wxMyComboBox::OnKeyUp(wxKeyEvent &event)
-{
- if (event.GetKeyCode()==WXK_RETURN) {
- event.Skip();
- wxCommandEvent evt;
- evt.SetEventType(wxEVT_COMMAND_COMBOBOX_SELECTED);
- evt.SetEventObject(this);
- evt.SetId(GetId());
- GetParent()->AddPendingEvent(evt);
- }
-}
-
-
-void wxOsmo4Frame::ReloadURLs()
-{
- const char *sOpt;
- u32 i=0;
-
- m_Address->Clear();
- while (1) {
- sOpt = gf_cfg_get_key_name(m_user.config, "RecentFiles", i);
- if (!sOpt) break;
- m_Address->Append(wxString(sOpt, wxConvUTF8) );
- i++;
- }
-}
-
-void wxOsmo4Frame::SelectionReady()
-{
- wxString urlVal = m_Address->GetValue();
- if (urlVal.Find(wxT("://"))>0) {
- UpdateLastFiles(m_user.config, urlVal.mb_str(wxConvUTF8));
- ReloadURLs();
- }
- m_pPlayList->Truncate();
- m_pPlayList->QueueURL(urlVal);
- m_pPlayList->RefreshList();
- m_pPlayList->PlayNext();
-}
-
-void wxOsmo4Frame::OnURLSelect(wxCommandEvent &WXUNUSED(event))
-{
- SelectionReady();
-}
-
-void wxOsmo4Frame::OnPlaylist(wxCommandEvent &WXUNUSED(event))
-{
- assert(m_pPlayList);
- m_pPlayList->Show(m_pPlayList->IsShown() ? 0 : 1);
-}
-
-void wxOsmo4Frame::OnUpdatePlayList(wxUpdateUIEvent & event)
-{
- event.Enable(1);
- event.Check(m_pPlayList->IsShown() ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnFilePrevOpen(wxNotifyEvent & event)
-{
- u32 count = gf_list_count(m_pPlayList->m_entries);
- u32 start = m_pPlayList->m_cur_entry - 1;
- wxMenu *popup = new wxMenu();
-
- for (u32 i=0; i<10; i++) {
- if (i > start) break;
- if (start - i >= count) break;
- PLEntry *ple = (PLEntry *) gf_list_get(m_pPlayList->m_entries, start - i);
- popup->Append(ID_NAV_PREV_0 + i, wxString(ple->m_disp_name, wxConvUTF8) );
- }
- m_pPrevBut->AssignMenu(popup);
-}
-
-void wxOsmo4Frame::OnFileNextOpen(wxNotifyEvent & event)
-{
- u32 count = gf_list_count(m_pPlayList->m_entries);
- wxMenu *popup = new wxMenu();
- u32 start = m_pPlayList->m_cur_entry + 1;
- for (u32 i=0; i<10; i++) {
- if (start + i >= count) break;
- PLEntry *ple = (PLEntry *) gf_list_get(m_pPlayList->m_entries, start + i);
- popup->Append(ID_NAV_NEXT_0 + i, wxString(ple->m_disp_name, wxConvUTF8) );
- }
- m_pNextBut->AssignMenu(popup);
-}
-
-void wxOsmo4Frame::OnNavPrev(wxCommandEvent &WXUNUSED(event))
-{
- if (m_pPlayList->m_cur_entry<=0) return;
- m_pPlayList->PlayPrev();
-}
-void wxOsmo4Frame::OnUpdateNavPrev(wxUpdateUIEvent & event)
-{
- if (m_pPlayList->m_cur_entry<=0) event.Enable(0);
- else event.Enable(TRUE);
-}
-void wxOsmo4Frame::OnNavPrevMenu(wxCommandEvent &event)
-{
- u32 ID = event.GetId() - ID_NAV_PREV_0;
- s32 prev = m_pPlayList->m_cur_entry - ID;
- if (prev>=0) {
- m_pPlayList->m_cur_entry = prev;
- m_pPlayList->PlayPrev();
- }
-}
-void wxOsmo4Frame::OnNavNext(wxCommandEvent &WXUNUSED(event))
-{
- /*don't play if last could trigger playlist loop*/
- if ((m_pPlayList->m_cur_entry<0) || (gf_list_count(m_pPlayList->m_entries) == 1 + (u32) m_pPlayList->m_cur_entry)) return;
- m_pPlayList->PlayNext();
-}
-void wxOsmo4Frame::OnUpdateNavNext(wxUpdateUIEvent & event)
-{
- if (m_pPlayList->m_cur_entry<0) event.Enable(0);
- else if ((u32) m_pPlayList->m_cur_entry + 1 == gf_list_count(m_pPlayList->m_entries) ) event.Enable(0);
- else event.Enable(1);
-}
-
-void wxOsmo4Frame::OnNavNextMenu(wxCommandEvent &event)
-{
- u32 ID = event.GetId() - ID_NAV_NEXT_0;
- s32 next = m_pPlayList->m_cur_entry + ID;
- if (next < (s32) gf_list_count(m_pPlayList->m_entries) ) {
- m_pPlayList->m_cur_entry = next;
- m_pPlayList->PlayNext();
- }
-}
-
-void wxOsmo4Frame::OnClearNav(wxCommandEvent &WXUNUSED(event))
-{
- m_pPlayList->ClearButPlaying();
-}
-
-
-void wxOsmo4Frame::BuildStreamList(Bool reset_only)
-{
- u32 nb_subs;
- wxMenu *pMenu;
-
- pMenu = sel_menu->FindItemByPosition(0)->GetSubMenu();
- while (pMenu->GetMenuItemCount()) {
- wxMenuItem* it = pMenu->FindItemByPosition(0);
- pMenu->Delete(it);
- }
- pMenu = sel_menu->FindItemByPosition(1)->GetSubMenu();
- while (pMenu->GetMenuItemCount()) {
- wxMenuItem* it = pMenu->FindItemByPosition(0);
- pMenu->Delete(it);
- }
- pMenu = sel_menu->FindItemByPosition(2)->GetSubMenu();
- while (pMenu->GetMenuItemCount()) {
- wxMenuItem* it = pMenu->FindItemByPosition(0);
- pMenu->Delete(it);
- }
-
- if (reset_only) {
- m_bFirstStreamListBuild = 1;
- return;
- }
-
- if (!gf_term_get_option(m_term, GF_OPT_CAN_SELECT_STREAMS)) return;
-
- nb_subs = 0;
- GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
- if (!root_od) return;
- u32 count = gf_term_get_object_count(m_term, root_od);
-
- for (u32 i=0; i<count; i++) {
- char szLabel[1024];
- GF_MediaInfo info;
- GF_ObjectManager *odm = gf_term_get_object(m_term, root_od, i);
- if (!odm) return;
-
- if (gf_term_get_object_info(m_term, odm, &info) != GF_OK) break;
-
- if (info.owns_service) {
- char *szName = (char *) strrchr(info.service_url, '\\');
- if (!szName) szName = (char *) strrchr(info.service_url, '/');
- if (!szName) szName = (char *) info.service_url;
- else szName += 1;
- strcpy(szLabel, szName);
- szName = strrchr(szLabel, '.');
- if (szName) szName[0] = '\0';
- }
- switch (info.od_type) {
- case GF_STREAM_AUDIO:
- pMenu = sel_menu->FindItemByPosition(0)->GetSubMenu();
- if (!info.owns_service) sprintf(szLabel, "Audio #"LLU, (u64)pMenu->GetMenuItemCount() + 1);
- pMenu->AppendCheckItem(ID_SELSTREAM_0 +i, wxString(szLabel, wxConvUTF8));
- break;
- case GF_STREAM_VISUAL:
- pMenu = sel_menu->FindItemByPosition(1)->GetSubMenu();
- if (!info.owns_service) sprintf(szLabel, "Video #"LLU, (u64)pMenu->GetMenuItemCount() + 1);
- pMenu->AppendCheckItem(ID_SELSTREAM_0 +i, wxString(szLabel, wxConvUTF8));
- break;
- case GF_STREAM_TEXT:
- nb_subs ++;
- pMenu = sel_menu->FindItemByPosition(2)->GetSubMenu();
- if (!info.owns_service) sprintf(szLabel, "Subtitle #"LLU, (u64)pMenu->GetMenuItemCount() + 1);
- pMenu->AppendCheckItem(ID_SELSTREAM_0 +i, wxString(szLabel, wxConvUTF8));
- break;
- }
- }
- if (m_bFirstStreamListBuild) {
- m_bFirstStreamListBuild = 0;
- if (!nb_subs && m_lookforsubs) LookForSubtitles();
- }
-}
-
-void wxOsmo4Frame::OnStreamSel(wxCommandEvent & event)
-{
- GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
- if (!root_od) return;
- u32 ID = event.GetId() - ID_SELSTREAM_0;
- GF_ObjectManager *odm = gf_term_get_object(m_term, root_od, ID);
- gf_term_select_object(m_term, odm);
-}
-
-void wxOsmo4Frame::OnUpdateStreamSel(wxUpdateUIEvent & event)
-{
- GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
- if (!root_od) return;
- u32 ID = event.GetId() - ID_SELSTREAM_0;
-
- GF_ObjectManager *odm = gf_term_get_object(m_term, root_od, ID);
- if (!odm) return;
-
- GF_MediaInfo info;
- gf_term_get_object_info(m_term, odm, &info);
- event.Enable(1);
- event.Check(info.status ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnUpdateStreamMenu(wxUpdateUIEvent & event)
-{
- if (!m_connected || !gf_term_get_option(m_term, GF_OPT_CAN_SELECT_STREAMS)) {
- event.Enable(0);
- } else {
- event.Enable(1);
- }
-}
-
-void wxOsmo4Frame::OnAddSub(wxCommandEvent &WXUNUSED(event))
-{
- wxFileDialog dlg(this, wxT("Add Subtitle"), wxT(""), wxT(""), wxT("All Subtitles|*.srt;*.ttxt|SRT Subtitles|*.srt|3GPP TimedText|*.ttxt|"), wxOPEN | wxCHANGE_DIR /* | wxHIDE_READONLY*/);
-
- if (dlg.ShowModal() == wxID_OK) {
- AddSubtitle(dlg.GetPath().mb_str(wxConvUTF8), 1);
- }
-
-}
-
-void wxOsmo4Frame::AddSubtitle(const char *fileName, Bool auto_play)
-{
- gf_term_add_object(m_term, fileName, auto_play);
-}
-
-static Bool subs_enum_dir_item(void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info)
-{
- wxOsmo4Frame *_this = (wxOsmo4Frame*)cbck;
- _this->AddSubtitle(item_path, 0);
- return 0;
-}
-
-void wxOsmo4Frame::LookForSubtitles()
-{
- char dir[GF_MAX_PATH];
- const char *url = m_pPlayList->GetURL().mb_str(wxConvUTF8);
- strcpy(dir, url);
- char *sep = strrchr(dir, '\\');
- if (!sep) strcpy(dir, ::wxGetCwd().mb_str(wxConvUTF8));
- else sep[0] = 0;
-
- gf_enum_directory(dir, 0, subs_enum_dir_item, this, "ttxt;srt");
-}
-
-void wxOsmo4Frame::OnCacheEnable(wxCommandEvent &WXUNUSED(event))
-{
- u32 state = gf_term_get_option(m_term, GF_OPT_MEDIA_CACHE);
- if (state==GF_MEDIA_CACHE_DISABLED) {
- gf_term_set_option(m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_ENABLED);
- } else if (state==GF_MEDIA_CACHE_DISABLED) {
- gf_term_set_option(m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISABLED);
- }
-}
-
-void wxOsmo4Frame::OnCacheStop(wxCommandEvent &WXUNUSED(event))
-{
- gf_term_set_option(m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISABLED);
-}
-
-void wxOsmo4Frame::OnCacheAbort(wxCommandEvent &WXUNUSED(event))
-{
- gf_term_set_option(m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISCARD);
-}
-
-void wxOsmo4Frame::OnUpdateCacheEnable(wxUpdateUIEvent & event)
-{
- u32 state = gf_term_get_option(m_term, GF_OPT_MEDIA_CACHE);
- switch (state) {
- case GF_MEDIA_CACHE_ENABLED:
- event.Enable(1);
- event.SetText(wxT("Enabled"));
- break;
- case GF_MEDIA_CACHE_RUNNING:
- event.SetText(wxT("Running"));
- event.Enable(0);
- break;
- case GF_MEDIA_CACHE_DISABLED:
- event.SetText(wxT("Disabled"));
- break;
- }
-}
-
-void wxOsmo4Frame::OnUpdateCacheAbort(wxUpdateUIEvent & event)
-{
- u32 state = gf_term_get_option(m_term, GF_OPT_MEDIA_CACHE);
- event.Enable( (state==GF_MEDIA_CACHE_RUNNING) ? 1 : 0);
-}
-
-
-
-void wxOsmo4Frame::BuildChapterList(Bool reset_only)
-{
- GF_MediaInfo odi;
-
- while (chap_menu->GetMenuItemCount()) {
- wxMenuItem* it = chap_menu->FindItemByPosition(0);
- chap_menu->Delete(it);
- }
- if (m_chapters_start) gf_free(m_chapters_start);
- m_chapters_start = NULL;
- m_num_chapters = 0;
- if (reset_only) return;
-
- GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
- if (!root_od) return;
- if (gf_term_get_object_info(m_term, root_od, &odi) != GF_OK) return;
-
- u32 count = gf_list_count(odi.od->OCIDescriptors);
- m_num_chapters = 0;
- for (u32 i=0; i<count; i++) {
- char szLabel[1024];
- GF_Segment *seg = (GF_Segment *) gf_list_get(odi.od->OCIDescriptors, i);
- if (seg->tag != GF_ODF_SEGMENT_TAG) continue;
-
- if (seg->SegmentName && strlen((const char *)seg->SegmentName)) {
- strcpy(szLabel, (const char *) seg->SegmentName);
- } else {
- sprintf(szLabel, "Chapter %02d", m_num_chapters+1);
- }
- chap_menu->AppendCheckItem(ID_SETCHAP_FIRST + m_num_chapters, wxString(szLabel, wxConvUTF8));
-
- m_chapters_start = (Double *) gf_realloc(m_chapters_start, sizeof(Double)*(m_num_chapters+1));
- m_chapters_start[m_num_chapters] = seg->startTime;
- m_num_chapters++;
- }
-
- /*get any service info*/
- NetInfoCommand com;
- if (!m_bStartupFile && gf_term_get_service_info(m_term, root_od, &com) == GF_OK) {
- wxString title = wxT("");
- if (com.track_info) {
- title.Format(wxT("%02d "), (u32) (com.track_info>>16) );
- }
- if (com.artist) {
- title.Append(wxString(com.artist, wxConvUTF8));
- title += wxT(" ");
- }
- if (com.name) {
- title.Append(wxString(com.name, wxConvUTF8));
- title += wxT(" ");
- }
- if (com.album) {
- title += wxT("(");
- title.Append(wxString(com.album, wxConvUTF8));
- title += wxT(")");
- }
-
- if (title.length()) SetTitle(title);
- }
-
-}
-
-void wxOsmo4Frame::OnChapterSel(wxCommandEvent & event)
-{
- GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
- if (!root_od) return;
- u32 ID = event.GetId() - ID_SETCHAP_FIRST;
- gf_term_play_from_time(m_term, (u32) (1000*m_chapters_start[ID]), 0);
-}
-
-void wxOsmo4Frame::OnUpdateChapterSel(wxUpdateUIEvent & event)
-{
- Double now;
- Bool is_current;
- u32 ID = event.GetId() - ID_SETCHAP_FIRST;
-
- now = gf_term_get_time_in_ms(m_term);
- now /= 1000;
-
- is_current = 0;
- if (m_chapters_start[ID]<=now) {
- if (ID+1<m_num_chapters) {
- if (m_chapters_start[ID+1]>now) is_current = 1;
- } else {
- is_current = 1;
- }
- }
- event.Enable(1);
- event.Check(is_current ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnUpdateChapterMenu(wxUpdateUIEvent & event)
-{
- if (!m_connected || !m_num_chapters) {
- event.Enable(0);
- } else {
- event.Enable(1);
- }
-}
-
-void wxOsmo4Frame::OnFileCopy(wxCommandEvent &event)
-{
- const char *text = gf_term_get_text_selection(m_term, 0);
- if (!text) return;
- if (!wxTheClipboard->Open()) return;
-
- wxTheClipboard->SetData( new wxTextDataObject( wxString(text, wxConvUTF8)) );
- wxTheClipboard->Close();
-}
-
-void wxOsmo4Frame::OnUpdateFileCopy(wxUpdateUIEvent &event)
-{
- if (gf_term_get_text_selection(m_term, 1)!=NULL) {
- event.Enable(1);
- } else {
- event.Enable(0);
- }
-}
-
-void wxOsmo4Frame::OnFilePaste(wxCommandEvent &event)
-{
- if (!wxTheClipboard->Open()) return;
- if (wxTheClipboard->IsSupported( wxDF_TEXT )) {
- wxTextDataObject data;
- wxTheClipboard->GetData(data);
- gf_term_paste_text(m_term, data.GetText().mb_str(wxConvUTF8), 0);
- }
- wxTheClipboard->Close();
-}
-
-void wxOsmo4Frame::OnUpdateFilePaste(wxUpdateUIEvent &event)
-{
- Bool ok = 0;
- if (wxTheClipboard->Open()) {
- if (wxTheClipboard->IsSupported( wxDF_TEXT )) {
- if (gf_term_paste_text(m_term, NULL, 1)==GF_OK) {
- ok = 1;
- }
- }
- wxTheClipboard->Close();
- }
- event.Enable(ok ? 1 : 0);
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-#ifndef _WXOSMO4_H
-#define _WXOSMO4_H
-
-/*
-we need to force X to work in sync mode when we use embedded view...
-include first to avoid Bool type redef between X11 and gpac
-*/
-#ifdef __WXGTK__
-#include <X11/Xlib.h>
-#endif
-
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-
-#include <wx/image.h>
-#include <wx/listctrl.h>
-#include <wx/event.h>
-#include "menubtn.h"
-
-/*include gpac AFTER wx in case we override malloc/realloc/free for mem tracking*/
-#include <gpac/terminal.h>
-#include <gpac/term_info.h>
-
-class wxOsmo4App : public wxApp
-{
-public:
- virtual bool OnInit();
-};
-
-DECLARE_APP(wxOsmo4App)
-
-class wxOsmo4Frame;
-class wxPlaylist;
-
-class GPACLogs : public wxLogWindow {
-public:
- GPACLogs(wxFrame *parent) : wxLogWindow(parent, wxT("GPAC Logs"), FALSE, FALSE) {
- m_pMain = (wxOsmo4Frame *) parent;
- }
- virtual bool OnFrameClose(wxFrame *frame);
-
-private:
- wxOsmo4Frame *m_pMain;
-};
-
-#define MAX_VIEWPOINTS 50
-
-// Menu commands
-enum
-{
- GWX_FILE_OPEN = wxID_HIGHEST,
- GWX_FILE_OPEN_URL,
- FILE_RELOAD,
- FILE_RELOAD_CONFIG,
- FILE_PLAY,
- FILE_STEP,
- FILE_STOP,
- FILE_PREV,
- FILE_NEXT,
- FILE_PROPERTIES,
- FILE_COPY,
- FILE_PASTE,
- TERM_RELOAD,
- FILE_QUIT,
- VIEW_FULLSCREEN,
- VIEW_ORIGINAL,
- VIEW_AR_KEEP,
- VIEW_AR_FILL,
- VIEW_AR_43,
- VIEW_AR_169,
- VIEW_OPTIONS,
- VIEW_LOGS,
- VIEW_RTI,
- VIEW_PLAYLIST,
- SWITCH_RENDER,
- APP_SHORTCUTS,
- APP_NAV_KEYS,
- APP_ABOUT,
- ID_ADDRESS,
- ID_URL_GO,
- ID_ABOUT_CLOSE,
- ID_CLEAR_NAV,
- ID_STREAM_MENU,
- ID_CHAPTER_MENU,
- ID_ADD_SUB,
-
- ID_MCACHE_ENABLE,
- ID_MCACHE_STOP,
- ID_MCACHE_ABORT,
-
- ID_CTRL_TIMER,
- ID_SLIDER,
-
- ID_TREE_VIEW,
- ID_OD_TIMER,
- ID_VIEW_SG,
- ID_VIEW_WI,
- ID_VIEW_SEL,
-
-
- ID_HEADLIGHT,
- ID_NAVIGATE_NONE,
- ID_NAVIGATE_WALK,
- ID_NAVIGATE_FLY,
- ID_NAVIGATE_EXAMINE,
- ID_NAVIGATE_SLIDE,
- ID_NAVIGATE_PAN,
- ID_NAVIGATE_ORBIT,
- ID_NAVIGATE_GAME,
- ID_NAVIGATE_RESET,
-
- ID_COLLIDE_NONE,
- ID_COLLIDE_REG,
- ID_COLLIDE_DISP,
- ID_GRAVITY,
-
- ID_PL_OPEN,
- ID_PL_SAVE,
- ID_PL_ADD_FILE,
- ID_PL_ADD_URL,
- ID_PL_ADD_DIR,
- ID_PL_ADD_DIR_REC,
- ID_PL_REM_FILE,
- ID_PL_REM_ALL,
- ID_PL_REM_DEAD,
- ID_PL_UP,
- ID_PL_DOWN,
- ID_PL_RANDOMIZE,
- ID_PL_REVERSE,
- ID_PL_SEL_REV,
- ID_PL_SORT_TITLE,
- ID_PL_SORT_FILE,
- ID_PL_SORT_DUR,
- ID_PL_PLAY,
-
-
- /*reserve IDs for viewpoint menu*/
- ID_VIEWPOINT_FIRST,
- ID_VIEWPOINT_LAST = ID_VIEWPOINT_FIRST + MAX_VIEWPOINTS,
-
- /*reserve IDs for navigation menus*/
- ID_NAV_PREV_0,
- ID_NAV_PREV_9 = ID_NAV_PREV_0 + 10,
- ID_NAV_NEXT_0,
- ID_NAV_NEXT_9 = ID_NAV_NEXT_0 + 10,
- /*reserve IDs for stream selection menus*/
- ID_SELSTREAM_0,
- ID_SELSTREAM_9 = ID_SELSTREAM_0 + 10,
-
- /*reserve IDs for chapter selection menus*/
- ID_SETCHAP_FIRST,
- ID_SETCHAP_LAST = ID_SELSTREAM_0 + 200,
-};
-
-wxString get_pref_browser(GF_Config *cfg);
-
-class wxGPACEvent : public wxEvent
-{
-public:
- wxGPACEvent( wxWindow* win = (wxWindow*) NULL );
- void CopyObject( wxObject& obj ) const;
- virtual wxEvent *Clone() const;
-
- wxString to_url;
- GF_Event gpac_evt;
-
- DECLARE_DYNAMIC_CLASS(wxGPACEvent)
-};
-typedef void (wxEvtHandler::*GPACEventFunction)(wxGPACEvent&);
-DEFINE_EVENT_TYPE(GPAC_EVENT)
-
-#define EVT_GPACEVENT(func) DECLARE_EVENT_TABLE_ENTRY(GPAC_EVENT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (GPACEventFunction) & func, (wxObject*) NULL),
-
-class OpenURLDlg : public wxDialog {
-public:
- OpenURLDlg(wxWindow *parent, GF_Config *cfg);
- wxString m_urlVal;
-private:
- wxButton *m_go;
- wxComboBox *m_url;
- GF_Config *m_cfg;
- void OnGo(wxCommandEvent& event);
- DECLARE_EVENT_TABLE()
-};
-
-class wxMyComboBox : public wxComboBox
-{
-public:
- wxMyComboBox(wxWindow* parent, wxWindowID id, const wxString& value = wxT(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize)
- : wxComboBox(parent, id, value, pos, size, 0, NULL, wxCB_DROPDOWN)
- {}
-
-private:
- DECLARE_EVENT_TABLE()
-
- void OnKeyUp(wxKeyEvent &event);
-};
-
-class wxOsmo4Frame : public wxFrame {
-public:
- wxOsmo4Frame();
- virtual ~wxOsmo4Frame();
-
- char szAppPath[GF_MAX_PATH];
-
- u32 m_duration;
- wxString the_next_url;
- GF_Terminal *m_term;
- GF_User m_user;
- Bool m_connected, m_can_seek, m_console_off, m_loop, m_lookforsubs;
-
- void DoConnect();
-
- void ConnectAcknowledged(Bool bOk);
- void SetStatus(wxString str);
-
- void OnFilePlay(wxCommandEvent &event);
- void OnFileStep(wxCommandEvent &event);
- void OnFileStop(wxCommandEvent &event);
- wxString GetFileFilter();
-
- void BuildViewList();
- void BuildStreamList(Bool reset_only);
- void BuildChapterList(Bool reset_only);
-
- void AddSubtitle(const char *fileName, Bool auto_play);
-
- wxWindow *m_pView;
-
-#ifdef __WXGTK__
- u32 m_last_grab_time, m_last_grab_pos;
- wxWindow *m_pVisual;
-#endif
- wxSlider *m_pProg;
- wxPlaylist *m_pPlayList;
-
- void DoLayout(u32 v_width = 0, u32 v_height = 0);
- s32 m_last_prog;
-
- FILE *m_logs;
- u32 m_log_level, m_log_tools;
- u32 m_LastStatusTime;
-
-protected:
-
-private:
- DECLARE_EVENT_TABLE()
-
- void OnCloseApp(wxCloseEvent &event);
- void OnSize(wxSizeEvent &event);
-
- void OnFileOpen(wxCommandEvent &event);
- void OnFileOpenURL(wxCommandEvent &event);
- void OnFileReload(wxCommandEvent &event);
- void OnFileReloadConfig(wxCommandEvent & event);
- void OnFileProperties(wxCommandEvent &event);
- void OnFileQuit(wxCommandEvent &event);
- void OnFullScreen(wxCommandEvent &event);
- void OnOptions(wxCommandEvent &event);
- void OnViewARKeep(wxCommandEvent &event);
- void OnViewARFill(wxCommandEvent &event);
- void OnViewAR169(wxCommandEvent &event);
- void OnViewAR43(wxCommandEvent &event);
- void OnViewOriginal(wxCommandEvent &event);
- void OnPlaylist(wxCommandEvent &event);
- void OnShortcuts(wxCommandEvent &event);
- void OnNavInfo(wxCommandEvent &event);
- void OnAddSub(wxCommandEvent &event);
- void OnAbout(wxCommandEvent &event);
- Bool LoadTerminal();
- void OnGPACEvent(wxGPACEvent &event);
- void OnTimer(wxTimerEvent& event);
- void OnSlide(wxScrollEvent &event);
- void OnRelease(wxScrollEvent &event);
- void OnLogs(wxCommandEvent & event);
- void OnRTI(wxCommandEvent & event);
- void OnUpdatePlay(wxUpdateUIEvent &event);
- void OnUpdateNeedsConnect(wxUpdateUIEvent &event);
- void OnUpdateFullScreen(wxUpdateUIEvent &event);
- void OnUpdateAR(wxUpdateUIEvent &event);
- void OnViewport(wxCommandEvent & event);
- void OnUpdateViewport(wxUpdateUIEvent & event);
- void OnNavigate(wxCommandEvent & event);
- void OnNavigateReset(wxCommandEvent & event);
- void OnUpdateNavigation(wxUpdateUIEvent & event);
- void OnRenderSwitch(wxCommandEvent &event);
- void OnCollide(wxCommandEvent & event);
- void OnUpdateCollide(wxUpdateUIEvent & event);
- void OnHeadlight(wxCommandEvent & event);
- void OnUpdateHeadlight(wxUpdateUIEvent & event);
- void OnGravity(wxCommandEvent & event);
- void OnUpdateGravity(wxUpdateUIEvent & event);
- void OnURLSelect(wxCommandEvent &event);
- void OnUpdatePlayList(wxUpdateUIEvent & event);
- void OnFilePrevOpen(wxNotifyEvent & event);
- void OnFileNextOpen(wxNotifyEvent & event);
- void OnNavPrev(wxCommandEvent &event);
- void OnUpdateNavPrev(wxUpdateUIEvent & event);
- void OnNavPrevMenu(wxCommandEvent &event);
- void OnNavNext(wxCommandEvent &event);
- void OnUpdateNavNext(wxUpdateUIEvent & event);
- void OnNavNextMenu(wxCommandEvent &event);
- void OnClearNav(wxCommandEvent &event);
- void OnStreamSel(wxCommandEvent &event);
- void OnUpdateStreamSel(wxUpdateUIEvent & event);
- void OnUpdateStreamMenu(wxUpdateUIEvent & event);
- void OnChapterSel(wxCommandEvent &event);
- void OnUpdateChapterSel(wxUpdateUIEvent & event);
- void OnUpdateChapterMenu(wxUpdateUIEvent & event);
-
- void SelectionReady();
- void ReloadURLs();
- void LookForSubtitles();
-
- void OnCacheEnable(wxCommandEvent &event);
- void OnCacheStop(wxCommandEvent &event);
- void OnCacheAbort(wxCommandEvent &event);
- void OnUpdateCacheEnable(wxUpdateUIEvent & event);
- void OnUpdateCacheAbort(wxUpdateUIEvent & event);
-
- void OnFileCopy(wxCommandEvent &event);
- void OnUpdateFileCopy(wxUpdateUIEvent &event);
- void OnFilePaste(wxCommandEvent &event);
- void OnUpdateFilePaste(wxUpdateUIEvent &event);
-
-
- void CheckVideoOut();
-
- wxMenuBar* m_pMenubar;
- wxStatusBar* m_pStatusbar;
- wxTimer *m_pTimer;
- GPACLogs *m_pLogs;
- wxBoxSizer *m_pAddBar;
-
- Bool m_bGrabbed, m_bToReset, m_bFirstStreamListBuild;
- wxBitmap *m_pOpenFile, *m_pPrev, *m_pNext, *m_pPlay, *m_pPause, *m_pStep, *m_pStop, *m_pInfo, *m_pConfig, *m_pSW2D, *m_pSW3D;
- wxMenuButton *m_pPrevBut, *m_pNextBut;
- wxToolBar *m_pToolBar;
- wxMyComboBox *m_Address;
-
- wxMenu *vp_list;
- wxMenu *sel_menu;
- wxMenu *chap_menu;
- void Stop();
-
- s32 nb_viewpoints;
-
- void UpdateRenderSwitch();
- void UpdatePlay();
-
- u32 m_orig_width, m_orig_height;
-
- u32 m_num_chapters;
- Double *m_chapters_start;
- Bool m_bExternalView, m_bViewRTI, m_bStartupFile;
-
- void ShowViewWindow(Bool do_show);
-};
-
-
-#endif //_WXOSMO4_H
-
+++ /dev/null
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// French (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-#ifdef _WIN32
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_OSMO_ICON ICON DISCARDABLE "../../doc/osmo4.ico"
-#endif // French (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / command-line client
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*includes both terminal and od browser*/
-#include <gpac/terminal.h>
-#include <gpac/options.h>
-/*for initial setup*/
-#include <gpac/modules/service.h>
-
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/compositor_dev.h>
-
-#include <windows.h>
-#include <commdlg.h>
-#include <commctrl.h>
-
-#ifdef _WIN32_WCE
-#include <aygshell.h>
-#include <gx.h>
-
-#else
-
-#ifndef _T
-#define _T(__a) (LPCSTR) __a
-#endif
-
-#endif
-
-#include "resource.h"
-
-#define WM_LOADTERM WM_USER + 1
-#define STATE_TIMER_ID 20
-#define STATE_TIMER_DUR 1000
-#define GPAC_TIMER_ID 21
-#define GPAC_TIMER_DUR 33
-
-
-Bool gf_file_dialog(HINSTANCE inst, HWND parent, char *url, const char *ext_list, GF_Config *cfg);
-void set_backlight_state(Bool disable);
-void refresh_recent_files();
-void do_layout(Bool notif_size);
-
-static HWND g_hwnd = NULL;
-static HWND g_hwnd_disp = NULL;
-static HWND g_hwnd_menu = NULL;
-static HWND g_hwnd_status = NULL;
-static HINSTANCE g_hinst = NULL;
-static Bool is_ppc = GF_FALSE;
-
-static Bool is_connected = GF_FALSE;
-static Bool navigation_on = GF_FALSE;
-static Bool playlist_navigation_on = GF_TRUE;
-
-static u32 log_level = GF_LOG_ERROR;
-
-static u32 Duration;
-static Bool CanSeek = GF_FALSE;
-static u32 Volume=100;
-static char the_url[GF_MAX_PATH] = "";
-static Bool NavigateTo = GF_FALSE;
-static char the_next_url[GF_MAX_PATH];
-static GF_Terminal *term;
-static GF_User user;
-static u32 disp_w = 0;
-static u32 disp_h = 0;
-static u32 screen_w = 0;
-static u32 screen_h = 0;
-static u32 menu_h = 0;
-static u32 caption_h = 0;
-static u32 ratio_h = 1;
-static Bool backlight_off = GF_FALSE;
-static u32 prev_batt_bl, prev_ac_bl;
-static Bool show_status = GF_TRUE;
-static Bool reset_status = GF_TRUE;
-static u32 last_state_time = 0;
-static Bool loop = GF_FALSE;
-static Bool full_screen = GF_FALSE;
-static Bool force_2d_gl = GF_FALSE;
-static Bool ctrl_mod_down = GF_FALSE;
-static Bool view_cpu = GF_TRUE;
-static Bool use_low_fps = GF_FALSE;
-static Bool use_svg_prog = GF_FALSE;
-
-static Bool log_rti = GF_FALSE;
-static FILE *log_file = NULL;
-static u32 rti_update_time_ms = 200;
-
-static u32 playlist_act = 0;
-
-
-void recompute_res(u32 sw, u32 sh )
-{
- caption_h = GetSystemMetrics(SM_CYCAPTION);
- menu_h = GetSystemMetrics(SM_CYMENU)+2;
- screen_w = GetSystemMetrics(SM_CXSCREEN);
- screen_h = GetSystemMetrics(SM_CYSCREEN);
-
- ratio_h = sh / screen_h;
- screen_w = sw;
- screen_h = sh;
- menu_h *= ratio_h;
-// caption_h *= ratio_h;
- disp_w = screen_w;
- disp_h = screen_h - menu_h /*- caption_h*/;
-}
-
-
-void set_status(char *state)
-{
- if (show_status && g_hwnd_status) {
-#ifdef _WIN32_WCE
- TCHAR wstate[1024];
- CE_CharToWide(state, (u16 *) wstate);
- SendMessage(g_hwnd_status, WM_SETTEXT, 0, (LPARAM) wstate);
-#else
- SendMessage(g_hwnd_status, WM_SETTEXT, 0, (LPARAM) state);
-#endif
- last_state_time = GetTickCount();
- }
-}
-
-void update_state_info()
-{
- TCHAR wstate[1024];
- Double FPS;
- u32 time, m, s;
- if (!show_status) return;
- if (last_state_time) {
- if (GetTickCount() > last_state_time + 200) {
- last_state_time = 0;
- reset_status = GF_TRUE;
- }
- else return;
- }
- if (!term) return;
- if (!is_connected && reset_status) {
- SendMessage(g_hwnd_status, WM_SETTEXT, 0, (LPARAM) TEXT("Ready") );
- reset_status = GF_FALSE;
- return;
- }
-
- FPS = gf_term_get_framerate(term, GF_FALSE);
- time = gf_term_get_time_in_ms(term) / 1000;
- m = time/60;
- s = time - m*60;
- if (view_cpu) {
- GF_SystemRTInfo rti;
- if (!gf_sys_get_rti(STATE_TIMER_DUR, &rti, 0)) return;
- wsprintf(wstate, TEXT("T %02d:%02d : FPS %02.2f : CPU %02d"), m, s, FPS, rti.total_cpu_usage);
- } else {
- wsprintf(wstate, TEXT("T %02d:%02d : FPS %02.2f"), m, s, FPS);
- }
- SendMessage(g_hwnd_status, WM_SETTEXT, 0, (LPARAM) wstate);
-}
-
-
-static u64 prev_pos = 0;
-void cbk_on_progress(void *_title, u64 done, u64 total)
-{
-#if 0
- char szMsg[1024];
- u32 pos = (u32) ((u64) done * 100)/total;
- if (pos<prev_pos) prev_pos = 0;
- if (pos!=prev_pos) {
- prev_pos = pos;
- sprintf(szMsg, "%s: (%02d/100)", _title ? (char *)_title : "", pos);
- set_status(szMsg);
- }
-#endif
-}
-
-void set_full_screen()
-{
- full_screen = (Bool)!full_screen;
- if (full_screen) {
- show_status = GF_FALSE;
- do_layout(GF_FALSE);
- gf_term_set_option(term, GF_OPT_FULLSCREEN, full_screen);
- } else {
- const char *str = gf_cfg_get_key(user.config, "General", "ShowStatusBar");
- show_status = (str && !strcmp(str, "yes")) ? GF_TRUE : GF_FALSE;
- gf_term_set_option(term, GF_OPT_FULLSCREEN, full_screen);
- do_layout(GF_TRUE);
- }
-}
-
-
-static void on_gpac_rti_log(void *cbk, GF_LOG_Level ll, GF_LOG_Tool lm, const char *fmt, va_list list)
-{
- if (!log_file) return;
-
- if (lm & GF_LOG_RTI) {
- GF_SystemRTInfo rti;
- if (fmt) vfprintf(log_file, fmt, list);
-
- gf_sys_get_rti(rti_update_time_ms, &rti, 0);
-
- fprintf(log_file, "% 8d\t% 8d\t% 8d\t% 4d\t% 8d\t\t",
- gf_sys_clock(),
- gf_term_get_time_in_ms(term),
- rti.total_cpu_usage,
- (u32) gf_term_get_framerate(term, GF_FALSE),
- (u32) ( rti.gpac_memory / 1024)
- );
- } else if (fmt && (ll>=GF_LOG_INFO)) {
- vfprintf(log_file, fmt, list);
- }
-}
-static void on_gpac_log(void *cbk, GF_LOG_Level ll, GF_LOG_Tool lm, const char *fmt, va_list list)
-{
- if (fmt && log_file) vfprintf(log_file, fmt, list);
-}
-
-
-static void setup_logs()
-{
- if (log_file) gf_fclose(log_file);
- log_file = NULL;
-
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_ERROR);
- gf_log_set_callback(NULL, NULL);
-
- if (log_rti) {
- const char *filename = gf_cfg_get_key(user.config, "General", "LogFile");
- if (!filename) {
- gf_cfg_set_key(user.config, "General", "LogFile", "\\gpac_logs.txt");
- filename = "\\gpac_logs.txt";
- }
- log_file = gf_fopen(filename, "a+t");
-
- fprintf(log_file, "!! GPAC RunTime Info for file %s !!\n", the_url);
- fprintf(log_file, "SysTime(ms)\tSceneTime(ms)\tCPU\tFPS\tMemory(kB)\tObservation\n");
-
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_ERROR);
- gf_log_set_tool_level(GF_LOG_RTI, GF_LOG_DEBUG);
- gf_log_set_callback(log_file, on_gpac_rti_log);
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_RTI, ("[RTI] System state when enabling log\n"));
- } else {
- const char *filename = gf_cfg_get_key(user.config, "General", "LogFile");
- if (!filename) {
- gf_cfg_set_key(user.config, "General", "LogFile", "\\gpac_logs.txt");
- filename = "\\gpac_logs.txt";
- }
- const char *logs = gf_cfg_get_key(user.config, "General", "Logs");
- if (logs) {
- if (gf_log_set_tools_levels( logs ) != GF_OK) {
- } else {
- if (log_file = gf_fopen(filename, "a+t")) {
- gf_log_set_callback(log_file, on_gpac_log);
- }
- }
- }
- }
-}
-
-void do_open_file()
-{
- gf_cfg_set_key(user.config, "RecentFiles", the_url, NULL);
- gf_cfg_insert_key(user.config, "RecentFiles", the_url, "", 0);
- u32 count = gf_cfg_get_key_count(user.config, "RecentFiles");
- if (count > 10) gf_cfg_set_key(user.config, "RecentFiles", gf_cfg_get_key_name(user.config, "RecentFiles", count-1), NULL);
-
- setup_logs();
-
- gf_term_connect(term, the_url);
-}
-
-void switch_playlist(Bool play_prev)
-{
- char szPLE[20];
- u32 idx = 0;
- u32 count;
- const char *ple = gf_cfg_get_key(user.config, "General", "PLEntry");
- if (ple) idx = atoi(ple);
-
- count = gf_cfg_get_key_count(user.config, "Playlist");
- if (!count) return;
- /*not the first launch*/
- if (strlen(the_url)) {
- if (!idx && play_prev) return;
- if (play_prev) idx--;
- else idx++;
- if (idx>=count) return;
- } else {
- if (idx>=count) idx=0;
- }
-
- ple = gf_cfg_get_key_name(user.config, "Playlist", idx);
- if (!ple) return;
-
- sprintf(szPLE, "%d", idx);
- gf_cfg_set_key(user.config, "General", "PLEntry", szPLE);
-
- strcpy(the_url, ple);
- do_open_file();
-}
-
-
-Bool GPAC_EventProc(void *ptr, GF_Event *evt)
-{
- switch (evt->type) {
- case GF_EVENT_DURATION:
- Duration = (u32) (evt->duration.duration*1000);
- CanSeek = evt->duration.can_seek;
- break;
- case GF_EVENT_MESSAGE:
- {
- if (!evt->message.message) return GF_FALSE;
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONSOLE, ("%s: %s\n", evt->message.message, gf_error_to_string(evt->message.error)));
- //set_status((char *) evt->message.message);
- }
- break;
- case GF_EVENT_PROGRESS:
- {
- char *szTitle = "";
- if (evt->progress.progress_type==0) szTitle = "Buffer ";
- else if (evt->progress.progress_type==1) szTitle = "Download ";
- else if (evt->progress.progress_type==2) szTitle = "Import ";
- cbk_on_progress(szTitle, evt->progress.done, evt->progress.total);
- }
- break;
-
- case GF_EVENT_SIZE:
- break;
- case GF_EVENT_RESOLUTION:
- recompute_res(evt->size.width, evt->size.height);
- do_layout(GF_TRUE);
- break;
-
- case GF_EVENT_SCENE_SIZE:
- do_layout(GF_TRUE);
- break;
- case GF_EVENT_DBLCLICK:
- set_full_screen();
- return GF_FALSE;
- case GF_EVENT_CONNECT:
- if (evt->connect.is_connected) {
- is_connected = GF_TRUE;
- if (!backlight_off) set_backlight_state(GF_TRUE);
- refresh_recent_files();
- navigation_on = (gf_term_get_option(term, GF_OPT_NAVIGATION)==GF_NAVIGATE_NONE) ? GF_FALSE : GF_TRUE;
- } else {
- navigation_on = GF_FALSE;
- is_connected = GF_FALSE;
- Duration = 0;
- }
- break;
- case GF_EVENT_EOS:
- if (Duration>2000)
- gf_term_play_from_time(term, 0, 0);
- break;
- case GF_EVENT_QUIT:
- PostMessage(g_hwnd, WM_DESTROY, 0, 0);
- break;
- case GF_EVENT_KEYDOWN:
- switch (evt->key.key_code) {
- case GF_KEY_ENTER:
- if (full_screen) set_full_screen();
- break;
- case GF_KEY_1:
- ctrl_mod_down = (Bool)!ctrl_mod_down;
- evt->key.key_code = GF_KEY_CONTROL;
- evt->type = ctrl_mod_down ? GF_EVENT_KEYDOWN : GF_EVENT_KEYUP;
- gf_term_user_event(term, evt);
- break;
- case GF_KEY_MEDIAPREVIOUSTRACK:
- playlist_act = 2;
- break;
- case GF_KEY_MEDIANEXTTRACK:
- playlist_act = 1;
- break;
- }
- break;
- case GF_EVENT_NAVIGATE:
- if (gf_term_is_supported_url(term, evt->navigate.to_url, GF_TRUE, GF_TRUE)) {
- gf_term_navigate_to(term, evt->navigate.to_url);
- return GF_TRUE;
- } else {
-#ifdef _WIN32_WCE
- u16 dst[1024];
-#endif
- SHELLEXECUTEINFO info;
-
- /*
- if (full_screen) gf_term_set_option(term, GF_OPT_FULLSCREEN, 0);
- full_screen = 0;
- */
- memset(&info, 0, sizeof(SHELLEXECUTEINFO));
- info.cbSize = sizeof(SHELLEXECUTEINFO);
- info.lpVerb = _T("open");
- info.fMask = SEE_MASK_NOCLOSEPROCESS;
- info.lpFile = _T("iexplore");
-#ifdef _WIN32_WCE
- CE_CharToWide((char *) evt->navigate.to_url, dst);
- info.lpParameters = (LPCTSTR) dst;
-#else
- info.lpParameters = evt->navigate.to_url;
-#endif
- info.nShow = SW_SHOWNORMAL;
- ShellExecuteEx(&info);
- }
- return GF_TRUE;
- }
- return GF_FALSE;
-}
-
-//#define TERM_NOT_THREADED
-
-Bool LoadTerminal()
-{
- /*by default use current dir*/
- strcpy(the_url, ".");
-
- setup_logs();
-
- g_hwnd_disp = CreateWindow(TEXT("STATIC"), NULL, WS_CHILD | WS_VISIBLE , 0, 0, disp_w, disp_h, g_hwnd, NULL, g_hinst, NULL);
-
- user.EventProc = GPAC_EventProc;
- /*dummy in this case (global vars) but MUST be non-NULL*/
- user.opaque = user.modules;
- user.os_window_handler = g_hwnd_disp;
-#ifdef TERM_NOT_THREADED
- user.init_flags = GF_TERM_NO_REGULATION;
- user.threads = 0;
-#endif
-
- term = gf_term_new(&user);
- if (!term) {
- gf_modules_del(user.modules);
- gf_cfg_del(user.config);
- memset(&user, 0, sizeof(GF_User));
- return GF_FALSE;
- }
-
-#ifdef _WIN32_WCE
- screen_w = term->compositor->video_out->max_screen_width;
- screen_h = term->compositor->video_out->max_screen_height;
- disp_w = screen_w;
- disp_h = screen_h - menu_h /*- caption_h*/;
-#endif
-
-#ifdef TERM_NOT_THREADED
- ::SetTimer(g_hwnd, GPAC_TIMER_ID, GPAC_TIMER_DUR, NULL);
-#endif
-
- const char *str = gf_cfg_get_key(user.config, "General", "StartupFile");
- if (str) {
- do_layout(GF_TRUE);
- strcpy(the_url, str);
- gf_term_connect(term, str);
- }
- return GF_TRUE;
-}
-
-void do_layout(Bool notif_size)
-{
- u32 w, h;
- if (full_screen) {
- w = screen_w;
- h = screen_h;
- ::ShowWindow(g_hwnd_status, SW_HIDE);
-#ifdef _WIN32_WCE
- ::ShowWindow(g_hwnd_menu, SW_HIDE);
-#endif
-
-#ifdef _WIN32_WCE
- SHFullScreen(g_hwnd, SHFS_HIDESIPBUTTON);
-#endif
- ::MoveWindow(g_hwnd, 0, 0, screen_w, screen_h, 1);
- ::MoveWindow(g_hwnd_disp, 0, 0, screen_w, screen_h, 1);
- SetForegroundWindow(g_hwnd_disp);
- } else {
-#ifdef _WIN32_WCE
- ::ShowWindow(g_hwnd_menu, SW_SHOW);
-#endif
- if (show_status) {
- ::MoveWindow(g_hwnd, 0, 0, disp_w, disp_h, 1);
- ::ShowWindow(g_hwnd_status, SW_SHOW);
- ::MoveWindow(g_hwnd_status, 0, 0, disp_w, caption_h, 1);
- ::MoveWindow(g_hwnd_disp, 0, caption_h, disp_w, disp_h - caption_h, 1);
- w = disp_w;
- h = disp_h - caption_h*ratio_h;
- } else {
- ::ShowWindow(g_hwnd_status, SW_HIDE);
-// ::MoveWindow(g_hwnd, 0, caption_h, disp_w, disp_h, 1);
- ::MoveWindow(g_hwnd, 0, 0, disp_w, disp_h, 1);
- ::MoveWindow(g_hwnd_disp, 0, 0, disp_w, disp_h, 1);
- w = disp_w;
- h = disp_h;
- }
- }
- if (notif_size && term) gf_term_set_size(term, w, h);
-}
-
-
-void set_backlight_state(Bool disable)
-{
-#ifdef _WIN32_WCE
- HKEY hKey = 0;
- DWORD dwSize;
- DWORD dwValue;
- HANDLE hBL;
- if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("ControlPanel\\Backlight"), 0, 0, &hKey ) != ERROR_SUCCESS) return;
-
- if (disable) {
- dwSize = 4;
- RegQueryValueEx(hKey, _T("BatteryTimeout"), NULL, NULL,(unsigned char*) &prev_batt_bl, &dwSize);
- dwSize = 4;
- RegQueryValueEx(hKey, _T("ACTimeout"), NULL, NULL, (unsigned char*) &prev_ac_bl,&dwSize);
- dwSize = 4;
- dwValue = 0xefff ;
- RegSetValueEx(hKey, _T("BatteryTimeout"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
- dwSize = 4;
- dwValue = 0xefff ;
- RegSetValueEx( hKey, _T("ACTimeout"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
- backlight_off = GF_TRUE;
- } else {
- if (prev_batt_bl) {
- dwSize = 4;
- RegSetValueEx(hKey, _T("BatteryTimeout"), NULL, REG_DWORD, (unsigned char *)&prev_batt_bl, dwSize);
- }
- if (prev_ac_bl) {
- dwSize = 4;
- RegSetValueEx(hKey, _T("ACTimeout"), NULL, REG_DWORD,(unsigned char *)&prev_ac_bl, dwSize);
- }
- backlight_off = GF_FALSE;
- }
- RegCloseKey(hKey);
- hBL = CreateEvent(NULL, FALSE, FALSE, _T("BackLightChangeEvent"));
- if (hBL) {
- SetEvent(hBL);
- CloseHandle(hBL);
- }
-#endif
-}
-
-static Bool do_resume = GF_FALSE;
-static Bool prev_backlight_state;
-void gf_freeze_display(Bool do_gf_freeze)
-{
- if (do_gf_freeze) {
- prev_backlight_state = backlight_off;
- do_resume = GF_FALSE;
- if (0 && is_connected && gf_term_get_option(term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
- do_resume= GF_TRUE;
- gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
- }
- /*gf_freeze display*/
- gf_term_set_option(term, GF_OPT_FREEZE_DISPLAY, 1);
-
- set_backlight_state(GF_FALSE);
- gf_sleep(100);
- } else {
- if (prev_backlight_state) set_backlight_state(GF_TRUE);
- gf_term_set_option(term, GF_OPT_FREEZE_DISPLAY, 0);
-
- if (do_resume) {
- gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
- set_backlight_state(GF_TRUE);
- }
- }
-}
-
-static void show_taskbar(Bool show_it)
-{
-#ifdef _WIN32_WCE
- HWND wnd;
- if (!is_ppc) return;
-
- wnd = GetForegroundWindow();
- wnd = g_hwnd;
- if (show_it) {
- SHFullScreen(wnd, SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR| SHFS_SHOWSIPBUTTON);
- ::ShowWindow(::FindWindow(_T("HHTaskbar"),NULL), SW_SHOWNA);
- } else {
- ::ShowWindow(::FindWindow(_T("HHTaskbar"),NULL), SW_HIDE);
- SHFullScreen(wnd, SHFS_HIDESTARTICON | SHFS_HIDETASKBAR| SHFS_HIDESIPBUTTON);
- }
-#endif
-}
-
-void refresh_recent_files()
-{
-#ifdef _WIN32_WCE
- u32 count = gf_cfg_get_key_count(user.config, "RecentFiles");
-
- HMENU hMenu = (HMENU)SendMessage(g_hwnd_menu, SHCMBM_GETSUBMENU, 0, ID_MENU_FILE);
- /*pos is hardcoded*/
- hMenu = GetSubMenu(hMenu, 2);
-
- while (RemoveMenu(hMenu, 0, MF_BYPOSITION)) {}
-
- for (u32 i=0; i<count; i++) {
- TCHAR txt[100];
- char *name;
- const char *sOpt = gf_cfg_get_key_name(user.config, "RecentFiles", i);
- name = strrchr(sOpt, '\\');
- if (!name) name = strrchr(sOpt, '/');
- if (!name) name = (char *) sOpt;
- else name += 1;
-
- CE_CharToWide(name, (u16 *) txt);
- AppendMenu(hMenu, MF_STRING, IDM_OPEN_FILE1+i, txt);
- }
-#endif
-}
-
-
-void open_file(HWND hwnd)
-{
- Bool res;
- char ext_list[4096];
- strcpy(ext_list, "");
-
- gf_freeze_display(GF_TRUE);
-
- u32 count = gf_cfg_get_key_count(user.config, "MimeTypes");
- for (u32 i=0; i<count; i++) {
- char szKeyList[1000], *sKey;
- const char *sMime = gf_cfg_get_key_name(user.config, "MimeTypes", i);
- const char *opt = gf_cfg_get_key(user.config, "MimeTypes", sMime);
- strcpy(szKeyList, opt+1);
- sKey = strrchr(szKeyList, '\"');
- if (!sKey) continue;
- sKey[0] = 0;
- strcat(ext_list, szKeyList);
- strcat(ext_list, " ");
- }
-#ifdef _WIN32_WCE
- res = gf_file_dialog(g_hinst, hwnd, the_url, ext_list, user.config);
-#else
- res = GF_FALSE;
-#endif
- gf_freeze_display(GF_FALSE);
-
- /*let's go*/
- if (res) do_open_file();
-}
-
-void load_recent_file(u32 idx)
-{
- const char *sOpt = gf_cfg_get_key_name(user.config, "RecentFiles", idx);
- if (sOpt) {
- strcpy(the_url, sOpt);
- do_open_file();
- }
-}
-
-BOOL CALLBACK AboutDialogProc(const HWND hWnd, const UINT Msg, const WPARAM wParam, const LPARAM lParam)
-{
- BOOL ret = TRUE;
- switch (Msg) {
- case WM_INITDIALOG:
- {
- char szText[4096];
- HWND hctl = GetDlgItem(hWnd, IDC_NAMECTRL);
- sprintf(szText, "GPAC/Osmo4\nversion %s", GPAC_FULL_VERSION);
-#ifdef _WIN32_WCE
- TCHAR psz[80];
- ZeroMemory(psz, sizeof(psz));
- SHINITDLGINFO sid;
- ZeroMemory(&sid, sizeof(sid));
- sid.dwMask = SHIDIM_FLAGS;
- sid.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
- sid.hDlg = hWnd;
- SHInitDialog(&sid);
-
- SHMENUBARINFO mbi;
- memset(&mbi, 0, sizeof(SHMENUBARINFO));
- mbi.cbSize = sizeof(SHMENUBARINFO);
- mbi.hwndParent = hWnd;
- mbi.nToolBarId = IDR_ABOUT_MENU;
- mbi.hInstRes = g_hinst;
- mbi.nBmpId = 0;
- mbi.cBmpImages = 0;
- SHCreateMenuBar(&mbi);
-
- u16 swText[4096];
- CE_CharToWide(szText, swText);
-
- SetWindowText(hctl, (LPCWSTR) swText);
-#else
- SetWindowText(hctl, szText);
-#endif
- MoveWindow(hctl, 0, 0, screen_w, 40, 1);
- MoveWindow(hWnd, 0, 0, screen_w, disp_w, 1);
-
- }
- break;
- case WM_COMMAND:
- case WM_CLOSE:
- EndDialog(hWnd, 0);
- break;
- default:
- ret = FALSE;
- }
- return ret;
-}
-void view_about(HWND hwnd)
-{
- gf_freeze_display(GF_TRUE);
-// ::ShowWindow(g_hwnd_mb, SW_HIDE);
- int iResult = DialogBox(g_hinst, MAKEINTRESOURCE(IDD_APPABOUT), hwnd,(DLGPROC)AboutDialogProc);
-// ::ShowWindow(g_hwnd_mb, SW_SHOW);
- gf_freeze_display(GF_FALSE);
-}
-
-void pause_file()
-{
- if (!is_connected) return;
-#ifdef _WIN32_WCE
- TBBUTTONINFO tbbi;
- tbbi.cbSize = sizeof(tbbi);
- tbbi.dwMask = TBIF_TEXT;
-#endif
-
- if (gf_term_get_option(term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
- gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
-#ifdef _WIN32_WCE
- tbbi.pszText = _T("Resume");
-#endif
- } else {
- gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
-#ifdef _WIN32_WCE
- tbbi.pszText = _T("Pause");
-#endif
- }
-#ifdef _WIN32_WCE
- SendMessage(g_hwnd_menu, TB_SETBUTTONINFO, IDM_FILE_PAUSE, (LPARAM)&tbbi);
-#endif
-}
-
-void set_svg_progressive()
-{
- use_svg_prog = (Bool)!use_svg_prog;
- if (use_svg_prog) {
- gf_cfg_set_key(user.config, "SAXLoader", "Progressive", "yes");
- gf_cfg_set_key(user.config, "SAXLoader", "MaxDuration", "30");
- } else {
- gf_cfg_set_key(user.config, "SAXLoader", "MaxDuration", "0");
- gf_cfg_set_key(user.config, "SAXLoader", "Progressive", "no");
- }
-}
-
-void set_gx_mode(u32 mode)
-{
- char *opt;
- switch (mode) {
- case 0:
- opt = "raw";
- break;
- case 1:
- opt = "gx";
- break;
- case 2:
- opt = "gdi";
- break;
- }
- gf_cfg_set_key(user.config, "GAPI", "FBAccess", opt);
-
-// gf_term_del(term);
-// term = gf_term_new(&user);
-// gf_term_disconnect(term);
-// gf_term_connect(term, the_url);
- do_layout(GF_TRUE);
-}
-
-void do_copy_paste()
-{
- if (!OpenClipboard(g_hwnd)) return;
-
- /*or we are editing text and clipboard is not empty*/
- if (IsClipboardFormatAvailable(CF_TEXT) && (gf_term_paste_text(term, NULL, GF_TRUE)==GF_OK)) {
- HGLOBAL hglbCopy = GetClipboardData(CF_TEXT);
- if (hglbCopy) {
-#ifdef _WIN32_WCE
- char szString[1024];
- LPCTSTR paste_string = (LPCTSTR) GlobalLock(hglbCopy);
- CE_WideToChar((u16 *) paste_string, szString);
- gf_term_paste_text(term, szString, GF_FALSE);
-#else
- char *szString = (char *)GlobalLock(hglbCopy);
- gf_term_paste_text(term, szString, GF_FALSE);
-#endif
- GlobalUnlock(hglbCopy);
- }
- }
- /*we have something to copy*/
- else if (gf_term_get_text_selection(term, GF_TRUE)!=NULL) {
- u32 len;
- const char *text = gf_term_get_text_selection(term, GF_FALSE);
- if (text && strlen(text)) {
- EmptyClipboard();
- len = strlen(text);
-
-#ifdef _WIN32_WCE
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(u16));
- LPCTSTR new_string = (LPCTSTR) GlobalLock(hglbCopy);
- CE_CharToWide((char*)text, (u16*)new_string);
-#else
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(u8));
- char *new_string = (char*) GlobalLock(hglbCopy);
- strcpy(new_string, text);
-#endif
- GlobalUnlock(hglbCopy);
- SetClipboardData(CF_TEXT, hglbCopy);
- }
- }
- CloseClipboard();
-}
-
-static void rewrite_log_tools(u32 tool)
-{
- char *logs;
- if (tool == GF_LOG_ALL) {
- gf_log_set_tool_level(GF_LOG_ALL, log_level);
- } else {
- if (gf_log_tool_level_on(tool, log_level)) {
- gf_log_set_tool_level(tool, GF_LOG_QUIET);
- } else {
- gf_log_set_tool_level(tool, log_level);
- }
- }
- logs = gf_log_get_tools_levels();
- if (logs) {
- gf_cfg_set_key(user.config, "General", "Logs", logs);
- gf_free(logs);
- }
- setup_logs();
-}
-
-BOOL HandleCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
-{
- switch (LOWORD(wParam)) {
- case IDM_FILE_OPEN:
- open_file(hwnd);
- break;
- case IDM_FILE_LOG_RTI:
- log_rti = (Bool)!log_rti;
- setup_logs();
- break;
- case IDM_FILE_PAUSE:
- pause_file();
- break;
- case IDM_VIEW_ABOUT:
- view_about(hwnd);
- break;
- case IDM_VIEW_FS:
- set_full_screen();
- break;
- case IDM_VIEW_STATUS:
- show_status = (Bool)!show_status;
- gf_cfg_set_key(user.config, "General", "ShowStatusBar", show_status ? "yes" : "no");
- do_layout(GF_TRUE);
- break;
- case IDM_VIEW_CPU:
- view_cpu = (Bool)!view_cpu;
- break;
- case IDM_VIEW_FORCEGL:
- force_2d_gl = (Bool)!force_2d_gl;
- gf_cfg_set_key(user.config, "Compositor", "ForceOpenGL", force_2d_gl ? "yes" : "no");
- gf_term_set_option(term, GF_OPT_USE_OPENGL, force_2d_gl);
- break;
- case IDM_NAV_RESET:
- gf_term_set_option(term, GF_OPT_NAVIGATION_TYPE, 0);
- break;
- case IDM_NAV_NONE:
- gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE);
- break;
- case IDM_NAV_SLIDE:
- gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE);
- break;
- case IDM_NAV_WALK:
- gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_WALK);
- break;
- case IDM_NAV_FLY:
- gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_FLY);
- break;
- case IDM_NAV_EXAMINE:
- gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_EXAMINE);
- break;
- case IDM_NAV_HEADLIGHT:
- gf_term_set_option(term, GF_OPT_HEADLIGHT, !gf_term_get_option(term, GF_OPT_HEADLIGHT) );
- break;
- case IDM_NAV_COL_NONE:
- gf_term_set_option(term, GF_OPT_COLLISION, GF_COLLISION_NONE);
- break;
- case IDM_NAV_COL_REG:
- gf_term_set_option(term, GF_OPT_COLLISION, GF_COLLISION_NORMAL);
- break;
- case IDM_NAV_COL_DISP:
- gf_term_set_option(term, GF_OPT_COLLISION, GF_COLLISION_DISPLACEMENT);
- break;
- case IDM_NAV_GRAVITY:
- gf_term_set_option(term, GF_OPT_GRAVITY, !gf_term_get_option(term, GF_OPT_GRAVITY));
- break;
-
- case IDM_VIEW_AR_NONE:
- gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
- break;
- case IDM_VIEW_AR_FILL:
- gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN);
- break;
- case IDM_VIEW_AR_4_3:
- gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3);
- break;
- case IDM_VIEW_AR_16_9:
- gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);
- break;
-
- case IDM_VIEW_LOW_RATE:
- use_low_fps = (Bool)!use_low_fps;
- gf_term_set_simulation_frame_rate(term, use_low_fps ? 15.0 : 30.0);
- break;
- case ID_VIDEO_DIRECTDRAW:
- {
- u32 drend = (gf_term_get_option(term, GF_OPT_DRAW_MODE)==GF_DRAW_MODE_IMMEDIATE) ? GF_DRAW_MODE_DEFER : GF_DRAW_MODE_IMMEDIATE;
- gf_term_set_option(term, GF_OPT_DRAW_MODE, drend);
- gf_cfg_set_key(user.config, "Compositor", "DrawMode", drend ? "immediate" : "defer");
- }
- break;
-
- case ID_FILE_CUT_PASTE:
- do_copy_paste();
- break;
-
- case IDM_OPEN_FILE1:
- case IDM_OPEN_FILE2:
- case IDM_OPEN_FILE3:
- case IDM_OPEN_FILE4:
- case IDM_OPEN_FILE5:
- case IDM_OPEN_FILE6:
- case IDM_OPEN_FILE7:
- case IDM_OPEN_FILE8:
- case IDM_OPEN_FILE9:
- case IDM_OPEN_FILE10:
- load_recent_file(LOWORD(wParam) - IDM_OPEN_FILE1);
- break;
-
- case IDS_CAP_DISABLE_PLAYLIST:
- playlist_navigation_on = (Bool)!playlist_navigation_on;
- break;
- case IDM_VIEW_SVG_LOAD:
- set_svg_progressive();
- break;
- case ID_VIDEO_DIRECTFB:
- set_gx_mode(0);
- break;
- case ID_VIDEO_GAPI:
- set_gx_mode(1);
- break;
- case ID_VIDEO_GDI:
- set_gx_mode(2);
- break;
-
- case ID_LOGLEVEL_NONE:
- log_level = GF_LOG_QUIET;
- rewrite_log_tools(GF_LOG_ALL);
- break;
- case ID_LOGLEVEL_ERROR:
- log_level = GF_LOG_ERROR;
- rewrite_log_tools(GF_LOG_ALL);
- break;
- case ID_LOGLEVEL_WARNING:
- log_level = GF_LOG_WARNING;
- rewrite_log_tools(GF_LOG_ALL);
- break;
- case ID_LOGLEVEL_INFO:
- log_level = GF_LOG_INFO;
- rewrite_log_tools(GF_LOG_ALL);
- break;
- case ID_LOGLEVEL_DEBUG:
- log_level = GF_LOG_DEBUG;
- rewrite_log_tools(GF_LOG_ALL);
- break;
- case ID_TOOLS_CORE:
- rewrite_log_tools(GF_LOG_CORE);
- break;
- case ID_TOOLS_CODING:
- rewrite_log_tools(GF_LOG_CODING);
- break;
- case ID_TOOLS_CONTAINER:
- rewrite_log_tools(GF_LOG_CONTAINER);
- break;
- case ID_TOOLS_NETWORK:
- rewrite_log_tools(GF_LOG_NETWORK);
- break;
- case ID_TOOLS_RTP:
- rewrite_log_tools(GF_LOG_RTP);
- break;
- case ID_TOOLS_SCRIPT:
- rewrite_log_tools(GF_LOG_SCRIPT);
- break;
- case ID_TOOLS_CODEC:
- rewrite_log_tools(GF_LOG_CODEC);
- break;
- case ID_TOOLS_PARSER:
- rewrite_log_tools(GF_LOG_PARSER);
- break;
- case ID_TOOLS_MEDIA:
- rewrite_log_tools(GF_LOG_MEDIA);
- break;
- case ID_TOOLS_SCENE:
- rewrite_log_tools(GF_LOG_SCENE);
- break;
- case ID_TOOLS_INTERACT:
- rewrite_log_tools(GF_LOG_INTERACT);
- break;
- case ID_TOOLS_COMPOSE:
- rewrite_log_tools(GF_LOG_COMPOSE);
- break;
- case ID_TOOLS_MMIO:
- rewrite_log_tools(GF_LOG_MMIO);
- break;
- case ID_TOOLS_RTI:
- rewrite_log_tools(GF_LOG_RTI);
- break;
- case ID_TOOLS_ALL:
- rewrite_log_tools(GF_LOG_ALL);
- break;
- case ID_TOOLS_NONE:
- log_level = GF_LOG_QUIET;
- rewrite_log_tools(GF_LOG_ALL);
- break;
- case ID_LOGS_RESET:
- if (log_file) {
- gf_fclose(log_file);
- log_file = NULL;
- }
- {
- const char *filename = gf_cfg_get_key(user.config, "General", "LogFile");
- if (filename) gf_delete_file(filename);
- }
- setup_logs();
- break;
-
- case IDM_ITEM_QUIT:
- DestroyWindow(hwnd);
- return FALSE;
- }
- return TRUE;
-}
-
-static BOOL OnMenuPopup(const HWND hWnd, const WPARAM wParam)
-{
- char *opt;
- u32 type;
- CheckMenuItem((HMENU)wParam, IDM_VIEW_STATUS, MF_BYCOMMAND| (show_status ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_VIEW_FORCEGL, MF_BYCOMMAND| (force_2d_gl ? MF_CHECKED : MF_UNCHECKED) );
- EnableMenuItem((HMENU)wParam, IDM_VIEW_CPU, MF_BYCOMMAND| (show_status ? MF_ENABLED : MF_GRAYED) );
- if (show_status) CheckMenuItem((HMENU)wParam, IDM_VIEW_CPU, MF_BYCOMMAND| (view_cpu ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_VIEW_LOW_RATE, MF_BYCOMMAND| (use_low_fps ? MF_CHECKED : MF_UNCHECKED) );
-
- EnableMenuItem((HMENU)wParam, ID_VIDEO_DIRECTDRAW, MF_BYCOMMAND| (!force_2d_gl ? MF_ENABLED : MF_GRAYED) );
- CheckMenuItem((HMENU)wParam, ID_VIDEO_DIRECTDRAW, MF_BYCOMMAND| (!force_2d_gl && gf_term_get_option(term, GF_OPT_DRAW_MODE) ? MF_CHECKED : MF_UNCHECKED) );
-
- CheckMenuItem((HMENU)wParam, IDM_VIEW_SVG_LOAD, MF_BYCOMMAND| (use_svg_prog ? MF_CHECKED : MF_UNCHECKED) );
-
- opt = (char *)gf_cfg_get_key(user.config, "GAPI", "FBAccess");
- if (!opt) opt = "raw";
- CheckMenuItem((HMENU)wParam, ID_VIDEO_DIRECTFB, MF_BYCOMMAND| ( (!strcmp(opt,"raw")) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, ID_VIDEO_GAPI, MF_BYCOMMAND| ( (!strcmp(opt,"gx")) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, ID_VIDEO_GDI, MF_BYCOMMAND| ( (!strcmp(opt,"gdi")) ? MF_CHECKED : MF_UNCHECKED) );
-
-
- type = gf_term_get_option(term, GF_OPT_ASPECT_RATIO);
- CheckMenuItem((HMENU)wParam, IDS_CAP_DISABLE_PLAYLIST, MF_BYCOMMAND| (!playlist_navigation_on ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_VIEW_AR_NONE, MF_BYCOMMAND| (type==GF_ASPECT_RATIO_KEEP) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem((HMENU)wParam, IDM_VIEW_AR_FILL, MF_BYCOMMAND| (type==GF_ASPECT_RATIO_FILL_SCREEN) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem((HMENU)wParam, IDM_VIEW_AR_4_3, MF_BYCOMMAND| (type==GF_ASPECT_RATIO_4_3) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem((HMENU)wParam, IDM_VIEW_AR_16_9, MF_BYCOMMAND| (type==GF_ASPECT_RATIO_16_9) ? MF_CHECKED : MF_UNCHECKED);
-
- EnableMenuItem((HMENU)wParam, IDM_FILE_PAUSE, MF_BYCOMMAND| (is_connected ? MF_ENABLED : MF_GRAYED) );
-
- if (/*we have something to copy*/
- (gf_term_get_text_selection(term, GF_TRUE)!=NULL)
- /*or we are editing text and clipboard is not empty*/
- || (IsClipboardFormatAvailable(CF_TEXT) && (gf_term_paste_text(term, NULL, GF_TRUE)==GF_OK))
- ) {
- EnableMenuItem((HMENU)wParam, ID_FILE_CUT_PASTE, MF_BYCOMMAND| MF_ENABLED);
- } else {
- EnableMenuItem((HMENU)wParam, ID_FILE_CUT_PASTE, MF_BYCOMMAND| MF_GRAYED);
- }
-
- CheckMenuItem((HMENU)wParam, IDM_FILE_LOG_RTI, MF_BYCOMMAND| (log_rti) ? MF_CHECKED : MF_UNCHECKED);
-
- if (!is_connected) type = 0;
- else type = gf_term_get_option(term, GF_OPT_NAVIGATION_TYPE);
- navigation_on = type ? GF_TRUE : GF_FALSE;
-
- EnableMenuItem((HMENU)wParam, IDM_NAV_NONE, MF_BYCOMMAND | (!type ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_SLIDE, MF_BYCOMMAND | (!type ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_RESET, MF_BYCOMMAND | (!type ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_WALK, MF_BYCOMMAND | ( (type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_FLY, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_EXAMINE, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_COL_NONE, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_COL_REG, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_COL_DISP, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_GRAVITY, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
- EnableMenuItem((HMENU)wParam, IDM_NAV_HEADLIGHT, MF_BYCOMMAND | ( (type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-
- if (type) {
- u32 mode = gf_term_get_option(term, GF_OPT_NAVIGATION);
- navigation_on = (mode==GF_NAVIGATE_NONE) ? GF_FALSE : GF_TRUE;
- CheckMenuItem((HMENU)wParam, IDM_NAV_NONE, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_NONE) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_NAV_SLIDE, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_SLIDE) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_NAV_WALK, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_WALK) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_NAV_FLY, MF_BYCOMMAND | ((mode==GF_NAVIGATE_FLY) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_NAV_EXAMINE, MF_BYCOMMAND | ((mode==GF_NAVIGATE_EXAMINE) ? MF_CHECKED : MF_UNCHECKED) );
-
- if (type==GF_NAVIGATE_TYPE_3D) {
- CheckMenuItem((HMENU)wParam, IDM_NAV_HEADLIGHT, MF_BYCOMMAND | ( gf_term_get_option(term, GF_OPT_HEADLIGHT) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_NAV_GRAVITY, MF_BYCOMMAND | ( gf_term_get_option(term, GF_OPT_GRAVITY) ? MF_CHECKED : MF_UNCHECKED) );
- type = gf_term_get_option(term, GF_OPT_COLLISION);
- CheckMenuItem((HMENU)wParam, IDM_NAV_COL_NONE, MF_BYCOMMAND | ( (type==GF_COLLISION_NONE) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_NAV_COL_REG, MF_BYCOMMAND | ( (type==GF_COLLISION_NORMAL) ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, IDM_NAV_COL_DISP, MF_BYCOMMAND | ( (type==GF_COLLISION_DISPLACEMENT) ? MF_CHECKED : MF_UNCHECKED) );
- }
- }
-
- opt = (char *) gf_cfg_get_key(user.config, "General", "Logs");
- CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_NONE, MF_BYCOMMAND | ( strstr(opt, "quiet") ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_ERROR, MF_BYCOMMAND | ( strstr(opt, "error") ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_WARNING, MF_BYCOMMAND | ( strstr(opt, "warning") ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_INFO, MF_BYCOMMAND | ( strstr(opt, "info") ? MF_CHECKED : MF_UNCHECKED) );
- CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_DEBUG, MF_BYCOMMAND | ( strstr(opt, "debug") ? MF_CHECKED : MF_UNCHECKED) );
-
-#define CHECK_TOOL(_ID, _name) CheckMenuItem((HMENU)wParam, _ID, MF_BYCOMMAND | ( ((strstr(opt, _name) != NULL) || !strcmp(opt, "all")) ? MF_CHECKED : MF_UNCHECKED) );
- opt = (char *) gf_cfg_get_key(user.config, "General", "Logs");
- CHECK_TOOL(ID_TOOLS_CORE, "core");
- CHECK_TOOL(ID_TOOLS_CODING, "coding");
- CHECK_TOOL(ID_TOOLS_CONTAINER, "container");
- CHECK_TOOL(ID_TOOLS_NETWORK, "network");
- CHECK_TOOL(ID_TOOLS_RTP, "rtp");
- CHECK_TOOL(ID_TOOLS_SYNC, "sync");
- CHECK_TOOL(ID_TOOLS_SCRIPT, "script");
- CHECK_TOOL(ID_TOOLS_CODEC, "codec");
- CHECK_TOOL(ID_TOOLS_PARSER, "parser");
- CHECK_TOOL(ID_TOOLS_MEDIA, "media");
- CHECK_TOOL(ID_TOOLS_SCENE, "scene");
- CHECK_TOOL(ID_TOOLS_INTERACT, "interact");
- CHECK_TOOL(ID_TOOLS_COMPOSE, "compose");
- CHECK_TOOL(ID_TOOLS_MMIO, "mmio");
- CHECK_TOOL(ID_TOOLS_RTI, "rti");
-
-
- return TRUE;
-}
-
-
-BOOL CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_CREATE:
- {
-#ifdef _WIN32_WCE
- SHMENUBARINFO mbi;
- memset(&mbi, 0, sizeof(SHMENUBARINFO));
- mbi.cbSize = sizeof(SHMENUBARINFO);
- mbi.hwndParent = hwnd;
- mbi.hInstRes = g_hinst;
- mbi.nBmpId = 0;
- mbi.cBmpImages = 0;
-
- mbi.nToolBarId = IDM_MAIN_MENU;
- SHCreateMenuBar(&mbi);
- g_hwnd_menu = mbi.hwndMB;
-#else
- g_hwnd_menu = NULL;
-#endif
-
- g_hwnd_status = CreateWindow(TEXT("STATIC"), TEXT("Status"), WS_CHILD|WS_VISIBLE|SS_LEFT, 0, 0, disp_w, caption_h, hwnd, NULL, g_hinst, NULL);
-
- do_layout(GF_TRUE);
- }
- break;
-
- case WM_COMMAND:
- if (HandleCommand(hwnd, wParam, lParam))
- return DefWindowProc(hwnd, msg, wParam, lParam);
- break;
- case WM_TIMER:
- if (wParam==STATE_TIMER_ID) update_state_info();
-#ifdef TERM_NOT_THREADED
- else gf_term_process_step(term);
-#endif
- break;
- case WM_HOTKEY:
- break;
- case WM_KEYDOWN:
- if (playlist_navigation_on && !navigation_on) {
- if (wParam==VK_LEFT) {
- switch_playlist(GF_TRUE);
- break;
- }
- else if (wParam==VK_RIGHT) {
- switch_playlist(GF_FALSE);
- break;
- }
- }
- /*fall through*/
- case WM_SYSKEYDOWN:
- case WM_SYSKEYUP:
- case WM_KEYUP:
- case WM_CHAR:
- case WM_MOUSEMOVE:
- case WM_LBUTTONDOWN:
- case WM_LBUTTONDBLCLK:
- case WM_LBUTTONUP:
- ::SendMessage(g_hwnd_disp, msg, wParam, lParam);
- return 0;
- case WM_INITMENUPOPUP:
- OnMenuPopup(hwnd, wParam);
- break;
- case WM_CLOSE:
- DestroyWindow(hwnd);
- break;
- case WM_SETFOCUS:
- gf_freeze_display(GF_FALSE);
- break;
- case WM_KILLFOCUS:
- if ((HWND) wParam==g_hwnd) {
- gf_freeze_display(GF_TRUE);
- }
- break;
- case WM_ACTIVATE:
- if (WA_INACTIVE != LOWORD(wParam)) {
- if ((HWND) lParam == g_hwnd) {
- gf_freeze_display(GF_FALSE);
- SetFocus(hwnd);
- }
- } else {
- if ((HWND) lParam == g_hwnd_disp) {
- gf_freeze_display(GF_TRUE);
- }
- }
- break;
- case WM_LOADTERM:
- if (!LoadTerminal()) {
- MessageBox(hwnd, _T("Cannot load GPAC"), _T("Error"), MB_OK);
- PostQuitMessage(0);
- }
- break;
- case WM_DESTROY:
- PostQuitMessage(0);
- break;
- default:
- return DefWindowProc(hwnd, msg, wParam, lParam);
- }
-
- return 0;
-}
-
-BOOL InitInstance (int CmdShow)
-{
- WNDCLASS wc;
-
- wc.style = 0;
- wc.lpfnWndProc = (WNDPROC) MainWndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = g_hinst;
- wc.hIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON));
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
- wc.lpszMenuName = 0;
- wc.lpszClassName = _T("Osmophone");
- RegisterClass(&wc);
-
-#ifdef _WIN32_WCE
- int style = WS_VISIBLE;
-#else
- int style = WS_POPUP;
-#endif
-
- g_hwnd = CreateWindow(_T("Osmophone"), _T("Osmophone"),
- style,
- 0, caption_h, disp_w, disp_h,
- NULL, NULL, g_hinst, NULL);
-
- if (!g_hwnd) return FALSE;
-
- ShowWindow(g_hwnd, CmdShow);
-
- refresh_recent_files();
-
- ::SetTimer(g_hwnd, STATE_TIMER_ID, STATE_TIMER_DUR, NULL);
- do_layout(GF_TRUE);
-
- set_status("Loading Terminal");
- PostMessage(g_hwnd, WM_LOADTERM, 0, 0);
- set_status("Ready");
- return TRUE;
-}
-
-#ifndef GETRAWFRAMEBUFFER
-#define GETRAWFRAMEBUFFER 0x00020001
-typedef struct _RawFrameBufferInfo
-{
- WORD wFormat;
- WORD wBPP;
- VOID *pFramePointer;
- int cxStride;
- int cyStride;
- int cxPixels;
- int cyPixels;
-} RawFrameBufferInfo;
-
-#define FORMAT_565 1
-#define FORMAT_555 2
-#define FORMAT_OTHER 3
-#endif
-
-int WINAPI WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
-#ifdef _WIN32_WCE
- LPWSTR lpCmdLine,
-#else
- LPSTR lpCmdLine,
-#endif
- int nShowCmd
- ) {
- MSG msg;
-
- HWND hwndOld = NULL;
- const char *str;
- Bool initial_launch = GF_FALSE;
-
- if (hwndOld = FindWindow(_T("Osmophone"), NULL))
- {
- SetForegroundWindow(hwndOld);
- return 0;
- }
-
- memset(&user, 0, sizeof(GF_User));
- term = NULL;
-
- g_hinst = hInstance;
-
- screen_w = GetSystemMetrics(SM_CXSCREEN);
- screen_h = GetSystemMetrics(SM_CYSCREEN);
-
- /*are we in low res or high res*/
- RawFrameBufferInfo Info;
- HDC DC = GetDC(NULL);
- ExtEscape(DC, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char*)&Info);
- ReleaseDC(NULL,DC);
- if (Info.pFramePointer) {
- recompute_res(Info.cxPixels, Info.cyPixels);
- } else {
- recompute_res(screen_w, screen_h);
- }
-
-
-
-#ifdef _WIN32_WCE
- TCHAR szBuf[MAX_PATH];
- SystemParametersInfo(SPI_GETPLATFORMTYPE, MAX_PATH, szBuf, 0);
- if (! lstrcmp(szBuf, __TEXT("PocketPC"))) is_ppc = GF_TRUE;
- else if (! lstrcmp(szBuf, __TEXT("Palm PC2"))) is_ppc = GF_TRUE;
-#endif
-
-
- user.config = gf_cfg_init(NULL, &initial_launch);
- if (!user.config) {
- MessageBox(NULL, _T("Couldn't locate GPAC config file"), _T("Fatal Error"), MB_OK);
- return 0;
- }
-
- str = gf_cfg_get_key(user.config, "Compositor", "ScreenWidth");
- if (str) screen_w = atoi(str);
- str = gf_cfg_get_key(user.config, "Compositor", "ScreenHeight");
- if (str) screen_h = atoi(str);
- disp_w = screen_w;
-#ifdef _WIN32_WCE
- disp_h = screen_h - menu_h /*- caption_h*/;
-#else
- disp_h = screen_h;
-#endif
-
- gf_sys_init(GF_MemTrackerNone);
- user.modules = gf_modules_new(NULL, user.config);
- if (!gf_modules_get_count(user.modules)) {
- MessageBox(GetForegroundWindow(), _T("No modules found"), _T("GPAC Init Error"), MB_OK);
- gf_modules_del(user.modules);
- gf_cfg_del(user.config);
- memset(&user, 0, sizeof(GF_User));
- gf_sys_close();
- return 0;
- }
-
- /*first launch, register all files ext*/
- if (initial_launch) {
- /*FFMPEG registration - FFMPEG DLLs compiled with CEGCC cannot be loaded directly under WM 6.1
- cf http://cegcc.sourceforge.net/docs/faq.html#DllDoesNotWorkWithWindowsMobile6.1
- */
- HKEY hKey = NULL;
- DWORD dwSize;
- DWORD dwValue;
- RegCreateKeyEx(HKEY_LOCAL_MACHINE, _T("System\\Loader\\LoadModuleLow"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
- dwSize = 4;
- dwValue = 1;
- LONG res = RegSetValueEx(hKey, _T("avcodec-52.dll"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
- res = RegSetValueEx(hKey, _T("avformat-52.dll"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
- res = RegSetValueEx(hKey, _T("avutil-50.dll"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
- res = RegSetValueEx(hKey, _T("swscale-0.dll"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
- RegCloseKey(hKey);
-
- u32 i;
- for (i=0; i<gf_modules_get_count(user.modules); i++) {
- GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(user.modules, i, GF_NET_CLIENT_INTERFACE);
- if (!ifce) continue;
- if (ifce) {
- ifce->CanHandleURL(ifce, "test.test");
- gf_modules_close_interface((GF_BaseInterface *)ifce);
- }
- }
- MessageBox(NULL, _T("Thank you for installing GPAC"), _T("Initial setup done"), MB_OK);
- }
-
- str = gf_cfg_get_key(user.config, "General", "Loop");
- loop = (!str || !stricmp(str, "yes")) ? GF_TRUE : GF_FALSE;
-
- str = gf_cfg_get_key(user.config, "SAXLoader", "Progressive");
- use_svg_prog = (str && !strcmp(str, "yes")) ? GF_TRUE : GF_FALSE;
-
- str = gf_cfg_get_key(user.config, "General", "RTIRefreshPeriod");
- if (str) {
- rti_update_time_ms = atoi(str);
- } else {
- gf_cfg_set_key(user.config, "General", "RTIRefreshPeriod", "200");
- }
-
- str = gf_cfg_get_key(user.config, "General", "ShowStatusBar");
- show_status = (str && !strcmp(str, "yes")) ? GF_TRUE : GF_FALSE;
-
-
-#ifdef _WIN32_WCE
- if (is_ppc) GXOpenInput();
-#endif
-
- if (InitInstance(nShowCmd)) {
- SetForegroundWindow(g_hwnd);
- show_taskbar(GF_FALSE);
-
- force_2d_gl = (Bool)gf_term_get_option(term, GF_OPT_USE_OPENGL);
-
- while (GetMessage(&msg, NULL, 0,0) == TRUE) {
- TranslateMessage (&msg);
- DispatchMessage (&msg);
-
- if (playlist_act) {
- switch_playlist((Bool)(playlist_act-1));
- playlist_act = 0;
- }
- }
- show_taskbar(GF_TRUE);
- }
-#ifdef _WIN32_WCE
- if (is_ppc) GXCloseInput();
-#endif
-
- /*and destroy*/
- if (term) gf_term_del(term);
- if (user.modules) gf_modules_del(user.modules);
- if (user.config) gf_cfg_del(user.config);
-
- if (backlight_off) set_backlight_state(GF_FALSE);
-
- gf_sys_close();
- if (log_file) gf_fclose(log_file);
- return 0;
-}
+++ /dev/null
-#ifndef __NEWRES_H__
-#define __NEWRES_H__
-
-#if defined(_WIN32_WCE) && !defined(UNDER_CE)
-#define UNDER_CE _WIN32_WCE
-#endif
-
-#if defined(_WIN32_WCE)
-#if !defined(WCEOLE_ENABLE_DIALOGEX)
-#define DIALOGEX DIALOG DISCARDABLE
-#endif
-#include <commctrl.h>
-#define SHMENUBAR RCDATA
-#if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300)
-#include <aygshell.h>
-#define AFXCE_IDR_SCRATCH_SHMENU 28700
-#else
-#define I_IMAGENONE (-2)
-#define NOMENU 0xFFFF
-#define IDS_SHNEW 1
-
-#define IDM_SHAREDNEW 10
-#define IDM_SHAREDNEWDEFAULT 11
-#endif // _WIN32_WCE_PSPC
-#define AFXCE_IDD_SAVEMODIFIEDDLG 28701
-#endif // _WIN32_WCE
-
-#ifdef RC_INVOKED
-#ifndef _INC_WINDOWS
-#define _INC_WINDOWS
-#include "winuser.h" // extract from windows header
-#include "winver.h"
-#endif
-#endif
-
-#ifdef IDC_STATIC
-#undef IDC_STATIC
-#endif
-#define IDC_STATIC (-1)
-
-#endif //__NEWRES_H__
+++ /dev/null
-#include <windows.h>
-
-#ifdef _WIN32_WCE
-
-#include <aygshell.h>
-
-#include <gpac/config_file.h>
-#include "resource.h"
-
-static HINSTANCE g_hInst = NULL;
-static HMENU g_hMenuView;
-static HWND g_hWndMenuBar;
-static HWND hDirTxt;
-static HWND the_wnd;
-static HWND hList;
-static TCHAR w_current_dir[GF_MAX_PATH] = _T("\\");
-static u8 current_dir[GF_MAX_PATH] = "\\";
-static const char *extension_list = NULL;
-static char *out_url = NULL;
-Bool bViewUnknownTypes = GF_FALSE;
-Bool playlist_mode = GF_FALSE;
-GF_Config *cfg;
-
-
-static void refresh_menu_states()
-{
- if (playlist_mode) {
- EnableMenuItem(g_hMenuView, IDM_OF_PL_UP, MF_BYCOMMAND|MF_ENABLED);
- EnableMenuItem(g_hMenuView, IDM_OF_PL_DOWN, MF_BYCOMMAND|MF_ENABLED );
- } else {
- EnableMenuItem(g_hMenuView, IDM_OF_VIEW_ALL, MF_BYCOMMAND| (extension_list ? MF_ENABLED : MF_GRAYED) );
- CheckMenuItem(g_hMenuView, IDM_OF_VIEW_ALL, MF_BYCOMMAND| (bViewUnknownTypes ? MF_CHECKED : MF_UNCHECKED) );
- }
- CheckMenuItem(g_hMenuView, IDM_OF_PLAYLIST, MF_BYCOMMAND| (playlist_mode ? MF_CHECKED : MF_UNCHECKED) );
-}
-
-static void switch_menu_pl()
-{
- DeleteMenu(g_hMenuView, IDM_OF_VIEW_ALL, MF_BYCOMMAND);
- DeleteMenu(g_hMenuView, IDM_OF_PL_UP, MF_BYCOMMAND);
- DeleteMenu(g_hMenuView, IDM_OF_PL_DOWN, MF_BYCOMMAND);
- DeleteMenu(g_hMenuView, IDM_OF_PL_CLEAR, MF_BYCOMMAND);
-
- if (playlist_mode) {
- InsertMenu(g_hMenuView, 0, MF_BYPOSITION, IDM_OF_PL_CLEAR, _T("Clear"));
- InsertMenu(g_hMenuView, 0, MF_BYPOSITION, IDM_OF_PL_DOWN, _T("Move Down") );
- InsertMenu(g_hMenuView, 0, MF_BYPOSITION, IDM_OF_PL_UP, _T("Move Up") );
- } else {
- InsertMenu(g_hMenuView, 0, MF_BYPOSITION, IDM_OF_VIEW_ALL, _T("All Unknown Files") );
- }
- TBBUTTONINFO tbbi;
- tbbi.cbSize = sizeof(tbbi);
- tbbi.dwMask = TBIF_TEXT;
- tbbi.pszText = playlist_mode ? _T("Remove") : _T("Add");
- SendMessage(g_hWndMenuBar, TB_SETBUTTONINFO, IDM_OF_PL_ACT, (LPARAM)&tbbi);
- refresh_menu_states();
-}
-
-
-Bool enum_dirs(void *cbk, char *name, char *path, GF_FileEnumInfo *file_info)
-{
- TCHAR w_name[GF_MAX_PATH], w_str_name[GF_MAX_PATH];
-
- CE_CharToWide(name, (u16 *) w_name);
- wcscpy(w_str_name, _T("+ "));
- wcscat(w_str_name, w_name);
- int iRes = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) w_str_name);
- SendMessage(hList, LB_SETITEMDATA, iRes, (LPARAM) 1);
- return GF_FALSE;
-}
-
-Bool enum_files(void *cbk, char *name, char *path, GF_FileEnumInfo *file_info)
-{
- TCHAR w_name[GF_MAX_PATH];
-
- if (!bViewUnknownTypes && extension_list) {
- char *ext = strrchr(name, '.');
- if (!ext || !strstr(extension_list, ext+1)) return GF_FALSE;
- }
- CE_CharToWide(name, (u16 *) w_name);
- SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) w_name);
- return GF_FALSE;
-}
-
-
-void set_directory(TCHAR *dir)
-{
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
-
- CE_WideToChar((u16 *) dir, (char *) current_dir);
- wcscpy(w_current_dir, dir);
- SetWindowText(hDirTxt, w_current_dir);
-
- if (strcmp((const char *) current_dir, "\\")) {
- int iRes = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) _T("+ ..") );
- SendMessage(hList, LB_SETITEMDATA, iRes, (LPARAM) 1);
- }
-
- /*enum directories*/
- gf_enum_directory((const char *) current_dir, GF_TRUE, enum_dirs, NULL, NULL);
- /*enum files*/
- gf_enum_directory((char *) current_dir, GF_FALSE, enum_files, NULL, NULL);
- SendMessage(hList, LB_SETCURSEL, 0, 0);
- SetFocus(hList);
-}
-
-
-
-void refresh_playlist()
-{
- TCHAR w_name[GF_MAX_PATH];
- u32 count, i;
-
- SetWindowText(hDirTxt, _T("Playlist"));
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
-
- count = gf_cfg_get_key_count(cfg, "Playlist");
- for (i=0; i<count; i++) {
- const char *file = gf_cfg_get_key_name(cfg, "Playlist", i);
- char *name = strrchr(file, '\\');
- if (!name) name = strrchr(file, '/');
- CE_CharToWide(name ? name+1 : (char *) file, (u16 *) w_name);
- SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) w_name);
- }
- i = 0;
- const char *ple = gf_cfg_get_key(cfg, "General", "PLEntry");
- i = ple ? atoi(ple) : 0;
- if (i>=count) i=0;
- SendMessage(hList, LB_SETCURSEL, i, 0);
- SetFocus(hList);
-}
-
-void playlist_act(u32 act_type)
-{
- u32 idx, count;
- char entry[MAX_PATH];
- const char *url;
-
- /*reset all*/
- if (act_type == 3) {
- count = gf_cfg_get_key_count(cfg, "Playlist");
- while (count) {
- url = gf_cfg_get_key_name(cfg, "Playlist", 0);
- gf_cfg_set_key(cfg, "Playlist", url, NULL);
- count--;
- }
- refresh_playlist();
- return;
- }
- count = SendMessage(hList, LB_GETSELCOUNT, 0, 0);
- if (!count) return;
- idx = SendMessage(hList, LB_GETCURSEL, 0, 0);
-
- if ((act_type==1) && !idx) return;
- else if ((act_type==2) && (idx+1==count)) return;
-
- url = gf_cfg_get_key_name(cfg, "Playlist", idx);
- if (!url) return;
- strcpy(entry, url);
- /*remove from playlist*/
- gf_cfg_set_key(cfg, "Playlist", url, NULL);
- switch (act_type) {
- /*remove*/
- case 0:
- if (idx+1==count) idx--;
- break;
- /*up*/
- case 1:
- gf_cfg_insert_key(cfg, "Playlist", entry, "", idx-1);
- idx--;
- break;
- /*down*/
- case 2:
- gf_cfg_insert_key(cfg, "Playlist", entry, "", idx+1);
- idx++;
- break;
- }
- refresh_playlist();
- SendMessage(hList, LB_SETCURSEL, idx, 0);
- SetFocus(hList);
-}
-
-Bool add_files(void *cbk, char *name, char *path, GF_FileEnumInfo *file_info)
-{
- if (!bViewUnknownTypes && extension_list) {
- char *ext = strrchr(name, '.');
- if (!ext || !strstr(extension_list, ext+1)) return GF_FALSE;
- }
- gf_cfg_set_key(cfg, "Playlist", path, "");
- return GF_FALSE;
-}
-
-void process_list_change(HWND hWnd, Bool add_to_pl)
-{
- TCHAR sTxt[GF_MAX_PATH];
- if (!SendMessage(hList, LB_GETSELCOUNT, 0, 0)) return;
-
- u32 idx = SendMessage(hList, LB_GETCURSEL, 0, 0);
- SendMessage(hList, LB_GETTEXT, idx, (LPARAM)(LPCTSTR) sTxt);
-
- DWORD param = SendMessage(hList, LB_GETITEMDATA, idx, 0);
- if (param==1) {
- if (!wcscmp(sTxt, _T("+ ..") ) ) {
- if (add_to_pl) return;
- current_dir[strlen((const char *) current_dir)-1] = 0;
- char *b = strrchr((const char *) current_dir, '\\');
- if (b) b[1] = 0;
- else b[0] = '\\';
- CE_CharToWide((char *) current_dir, (u16 *) w_current_dir);
- set_directory(w_current_dir);
- } else {
- if (add_to_pl) {
- char dir[MAX_PATH];
- TCHAR wdir[MAX_PATH];
- wcscpy(wdir, w_current_dir);
- wcscat(wdir, sTxt+2);
- wcscat(wdir, _T("\\"));
- CE_WideToChar((u16 *) wdir, (char *) dir);
- gf_enum_directory(dir, GF_FALSE, add_files, NULL, NULL);
- } else {
- wcscat(w_current_dir, sTxt+2);
- wcscat(w_current_dir, _T("\\"));
- CE_WideToChar((u16 *) w_current_dir, (char *) current_dir);
- set_directory(w_current_dir);
- }
- }
- } else {
- char szTxt[1024];
- CE_WideToChar((u16 *) sTxt, (char *) szTxt);
- strcpy((char *) out_url, (const char *) current_dir);
- strcat(out_url, szTxt);
- if (add_to_pl) {
- gf_cfg_set_key(cfg, "Playlist", out_url, "");
- strcpy(out_url, "");
- } else {
- if (playlist_mode) {
- const char *file;
- char szPLE[20];
- sprintf(szPLE, "%d", idx);
- gf_cfg_set_key(cfg, "General", "PLEntry", szPLE);
- file = gf_cfg_get_key_name(cfg, "Playlist", idx);
- strcpy(out_url, file);
- }
- gf_cfg_set_key(cfg, "General", "LastWorkingDir", (const char *) current_dir);
- EndDialog(hWnd, 1);
- }
- }
-}
-
-BOOL InitFileDialog(const HWND hWnd)
-{
- TCHAR psz[80];
- ZeroMemory(psz, sizeof(psz));
- SHINITDLGINFO sid;
- ZeroMemory(&sid, sizeof(sid));
- sid.dwMask = SHIDIM_FLAGS;
- sid.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
- sid.hDlg = hWnd;
-
- if (FALSE == SHInitDialog(&sid))
- return FALSE;
-
- SHMENUBARINFO mbi;
- ZeroMemory(&mbi, sizeof(SHMENUBARINFO));
- mbi.cbSize = sizeof(SHMENUBARINFO);
- mbi.hwndParent = hWnd;
- mbi.nToolBarId = IDR_MENU_OPEN;
- mbi.hInstRes = g_hInst;
-
- if (FALSE == SHCreateMenuBar(&mbi))
- {
- return FALSE;
- }
- g_hWndMenuBar = mbi.hwndMB;
-
- ShowWindow(g_hWndMenuBar, SW_SHOW);
-
- the_wnd = hWnd;
-
- hDirTxt = GetDlgItem(hWnd, IDC_DIRNAME);
- hList = GetDlgItem(hWnd, IDC_FILELIST);
- g_hMenuView = (HMENU)SendMessage(g_hWndMenuBar, SHCMBM_GETSUBMENU, 0, ID_OF_VIEW);
-
- RECT rc;
- GetClientRect(hWnd, &rc);
- u32 caption_h = GetSystemMetrics(SM_CYCAPTION) - 3;
- MoveWindow(hDirTxt, 0, 0, rc.right - rc.left, caption_h, 1);
- MoveWindow(hList, 0, caption_h, rc.right - rc.left, rc.bottom - rc.top - caption_h, 1);
-
- if (playlist_mode) {
- refresh_playlist();
- } else {
- if (!strcmp((const char *) current_dir, "\\")) {
- char *opt = (char *) gf_cfg_get_key(cfg, "General", "LastWorkingDir");
- if (opt) CE_CharToWide(opt, (u16 *) w_current_dir);
- }
- set_directory(w_current_dir);
- }
- switch_menu_pl();
- return TRUE;
-}
-
-BOOL CALLBACK FileDialogProc(const HWND hWnd, const UINT Msg, const WPARAM wParam, const LPARAM lParam)
-{
- BOOL bProcessedMsg = TRUE;
-
- switch (Msg) {
- case WM_INITDIALOG:
- if (FALSE == InitFileDialog(hWnd))
- EndDialog(hWnd, -1);
- break;
-
- case WM_ACTIVATE:
- if (WA_INACTIVE != LOWORD(wParam)) SetFocus(hWnd);
- break;
-
- case WM_CLOSE:
- EndDialog(hWnd, 0);
- break;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_FILELIST) {
- if (HIWORD(wParam) == LBN_DBLCLK) {
- process_list_change(hWnd, GF_FALSE);
- } else {
- bProcessedMsg = FALSE;
- }
- } else {
- switch (LOWORD(wParam)) {
- case IDOK:
- process_list_change(hWnd, GF_FALSE);
- break;
- case IDCANCEL:
- EndDialog(hWnd, 0);
- break;
- case IDM_OF_VIEW_ALL:
- bViewUnknownTypes = (Bool) !bViewUnknownTypes;
- refresh_menu_states();
- set_directory(w_current_dir);
- break;
- case IDM_OF_PLAYLIST:
- playlist_mode = (Bool) !playlist_mode;
- if (playlist_mode) refresh_playlist();
- else set_directory(w_current_dir);
- switch_menu_pl();
- break;
- case IDM_OF_PL_ACT:
- if (playlist_mode) {
- playlist_act(0);
- } else {
- process_list_change(hWnd, GF_TRUE);
- }
- break;
- case IDM_OF_PL_UP:
- playlist_act(1);
- break;
- case IDM_OF_PL_DOWN:
- playlist_act(2);
- break;
- case IDM_OF_PL_CLEAR:
- playlist_act(3);
- break;
- default:
- bProcessedMsg = FALSE;
- break;
- }
- }
- break;
- case WM_KEYDOWN:
- switch (wParam) {
- case VK_LEFT:
- case '1':
- playlist_act(1);
- break;
- case VK_RIGHT:
- case '2':
- playlist_act(2);
- break;
- default:
- bProcessedMsg = FALSE;
- break;
- }
- break;
-
- default:
- bProcessedMsg = FALSE;
- }
-
- return bProcessedMsg;
-}
-
-Bool gf_file_dialog(HINSTANCE inst, HWND parent, char *url, const char *ext_list, GF_Config *gpac_cfg)
-{
- extension_list = ext_list;
- out_url = url;
- g_hInst = inst;
- cfg = gpac_cfg;
- int iResult = DialogBox(inst, MAKEINTRESOURCE(IDD_FILEDIALOG), parent,(DLGPROC)FileDialogProc);
- if (iResult>0) return GF_TRUE;
- return GF_FALSE;
-}
-
-
-#endif
-
+++ /dev/null
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "newres.h"
-
-#include <gpac/version.h>
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Anglais (États-Unis) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_ICON ICON "../../doc/osmo4.ico"
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""newres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// RCDATA
-//
-
-IDM_MAIN_MENU1 RCDATA
-BEGIN
- 0x0066, 0x0002, 0xfffe, 0x9c53, 0x0004, 0x0018, 0x9c55, 0x0000, 0x0000,
- 0xfffe, 0x9c58, 0x0004, 0x0018, 0x9c59, 0x0000, 0x0001
-END
-
-IDR_ABOUT_MENU RCDATA
-BEGIN
- 0x006b, 0x0001, 0xfffe, 0x9c77, 0x0004, 0x0010, 0x9c6c, 0x0000, 0xffff
-
-END
-
-IDM_MAIN_MENU2 RCDATA
-BEGIN
- 0x006c, 0x0002, 0xfffe, 0x9c83, 0x0004, 0x0018, 0x9c85, 0x0000, 0x0000,
- 0xfffe, 0x9c87, 0x0004, 0x0018, 0x9c89, 0x0000, 0x0001
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDM_MAIN_MENU MENU
-BEGIN
- POPUP "File"
- BEGIN
- MENUITEM "Open", IDM_FILE_OPEN
- MENUITEM "Open URL", IDM_FILE_OPEN_URL
- POPUP "Recent"
- BEGIN
- MENUITEM "FILE 1", IDM_OPEN_FILE1
- MENUITEM "FILE 2", IDM_OPEN_FILE2
- MENUITEM "FILE 3", IDM_OPEN_FILE3
- MENUITEM "FILE 4", IDM_OPEN_FILE4
- MENUITEM "FILE 5", IDM_OPEN_FILE5
- MENUITEM "FILE 6", IDM_OPEN_FILE6
- MENUITEM "FILE 7", IDM_OPEN_FILE7
- MENUITEM "FILE 8 ", IDM_OPEN_FILE8
- MENUITEM "FILE 9", IDM_OPEN_FILE9
- END
- MENUITEM SEPARATOR
- MENUITEM "Pause", IDM_FILE_PAUSE
- MENUITEM "Copy/Paste", ID_FILE_CUT_PASTE
- MENUITEM SEPARATOR
- POPUP "Logs"
- BEGIN
- POPUP "Level"
- BEGIN
- MENUITEM "None", ID_LOGLEVEL_NONE
- MENUITEM "Error", ID_LOGLEVEL_ERROR
- MENUITEM "Warning", ID_LOGLEVEL_WARNING
- MENUITEM "Info", ID_LOGLEVEL_INFO
- MENUITEM "Debug", ID_LOGLEVEL_DEBUG
- END
- POPUP "Tools"
- BEGIN
- MENUITEM "core", ID_TOOLS_CORE
- MENUITEM "coding", ID_TOOLS_CODING
- MENUITEM "container", ID_TOOLS_CONTAINER
- MENUITEM "network", ID_TOOLS_NETWORK
- MENUITEM "rtp", ID_TOOLS_RTP
- MENUITEM "sync", ID_TOOLS_SYNC
- MENUITEM "codec", ID_TOOLS_CODEC
- MENUITEM "parser", ID_TOOLS_PARSER
- MENUITEM "media", ID_TOOLS_MEDIA
- MENUITEM "scene", ID_TOOLS_SCENE
- MENUITEM "script", ID_TOOLS_SCRIPT
- MENUITEM "interact", ID_TOOLS_INTERACT
- MENUITEM "compose", ID_TOOLS_COMPOSE
- MENUITEM "mmio", ID_TOOLS_MMIO
- MENUITEM "rti", ID_TOOLS_RTI
- MENUITEM SEPARATOR
- MENUITEM "none", ID_TOOLS_NONE
- MENUITEM "all", ID_TOOLS_ALL
- END
- MENUITEM "Reset", ID_LOGS_RESET
- MENUITEM "Log CPU", IDM_FILE_LOG_RTI
- END
- MENUITEM SEPARATOR
- MENUITEM "Exit", IDM_ITEM_QUIT
- END
- POPUP "View"
- BEGIN
- POPUP "Navigate"
- BEGIN
- MENUITEM "Reset", IDM_NAV_RESET
- MENUITEM SEPARATOR
- MENUITEM "None", IDM_NAV_NONE
- MENUITEM "Slide", IDM_NAV_SLIDE
- MENUITEM "Walk", IDM_NAV_WALK
- MENUITEM "Fly", IDM_NAV_FLY
- MENUITEM "Examine", IDM_NAV_EXAMINE
- MENUITEM SEPARATOR
- MENUITEM "Headlight", IDM_NAV_HEADLIGHT
- MENUITEM "Gravity", IDM_NAV_GRAVITY
- POPUP "Collision"
- BEGIN
- MENUITEM "Disabled", IDM_NAV_COL_NONE
- MENUITEM "Regular", IDM_NAV_COL_REG
- MENUITEM "Displacement", IDM_NAV_COL_DISP
- END
- END
- MENUITEM SEPARATOR
- MENUITEM "Fullscreen", IDM_VIEW_FS
- POPUP "Info"
- BEGIN
- MENUITEM "Status Bar", IDM_VIEW_STATUS
- MENUITEM "CPU usage", IDM_VIEW_CPU
- END
- MENUITEM SEPARATOR
- POPUP "Video"
- BEGIN
- MENUITEM "Direct FB", ID_VIDEO_DIRECTFB
- MENUITEM "GAPI", ID_VIDEO_GAPI
- MENUITEM "GDI", ID_VIDEO_GDI
- MENUITEM SEPARATOR
- MENUITEM "2D OpenGL", IDM_VIEW_FORCEGL
- MENUITEM "Direct Draw", ID_VIDEO_DIRECTDRAW
- MENUITEM "15.0 FPS", IDM_VIEW_LOW_RATE
- POPUP "Aspect Ratio"
- BEGIN
- MENUITEM "Keep Original", IDM_VIEW_AR_NONE
- MENUITEM "Fill Screen", IDM_VIEW_AR_FILL
- MENUITEM "Ratio 4/3", IDM_VIEW_AR_4_3
- MENUITEM "Ratio 16/9", IDM_VIEW_AR_16_9
- END
- END
- POPUP "Options"
- BEGIN
- MENUITEM "Progressive SVG ", IDM_VIEW_SVG_LOAD
- MENUITEM "Disable Playlist", IDS_CAP_DISABLE_PLAYLIST
- END
- MENUITEM "About", IDM_VIEW_ABOUT
- END
-END
-
-IDR_ABOUT_MENU MENU
-BEGIN
- MENUITEM "OK", IDM_ABOUT_OK
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
- IDS_CLASSNAME "Osmophone"
- IDS_WINDOWNAME "Osmo4"
- IDS_APPNAME "Osmophone.exe"
-END
-
-STRINGTABLE
-BEGIN
- IDS_CAP_QUIT "Exit"
- IDS_CAP_FILE "File"
- IDS_CAP_EXIT "View"
- IDS_CAP_VIEW "View"
-END
-
-STRINGTABLE
-BEGIN
- IDS_CAP_OK "OK"
-END
-
-STRINGTABLE
-BEGIN
- IDS_CAP_NAVIGATE "Navigate"
-END
-
-STRINGTABLE
-BEGIN
- IDS_CAP_OPTION "Options"
- IDS_CAP_MENUITEM40072 "?"
-END
-
-STRINGTABLE
-BEGIN
- IDS_CAP_DISABLE_PLAYLIST "Copy/Paste"
-END
-
-#endif // Anglais (États-Unis) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Français (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-#ifdef _WIN32
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// RCDATA
-//
-
-IDR_MENU_OPEN RCDATA
-BEGIN
- 0x006a, 0x0002, 0xfffe, 0x9c9b, 0x0004, 0x0010, 0x9c9f, 0x0000, 0xffff,
- 0xfffe, 0x9c9a, 0x0004, 0x0018, 0x9c59, 0x0000, 0x0001
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_MENU_OPEN MENU
-BEGIN
- MENUITEM "Add", IDM_OF_PL_ACT
- POPUP "View"
- BEGIN
- MENUITEM "All Unknown Files", IDM_OF_VIEW_ALL
- MENUITEM "Move Up", IDM_OF_PL_UP
- MENUITEM "Move Down", IDM_OF_PL_DOWN
- MENUITEM "Clear", IDM_OF_PL_CLEAR
- MENUITEM SEPARATOR
- MENUITEM "Playlist Mode", IDM_OF_PLAYLIST
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_APPABOUT, DIALOG
- BEGIN
- LEFTMARGIN, 1
- RIGHTMARGIN, 113
- BOTTOMMARGIN, 74
- END
-
- IDD_FILEDIALOG, DIALOG
- BEGIN
- RIGHTMARGIN, 103
- BOTTOMMARGIN, 85
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_APPABOUT DIALOG 0, 0, 114, 77
-STYLE DS_SETFONT | DS_SETFOREGROUND | WS_POPUP | WS_CAPTION
-CAPTION "About Osmophone"
-FONT 8, "System"
-BEGIN
- ICON IDI_ICON,IDC_STATIC,1,0,16,16
- CTEXT "Osmo4/GPAC\n"GPAC_VERSION" ",IDC_NAMECTRL,23,1,65,17
- CTEXT "Copyright (c) 2007 Telecom ParisTech\nAll Rights Reserved\nLicensed under LGPL",IDC_STATIC,2,44,111,33
-END
-
-IDD_FILEDIALOG DIALOG 0, 0, 104, 86
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Select File"
-FONT 8, "System"
-BEGIN
- EDITTEXT IDC_DIRNAME,1,3,100,12,ES_AUTOHSCROLL | ES_READONLY
- LISTBOX IDC_FILELIST,1,18,102,65,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040c04b0"
- BEGIN
- VALUE "CompanyName", "Telecom ParisTech"
- VALUE "FileDescription", "osmophone"
- VALUE "FileVersion", GPAC_VERSION
- VALUE "InternalName", "osmophone"
- VALUE "LegalCopyright", "Copyright © Telecom ParisTech 2008"
- VALUE "OriginalFilename", "osmophone.exe"
- VALUE "ProductName", "Osmo4-GPAC"
- VALUE "ProductVersion", GPAC_VERSION
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x40c, 1200
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
- IDS_CAP_FILE "+"
- IDS_CAP_VIEW "View"
-END
-
-STRINGTABLE
-BEGIN
- IDS_CAP_OK "OK"
-END
-
-STRINGTABLE
-BEGIN
- IDS_CAP_SELECT "File"
-END
-
-STRINGTABLE
-BEGIN
- IDS_CAP_MENUITEM40092 "Add"
- IDS_CAP_ADD "Add"
-END
-
-#endif // Français (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{CAA7EF3E-C7F4-4F8A-9E17-9A06DEF9E717}</ProjectGuid>\r
- <RootNamespace>osmophone</RootNamespace>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Midl>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TargetEnvironment>Win32</TargetEnvironment>\r
- <TypeLibraryName>$(Platform)\$(Configuration)/osmophone.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE</PreprocessorDefinitions>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\obj\$(Platform)\$(Configuration)\osmophone/</AssemblerListingLocation>\r
- <ObjectFileName>.\obj\$(Platform)\$(Configuration)\osmophone/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\obj\$(Platform)\$(Configuration)\osmophone/</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <AdditionalOptions>/r %(AdditionalOptions)</AdditionalOptions>\r
- <PreprocessorDefinitions>UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);DEBUG;UNICODE;_UNICODE;$(CePlatform);ARM;_ARM_;ARMV4;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>../../bin/$(Platform)\$(Configuration)/osmophone.exe</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <IgnoreSpecificDefaultLibraries>\r
- </IgnoreSpecificDefaultLibraries>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>.\obj\$(Platform)\$(Configuration)\osmophone/osmophone.pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <StackReserveSize>65536</StackReserveSize>\r
- <StackCommitSize>4096</StackCommitSize>\r
- <EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>\r
- <BaseAddress>0x00010000</BaseAddress>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <Midl>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TypeLibraryName>$(Platform)\$(Configuration)/osmophone.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE</PreprocessorDefinitions>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\obj\$(Platform)\$(Configuration)\osmophone/</AssemblerListingLocation>\r
- <ObjectFileName>.\obj\$(Platform)\$(Configuration)\osmophone/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\obj\$(Platform)\$(Configuration)\osmophone/</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <AdditionalOptions>/r %(AdditionalOptions)</AdditionalOptions>\r
- <PreprocessorDefinitions>UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);DEBUG;UNICODE;_UNICODE;$(CePlatform);ARM;_ARM_;ARMV4;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>../../bin/$(Platform)\$(Configuration)/osmophone.exe</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <IgnoreSpecificDefaultLibraries>\r
- </IgnoreSpecificDefaultLibraries>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>.\obj\$(Platform)\$(Configuration)\osmophone/osmophone.pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <StackReserveSize>65536</StackReserveSize>\r
- <StackCommitSize>4096</StackCommitSize>\r
- <EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>\r
- <BaseAddress>0x00010000</BaseAddress>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Midl>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TargetEnvironment>Win32</TargetEnvironment>\r
- <TypeLibraryName>$(Platform)\$(Configuration)/osmophone.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE</PreprocessorDefinitions>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <AdditionalOptions>/r %(AdditionalOptions)</AdditionalOptions>\r
- <PreprocessorDefinitions>UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);NDEBUG;UNICODE;_UNICODE;$(CePlatform);ARM;_ARM_;ARMV4;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>../../bin/$(Platform)/$(Configuration)/$(ProjectName).exe</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <IgnoreSpecificDefaultLibraries>\r
- </IgnoreSpecificDefaultLibraries>\r
- <ProgramDatabaseFile>.\obj\$(Platform)\$(Configuration)\osmophone/osmophone.pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <StackReserveSize>65536</StackReserveSize>\r
- <StackCommitSize>4096</StackCommitSize>\r
- <EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <Midl>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TypeLibraryName>$(Platform)\$(Configuration)/osmophone.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE</PreprocessorDefinitions>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <AdditionalOptions>/r %(AdditionalOptions)</AdditionalOptions>\r
- <PreprocessorDefinitions>UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);NDEBUG;UNICODE;_UNICODE;$(CePlatform);ARM;_ARM_;ARMV4;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <OutputFile>../../bin/$(Platform)/$(Configuration)/$(ProjectName).exe</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <IgnoreSpecificDefaultLibraries>\r
- </IgnoreSpecificDefaultLibraries>\r
- <ProgramDatabaseFile>.\obj\$(Platform)\$(Configuration)\osmophone/osmophone.pdb</ProgramDatabaseFile>\r
- <SubSystem>Windows</SubSystem>\r
- <StackReserveSize>65536</StackReserveSize>\r
- <StackCommitSize>4096</StackCommitSize>\r
- <EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\applications\osmophone\main.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- </PrecompiledHeader>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- </PrecompiledHeader>\r
- <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>\r
- <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</BrowseInformation>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- </PrecompiledHeader>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- </PrecompiledHeader>\r
- </ClCompile>\r
- <ClCompile Include="..\..\applications\osmophone\openfile.cpp">\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- </PrecompiledHeader>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- </PrecompiledHeader>\r
- <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>\r
- <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</BrowseInformation>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- </PrecompiledHeader>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- </PrecompiledHeader>\r
- </ClCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ResourceCompile Include="..\..\applications\osmophone\osmophone.rc">\r
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">DEBUG;_AFXDLL</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">DEBUG;_AFXDLL</PreprocessorDefinitions>\r
- <Culture Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">0x0809</Culture>\r
- <Culture Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">0x0809</Culture>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../doc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../doc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">DEBUG;_AFXDLL</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">DEBUG;_AFXDLL</PreprocessorDefinitions>\r
- <Culture Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">0x0809</Culture>\r
- <Culture Condition="'$(Configuration)|$(Platform)'=='Release|x64'">0x0809</Culture>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../doc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../doc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\applications\osmophone\newres.h" />\r
- <ClInclude Include="..\..\applications\osmophone\resource.h" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="..\..\doc\osmo4.ico" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="libgpac_dll.vcxproj">\r
- <Project>{d3540754-e0cf-4604-ac11-82de9bd4d814}</Project>\r
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by osmophone.rc
-//
-#define IDS_CLASSNAME 1
-#define IDS_WINDOWNAME 4
-#define IDS_APPNAME 5
-#define IDI_ICON 101
-#define IDM_MENU 102
-#define IDM_MAIN_MENU 102
-#define IDM_MAIN_MENU1 102
-#define IDD_ABOUTBOX 103
-#define IDD_APPABOUT 104
-#define IDD_OPENFILE 105
-#define IDD_FILEDIALOG 105
-#define IDR_MENU_OPEN 106
-#define IDR_ABOUT_MENU 107
-#define IDM_MAIN_MENU2 108
-#define IDM_MAIN_MENUITEM1 401
-#define IDM_MAIN_MENUITEM2 402
-#define IDS_MAIN_MENUITEM1 410
-#define IDS_MAIN_MENUITEM2 412
-#define IDC_EDIT1 1001
-#define IDC_DIRNAME 1001
-#define IDC_LIST1 1002
-#define IDC_FILELIST 1002
-#define IDC_LIST2 1003
-#define IDC_NAMECTRL 1004
-#define IDM_FILE_EXIT 40002
-#define IDM_HELP_ABOUT 40003
-#define IDM_GRAB 40004
-#define IDM_RELEASE 40005
-#define ID_FILE_SHOW_WMKEYDOWN 40006
-#define ID_FILE_SHOW_WMKEYUP 40007
-#define ID_FILE_SHOW_WMCHAR 40008
-#define ID_FILE_SHOW_WMMOUSEMOVE 40009
-#define ID_FILE_SHOW_WMLBUTTONDOWN 40010
-#define ID_FILE_SHOW_WMLBUTTONDBLCLK 40011
-#define ID_FILE_SHOW_WMLBUTTONUP 40012
-#define ID_FILE_SHOW_WMRBUTTONDOWN 40013
-#define ID_FILE_SHOW_WMRBUTTONUP 40014
-#define ID_FILE_SHOW_WMRBUTTONDBLCLK 40015
-#define IDM_ITEM_QUIT 40016
-#define IDS_CAP_QUIT 40018
-#define ID_MENU_FILE 40019
-#define IDS_CAP_FILE 40021
-#define IDM_FILE_OPEN 40022
-#define IDS_CAP_EXIT 40023
-#define IDM_MENU_VIEW 40024
-#define IDS_CAP_VIEW 40025
-#define IDM_FILE_OPEN_URL 40026
-#define IDM_OPEN_FILE1 40030
-#define IDM_OPEN_FILE2 40031
-#define IDM_OPEN_FILE3 40032
-#define IDM_OPEN_FILE4 40033
-#define IDM_OPEN_FILE5 40034
-#define IDM_OPEN_FILE6 40035
-#define IDM_OPEN_FILE7 40036
-#define IDM_OPEN_FILE8 40037
-#define IDM_OPEN_FILE9 40038
-#define IDM_OPEN_FILE10 40039
-#define ID_VIEW 40040
-#define IDM_OF_VIEW_ALL 40041
-#define IDS_CAP_OK 40044
-#define IDS_CAP_MENUITEM40045 40046
-#define ID_SELECT 40047
-#define IDS_CAP_SELECT 40049
-#define IDM_OF_PL_ADD 40050
-#define IDM_OF_PLAYLIST 40051
-#define IDM_OF_PL_REM 40052
-#define IDM_VIEW_FS 40053
-#define IDM_VIEW_ABOUT 40054
-#define IDM_ABOUT_OK 40055
-#define IDM_VIEW_STATUS 40057
-#define IDM_VIEW_FORCEGL 40058
-#define ID_NAVIGATE 40059
-#define IDS_CAP_NAVIGATE 40061
-#define IDM_NAV_NONE 40062
-#define IDM_NAV_SLIDE 40063
-#define IDM_SELECT 40064
-#define IDM_NAV_RESET 40065
-#define IDM_MENU_SWITCH 40066
-#define ID_OPTION 40067
-#define IDS_CAP_OPTION 40069
-#define ID_MENUITEM40071 40071
-#define IDS_CAP_MENUITEM40072 40073
-#define IDM_NAV_WALK 40074
-#define IDM_NAV_FLY 40075
-#define IDM_NAV_EXAMINE 40076
-#define IDM_NAV_HEADLIGHT 40077
-#define IDM_NAV_GRAVITY 40078
-#define IDM_NAV_COL_NONE 40079
-#define IDM_NAV_COL_REG 40080
-#define IDM_NAV_COL_DISP 40081
-#define IDM_VIEW_AR_NONE 40082
-#define IDM_VIEW_AR_FILL 40083
-#define IDM_VIEW_AR_4_3 40084
-#define IDM_VIEW_AR_16_9 40085
-#define IDM_OF_PL_UP 40088
-#define IDM_OF_PL_DOWN 40089
-#define ID_OF_VIEW 40090
-#define IDM_OF_PL_ACT 40091
-#define IDS_CAP_MENUITEM40092 40093
-#define IDS_CAP_ADD 40095
-#define IDM_OF_PL_CLEAR 40096
-#define IDM_FILE_LOG_RTI 40097
-#define IDM_VIEW_CPU 40098
-#define IDM_FILE_PAUSE 40099
-#define IDM_VIEW_LOW_RATE 40100
-#define IDM_VIEW_SVG_LOAD 40102
-#define IDS_CAP_DISABLE_PLAYLIST 40103
-#define ID_FILE_CUT_PASTE 40104
-#define Fra 40105
-#define ID_VIDEO_DIRECTFB 40106
-#define ID_VIDEO_GAPI 40107
-#define ID_VIDEO_GDI 40108
-#define ID_VIDEO_DIRECTDRAW 40109
-#define ID_OPTIONS_TEST 40111
-#define ID_VIEW_INFO 40112
-#define ID_Menu 40113
-#define ID_OPTIONS_TEST40114 40114
-#define ID_OPTIONS_VIDEOOUT 40115
-#define ID_VIDEOOUT_FD 40116
-#define ID_OPTIONS_VIDEOOUT40117 40117
-#define ID_FILE_LOGS 40118
-#define ID_FILE_DS 40119
-#define ID_LOGS_ENABLED 40120
-#define ID_LOGS_LEVEL 40121
-#define ID_LEVEL_DEBUG 40122
-#define ID_LEVEL_WARNING 40123
-#define ID_LEVEL_INFO 40124
-#define ID_LEVEL_DEBUG40125 40125
-#define ID_LOGLEVEL_ERROR 40126
-#define ID_LOGLEVEL_WARNING 40127
-#define ID_LOGLEVEL_INFO 40128
-#define ID_LOGLEVEL_DEBUG 40129
-#define ID_LOGS_TOOLS 40130
-#define ID_LOGTOOL_CORE 40131
-#define ID_TOOLS_CODING 40132
-#define ID_TOOLS_CONTAINER 40133
-#define ID_TOOLS_NETWORK 40134
-#define ID_TOOLS_RTP 40135
-#define ID_TOOLS_SYNC 40136
-#define ID_TOOLS_CODEC 40137
-#define ID_TOOLS_PARSER 40138
-#define ID_TOOLS_MEDIA 40139
-#define ID_TOOLS_SCENE 40140
-#define ID_TOOLS_SCRIPT 40141
-#define ID_TOOLS_INTERACT 40142
-#define ID_TOOLS_COMPOSE 40143
-#define ID_TOOLS_MMIO 40144
-#define ID_TOOLS_RTI 40145
-#define ID_TOOLS_NONE 40146
-#define ID_TOOLS_ALL 40147
-#define ID_TOOLS_CORE 40148
-#define ID_LEVEL_NONE 40149
-#define ID_LOGLEVEL_NONE 40150
-#define ID_LOGS_RESET 40151
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 111
-#define _APS_NEXT_COMMAND_VALUE 40152
-#define _APS_NEXT_CONTROL_VALUE 1005
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+++ /dev/null
-include ../../config.mak
-
-vpath %.cpp $(SRC_PATH)/applications/osmozilla
-
-ifeq ($(CONFIG_WIN32),yes)
-USER_NAME=root
-else
-USER_NAME=$(shell whoami)
-ifeq ($(USER_NAME),root)
-else
-MOZILLA_DIR=local
-endif
-endif
-
-CFLAGS=$(CXXFLAGS) $(XUL_CFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-ifeq ($(CONFIG_WIN32),yes)
-CFLAGS+=-DXP_WIN
-else
-ifeq ($(CONFIG_DARWIN),yes)
-CFLAGS+=-DXP_MAC
-else
-CFLAGS+=-DXP_UNIX -DMOZ_X11
-endif
-endif
-
-CFLAGS+=-DNPBASIC_EXPORTS -DMOZILLA_STRICT_API -DXPCOM_GLUE
-
-
-LINKLIBS=-L../../bin/gcc -lgpac
-
-OBJS=osmozilla.o osmo_npapi.o
-
-SRCS := $(OBJS:.o=.cpp)
-
-
-LIB=nposmozilla$(DYN_LIB_SUFFIX)
-ifeq ($(CONFIG_WIN32),yes)
-LINKLIBS+=-lwinmm -lgdi32
-LDFLAGS+=--export-all-symbols
-endif
-
-all: $(LIB)
-
-$(LIB): $(OBJS)
-ifeq ($(CONFIG_WIN32),yes)
- windres osmozilla.rc osmoz.o
- $(CXX) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) osmoz.o $(LINKLIBS) $(LDFLAGS)
- cp "$(SRC_PATH)/applications/osmozilla/nsIOsmozilla.xpt_w32" ../../bin/gcc/nposmozilla.xpt
- chmod +w ../../bin/gcc/nposmozilla.xpt
-else
- $(CXX) $(SHFLAGS) $(OBJS) $(LINKLIBS) -o ../../bin/gcc/$@ $(LDFLAGS)
- cp "$(SRC_PATH)/applications/osmozilla/nsIOsmozilla.xpt_linux" ../../bin/gcc/nposmozilla.xpt
- chmod +w ../../bin/gcc/nposmozilla.xpt
-endif
- @echo $(USER_ROOT)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB) ../../bin/gcc/nposmozilla.xpt
-ifeq ($(CONFIG_WIN32),yes)
- rm -f osmoz.o
-endif
-
-install:
-ifeq ($(MOZILLA_DIR),local)
-ifeq ($(USER_NAME),root)
- @echo "*** Root cannot install local mozilla plugins! ***"
- @echo "*** Exit root mode and reinstall mozilla plugin! ***"
-else
- $(MAKE) $(LIB)
- $(INSTALL) -D -m 755 ../../bin/gcc/$(LIB) "$(HOME)/.mozilla/plugins/$(LIB)"
- $(INSTALL) -D -m 755 ../../bin/gcc/nposmozilla.xpt "$(HOME)/.mozilla/components/nposmozilla.xpt"
-endif
-else
- $(INSTALL) -D -m 755 ../../bin/gcc/$(LIB) "$(MOZILLA_DIR)/components/$(LIB)"
- $(INSTALL) -D -m 755 ../../bin/gcc/nposmozilla.xpt "$(MOZILLA_DIR)/components/nposmozilla.xpt"
-endif
-
-uninstall:
-ifeq ($(MOZILLA_DIR),local)
-ifeq ($(USER_NAME),root)
-else
- rm -rf "$(HOME)/.mozilla/plugins/$(LIB)"
- rm -rf "$(HOME)/.mozilla/components/nposmozilla.xpt"
-endif
-else
- rm -rf "$(MOZILLA_DIR)/components/$(LIB)"
- rm -rf "$(MOZILLA_DIR)/components/nposmozilla.xpt"
-endif
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
+++ /dev/null
-/*
-* DO NOT EDIT. THIS FILE IS GENERATED FROM nsIOsmozilla.idl
-*/
-
-#ifndef __gen_nsIOsmozilla_h__
-#define __gen_nsIOsmozilla_h__
-
-#include "osmo_npapi.h"
-
-#ifdef GECKO_XPCOM
-
-#ifndef __gen_nsISupports_h__
-#include "nsISupports.h"
-#endif
-
-/* For IDL files that don't want to include root IDL files. */
-#ifndef NS_NO_VTABLE
-#define NS_NO_VTABLE
-#endif
-
-/* starting interface: nsIOsmozilla */
-#define NS_IOSMOZILLA_IID_STR "d2d536a0-b6fc-11d5-9d10-0060b0fbd80b"
-
-#define NS_IOSMOZILLA_IID \
- {0xd2d536a0, 0xb6fc, 0x11d5, \
- { 0x9d, 0x10, 0x00, 0x60, 0xb0, 0xfb, 0xd8, 0x0b }}
-
-class NS_NO_VTABLE nsIOsmozilla : public nsISupports {
-public:
-
- NS_DEFINE_STATIC_IID_ACCESSOR(NS_IOSMOZILLA_IID)
-
- /* void Pause (); */
- NS_IMETHOD Pause(void) = 0;
-
- /* void Play (); */
- NS_IMETHOD Play(void) = 0;
-
- /* void Stop (); */
- NS_IMETHOD Stop(void) = 0;
-
- /* void Update (in string type, in string commands); */
- NS_IMETHOD Update(const char *type, const char *commands) = 0;
-
- /* void QualitySwitch (in int switch_up); */
- NS_IMETHOD QualitySwitch(int switch_up) = 0;
-
- /* void SetURL (in string url); */
- NS_IMETHOD SetURL(const char *url) = 0;
-};
-
-/* Use this macro when declaring classes that implement this interface. */
-#define NS_DECL_NSIOSMOZILLA \
- NS_IMETHOD Pause(void); \
- NS_IMETHOD Play(void); \
- NS_IMETHOD Stop(void); \
- NS_IMETHOD Update(const char *type, const char *commands); \
- NS_IMETHOD QualitySwitch(int switch_up); \
- NS_IMETHOD SetURL(const char *type);
-
-/* Use this macro to declare functions that forward the behavior of this interface to another object. */
-#define NS_FORWARD_NSIOSMOZILLA(_to) \
- NS_IMETHOD Pause(void) { return _to Pause(); } \
- NS_IMETHOD Play(void) { return _to Play(); } \
- NS_IMETHOD Stop(void) { return _to Stop(); } \
- NS_IMETHOD Update(const char *type, const char *commands) { return _to Update(type, commands); } \
- NS_IMETHOD QualitySwitch(int switch_up) { return _to QualitySwitch( switch_up ); } \
- NS_IMETHOD SetURL(const char *url) { return _to SetURL(url); }
-
-/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
-#define NS_FORWARD_SAFE_NSIOSMOZILLA(_to) \
- NS_IMETHOD Pause(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Pause(); } \
- NS_IMETHOD Play(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Play(); } \
- NS_IMETHOD Stop(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Stop(); } \
- NS_IMETHOD Update(const char *type, const char *commands) { return !_to ? NS_ERROR_NULL_POINTER : _to->Update(type, commands); } \
- NS_IMETHOD QualitySwitch(int switch_up) { return !_to ? NS_ERROR_NULL_POINTER : _to->QualitySwitch(switch_up); } \
- NS_IMETHOD SetURL(const char *url) { return !_to ? NS_ERROR_NULL_POINTER : _to->Update(url); } \
-
-#if 0
-/* Use the code below as a template for the implementation class for this interface. */
-
-/* Header file */
-class nsOsmozilla : public nsIOsmozilla
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIOSMOZILLA
-
- nsOsmozilla();
- virtual ~nsOsmozilla();
- /* additional members */
-};
-
-/* Implementation file */
-NS_IMPL_ISUPPORTS1(nsOsmozilla, nsIOsmozilla)
-
-nsOsmozilla::nsOsmozilla()
-{
- /* member initializers and constructor code */
-}
-
-nsOsmozilla::~nsOsmozilla()
-{
- /* destructor code */
-}
-
-/* void Pause (); */
-NS_IMETHODIMP nsOsmozilla::Pause()
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void Play (); */
-NS_IMETHODIMP nsOsmozilla::Play()
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void Stop (); */
-NS_IMETHODIMP nsOsmozilla::Stop()
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void Update (in string type, in string commands); */
-NS_IMETHODIMP nsOsmozilla::Update(const char *type, const char *commands)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void QualitySwitch (in int switch_up); */
-NS_IMETHODIMP nsOsmozilla::QualitySwitch(int switch_up)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void SetURL (in string url); */
-NS_IMETHODIMP nsOsmozilla::SetURL(const char *type)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* End of implementation class template. */
-#endif
-
-#endif //GECKO_XPCOM
-
-#endif /* __gen_nsIOsmozilla_h__ */
+++ /dev/null
-#include "nsISupports.idl"
-
-[scriptable, uuid(ce32e3ff-36f8-425f-94be-d85b26e634ee)]
-interface nsIOsmozilla : nsISupports {
- void Pause();
- void Play();
- void Stop();
- void Update(in string type, in string commands);
- void QualitySwitch(in long switch_up);
-};
+++ /dev/null
-/*
-* GPAC - Multimedia Framework C SDK
-*
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
-* All rights reserved
-*
-* This file is part of GPAC / Osmozilla NPAPI plugin
-*
-* GPAC is free software; you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License as published by
-* the Free Software Foundation; either version 2, or (at your option)
-* any later version.
-*
-* GPAC is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; see the file COPYING. If not, write to
-* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-*/
-
-
-////////////////////////////////////////////////////////////
-//
-// Implementation of Netscape entry points (NPN_*)
-//
-#include "osmo_npapi.h"
-#include "osmozilla.h"
-
-#if defined(XP_UNIX) && !defined(XP_MACOS)
-#include <malloc.h>
-#include <string.h>
-#endif
-
-NPNetscapeFuncs *sBrowserFunctions = NULL;
-
-NPError Osmozilla_GetURL(NPP instance, const char *url, const char *target)
-{
- if (!sBrowserFunctions) return NPERR_INVALID_FUNCTABLE_ERROR;
- return sBrowserFunctions->geturl(instance, url, target);
-}
-
-void Osmozilla_SetStatus(NPP instance, const char *message)
-{
- if (!sBrowserFunctions) return;
- sBrowserFunctions->status(instance, message);
-}
-
-#ifndef GECKO_XPCOM
-void Osmozilla_InitScripting(Osmozilla *osmo);
-#endif
-
-NPError NPOsmozilla_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
-{
- Osmozilla *osmo;
- NPError rv = NPERR_NO_ERROR;
- if (instance == NULL)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- osmo = (Osmozilla *) malloc(sizeof(Osmozilla));
- memset(osmo, 0, sizeof(Osmozilla));
-
- osmo->np_instance = instance;
- // associate the plugin instance object with NPP instance
- instance->pdata = (void *)osmo;
-
- osmo->supports_xembed = 0;
- sBrowserFunctions->getvalue(NULL, NPNVSupportsXEmbedBool, (void *)&osmo->supports_xembed);
-
- Osmozilla_Initialize(osmo, argc, argn, argv);
-
-#ifndef GECKO_XPCOM
- Osmozilla_InitScripting(osmo);
-#endif
-
- return rv;
-}
-
-// here is the place to clean up and destroy the nsPluginInstance object
-NPError NPOsmozilla_Destroy (NPP instance, NPSavedData** save)
-{
- NPError rv = NPERR_NO_ERROR;
- Osmozilla *osmozilla;
- if(instance == NULL)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- osmozilla = (Osmozilla*)instance->pdata;
- if (osmozilla != NULL) {
- Osmozilla_Shutdown(osmozilla);
-#ifdef GECKO_XPCOM
- NPOsmozilla_ShutdownScript(osmozilla);
-#else
- if (osmozilla->script_obj) sBrowserFunctions->releaseobject(osmozilla->script_obj);
- osmozilla->script_obj = NULL;
-#endif
-
- free(osmozilla);
- }
- instance->pdata = NULL;
- return rv;
-}
-
-// during this call we know when the plugin window is ready or
-// is about to be destroyed so we can do some gui specific
-// initialization and shutdown
-NPError NPOsmozilla_SetWindow (NPP instance, NPWindow* pNPWindow)
-{
- Osmozilla *osmozilla;
- void *os_wnd_handle, *os_wnd_display;
- NPError rv = NPERR_NO_ERROR;
-
- if (!instance || !instance->pdata) return NPERR_INVALID_INSTANCE_ERROR;
- if (pNPWindow == NULL) return NPERR_GENERIC_ERROR;
- osmozilla = (Osmozilla *)instance->pdata;
-
- // window just created
- if (!osmozilla->window_set) {
- if (pNPWindow->window == NULL) return NPERR_GENERIC_ERROR;
-
-#ifdef XP_WIN
- os_wnd_handle = pNPWindow->window;
- os_wnd_display = NULL;
-#elif defined(XP_MAXOS)
- os_wnd_handle = pNPWindow->window;
- os_wnd_display = NULL;
-#elif defined(XP_UNIX)
- os_wnd_handle = pNPWindow->window;
- /*HACK - although we don't use the display in the X11 plugin, this is used to signal that
- the user is mozilla and prevent some X11 calls crashing the browser in file playing mode
- (eg, "firefox myfile.mp4" )*/
- os_wnd_display =((NPSetWindowCallbackStruct *)pNPWindow->ws_info)->display;
-#endif
-
- if (! Osmozilla_SetWindow(osmozilla, os_wnd_handle, os_wnd_display, pNPWindow->width, pNPWindow->height) ) {
- return NPERR_MODULE_LOAD_FAILED_ERROR;
- }
-
- }
-
-#if 0
- // window goes away
- if((pNPWindow->window == NULL) && plugin->isInitialized())
- return plugin->SetWindow(pNPWindow);
-
- // window resized?
- if(plugin->isInitialized() && (pNPWindow->window != NULL))
- return plugin->SetWindow(pNPWindow);
-
- // this should not happen, nothing to do
- if((pNPWindow->window == NULL) && !plugin->isInitialized())
- return plugin->SetWindow(pNPWindow);
-#endif
-
- return rv;
-}
-
-NPError NPOsmozilla_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t *stype)
-{
- Osmozilla *osmozilla;
- if(instance == NULL)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- osmozilla = (Osmozilla *)instance->pdata;
- if(osmozilla== NULL)
- return NPERR_GENERIC_ERROR;
-
- Osmozilla_ConnectTo(osmozilla, stream->url);
- *stype = NP_SEEK;
- return NPERR_NO_ERROR;
-}
-
-NPINT32 NPOsmozilla_WriteReady (NPP instance, NPStream *stream)
-{
- return 0x0fffffff;
-}
-
-NPINT32 NPOsmozilla_Write (NPP instance, NPStream *stream, NPINT32 offset, NPINT32 len, void *buffer)
-{
- return len;
-}
-
-NPError NPOsmozilla_DestroyStream (NPP instance, NPStream *stream, NPError reason)
-{
- return NPERR_NO_ERROR;
-}
-
-void NPOsmozilla_StreamAsFile (NPP instance, NPStream* stream, const char* fname)
-{
-}
-
-void NPOsmozilla_Print (NPP instance, NPPrint* printInfo)
-{
- Osmozilla *osmozilla;
- if(instance == NULL)
- return;
-
- osmozilla = (Osmozilla *)instance->pdata;
- if(osmozilla== NULL)
- return;
-
- Osmozilla_Print(osmozilla, (printInfo->mode == NP_EMBED) ? 1 : 0, printInfo->print.embedPrint.platformPrint,
- printInfo->print.embedPrint.window.x, printInfo->print.embedPrint.window.y,
- printInfo->print.embedPrint.window.width, printInfo->print.embedPrint.window.height);
-}
-
-void NPOsmozilla_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
-{
- return;
-}
-
-NPError NPOsmozilla_GetValue(NPP instance, NPPVariable variable, void *value)
-{
- NPError rv = NPERR_NO_ERROR;
- Osmozilla *osmozilla;
- if(instance == NULL)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- osmozilla = (Osmozilla *)instance->pdata;
- if(osmozilla== NULL) return NPERR_GENERIC_ERROR;
-
- switch (variable) {
-#ifdef GECKO_XPCOM
- case NPPVpluginScriptableInstance:
- rv = NPOsmozilla_GetPeer(osmozilla, value);
- break;
-
- case NPPVpluginScriptableIID:
- rv = NPOsmozilla_GetPeerIID(osmozilla, value);
- break;
-#else
-
- case NPPVpluginScriptableNPObject:
- sBrowserFunctions->retainobject(osmozilla->script_obj);
- * (void **)value = osmozilla->script_obj;
- break;
-
-#endif
- case NPPVpluginNeedsXEmbed:
- *((int *)value) = 1;
- break;
- case NPPVpluginNameString :
- *(const char**)value = "Osmozilla/GPAC plugin for NPAPI";
- break;
- default:
- break;
- }
-
- return rv;
-}
-
-
-
-NPError NPOsmozilla_SetValue(NPP instance, NPNVariable variable, void *value)
-{
- return NPERR_NO_ERROR;
-}
-
-int16_t NPOsmozilla_HandleEvent(NPP instance, void* event)
-{
- /*we hacked the proc*/
- return 0;
-}
-
-
-NPError OSCALL NP_Shutdown()
-{
-#ifdef GECKO_XPCOM
- NPOsmozilla_ReleaseServiceManager();
-#endif
- return NPERR_NO_ERROR;
-}
-
-static NPError fillPluginFunctionTable(NPPluginFuncs* aNPPFuncs)
-{
- if(aNPPFuncs == NULL)
- return NPERR_INVALID_FUNCTABLE_ERROR;
-
- // Set up the plugin function table that Netscape will use to
- // call us. Netscape needs to know about our version and size
- // and have a UniversalProcPointer for every function we implement.
-
- aNPPFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
- aNPPFuncs->newp = NPOsmozilla_New;
- aNPPFuncs->destroy = NPOsmozilla_Destroy;
- aNPPFuncs->setwindow = NPOsmozilla_SetWindow;
- aNPPFuncs->newstream = NPOsmozilla_NewStream;
- aNPPFuncs->destroystream = NPOsmozilla_DestroyStream;
- aNPPFuncs->asfile = NPOsmozilla_StreamAsFile;
- aNPPFuncs->writeready = NPOsmozilla_WriteReady;
- aNPPFuncs->write = NPOsmozilla_Write;
- aNPPFuncs->print = NPOsmozilla_Print;
- aNPPFuncs->event = NPOsmozilla_HandleEvent;
- aNPPFuncs->urlnotify = NPOsmozilla_URLNotify;
- aNPPFuncs->getvalue = NPOsmozilla_GetValue;
- aNPPFuncs->setvalue = NPOsmozilla_SetValue;
- return NPERR_NO_ERROR;
-}
-
-
-static NPError NS_PluginInitialize()
-{
-#ifdef GECKO_XPCOM
- NPOsmozilla_GetServiceManager();
-#endif
- return NPERR_NO_ERROR;
-}
-
-// get values per plugin
-NPError NS_PluginGetValue(NPPVariable aVariable, void *aValue)
-{
- NPError err = NPERR_NO_ERROR;
- switch (aVariable) {
- case NPPVpluginNameString:
- *((char **)aValue) = (char *) "Osmozilla";
- break;
- case NPPVpluginDescriptionString:
- *((char **)aValue) = Osmozilla_GetVersion();
- break;
- default:
- err = NPERR_INVALID_PARAM;
- break;
- }
- return err;
-}
-
-
-
-
-#define GPAC_PLUGIN_MIMETYPES \
- "audio/mpeg:mp2,mp3,mpga,mpega:MP3 Music;" \
- "audio/x-mpeg:mp2,mp3,mpga,mpega:MP3 Music;" \
- "audio/amr:amr,awb:AMR Audio;" \
- "audio/mp4:mp4,mpg4,mpeg4,m4a:MPEG-4 Audio;" \
- "audio/aac:aac:MPEG-4 AAC Music;" \
- "audio/aacp:aac:MPEG-4 AACPlus Music;" \
- "audio/basic:snd,au:Basic Audio;" \
- "audio/x-wav:wav:WAV Audio;" \
- "audio/3gpp:3gp,3gpp:3GPP/MMS Music;" \
- "audio/3gpp2:3g2,3gp2:3GPP2/MMS Music;" \
- "video/mpeg:mpg,mpeg,mpe,mpv2:MPEG Video;" \
- "video/x-mpeg:mpg,mpeg,mpe,mpv2:MPEG Video;" \
- "video/mpeg-system:mpg,mpeg,mpe,vob,mpv2:MPEG Video;" \
- "video/x-mpeg-system:mpg,mpeg,mpe,vob,mpv2:MPEG Video;" \
- "video/avi:avi:AVI Video;" \
- "video/quicktime:mov,qt:QuickTime Movies;" \
- "video/x-ms-asf:asf,asx:Windows Media Video;" \
- "video/x-ms-wmv:wmv:Windows Media;" \
- "video/mp4:mp4,mpg4:MPEG-4 Video;" \
- "video/3gpp:3gp,3gpp:3GPP/MMS Video;" \
- "video/3gpp2:3g2,3gp2:3GPP2/MMS Video;" \
- "image/jpeg:jpeg,jpg:JPEG Images;" \
- "image/png:png:PNG Images;" \
- "image/bmp:bmp:MS Bitmap Images;" \
- "image/svg+xml:svg,svg.gz,svgz:SVG Document;" \
- "image/x-svgm:svgm:SVGM Document;" \
- "x-subtitle/srt:srt:SRT SubTitles;" \
- "x-subtitle/sub:sub:SUB SubTitles;" \
- "x-subtitle/ttxt:ttxt:GPAC 3GPP TimedText;" \
- "model/vrml:wrl,wrl.gz:VRML World;" \
- "model/x3d+vrml:x3dv,x3dv.gz,x3dvz:X3D/VRML World;" \
- "model/x3d+xml:x3d,x3d.gz,x3dz:X3D/XML World;" \
- "application/ogg:ogg:Ogg Media;" \
- "application/x-ogg:ogg:Ogg Media;" \
- "application/x-bt:bt,bt.gz,btz:MPEG-4 Text (BT);" \
- "application/x-xmt:xmt,xmt.gz,xmtz:MPEG-4 Text (XMT);" \
- "application/mp4:mp4,mpg4:MPEG-4 Movies;" \
- "application/sdp:sdp:Streaming Media Session;" \
- /* explicit plugin call */ \
- "application/x-gpac::GPAC plugin;" \
-
-char * NP_GetMIMEDescription(void)
-{
- return (char *) GPAC_PLUGIN_MIMETYPES;
-}
-
-
-NPError NP_GetValue(void *future, NPPVariable aVariable, void *aValue)
-{
- return NS_PluginGetValue(aVariable, aValue);
-}
-
-
-#if defined(XP_WIN) || defined(XP_MACOS)
-
-NPError OSCALL NP_Initialize(NPNetscapeFuncs* aNPNFuncs)
-{
- sBrowserFunctions = aNPNFuncs;
-
- return NS_PluginInitialize();
-}
-
-NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* aNPPFuncs)
-{
- return fillPluginFunctionTable(aNPPFuncs);
-}
-
-
-#elif defined(XP_UNIX)
-
-NPError OSCALL NP_Initialize(NPNetscapeFuncs* aNPNFuncs, NPPluginFuncs* aNPPFuncs)
-{
- NPError rv;
- sBrowserFunctions = aNPNFuncs;
- rv = fillPluginFunctionTable(aNPPFuncs);
- if(rv != NPERR_NO_ERROR)
- return rv;
-
- return NS_PluginInitialize();
-}
-#endif
-
-
-#ifdef GECKO_XPCOM
-
-
-#include <nsIServiceManager.h>
-#include <nsIMemory.h>
-#include <nsISupportsUtils.h>
-#include <nsISupports.h>
-#include <nsMemory.h>
-
-#include "nsIOsmozilla.h"
-
-#include "osmozilla.h"
-
-
-nsIServiceManager *gServiceManager = NULL;
-
-
-// We must implement nsIClassInfo because it signals the
-// Mozilla Security Manager to allow calls from JavaScript.
-// helper class to implement all necessary nsIClassInfo method stubs
-// and to set flags used by the security system
-
-class nsClassInfoMixin : public nsIClassInfo
-{
- // These flags are used by the DOM and security systems to signal that
- // JavaScript callers are allowed to call this object's scritable methods.
- NS_IMETHOD GetFlags(PRUint32 *aFlags)
- { *aFlags = nsIClassInfo::PLUGIN_OBJECT | nsIClassInfo::DOM_OBJECT;
- return NS_OK;
- }
-
- NS_IMETHOD GetImplementationLanguage(PRUint32 *aImplementationLanguage)
- { *aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
- return NS_OK;
- }
-
- // The rest of the methods can safely return error codes...
- NS_IMETHOD GetInterfaces(PRUint32 *count, nsIID ***array)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHOD GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHOD GetContractID(char **aContractID)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHOD GetClassDescription(char **aClassDescription)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHOD GetClassID(nsCID **aClassID)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
-};
-
-
-class nsOsmozillaPeer : public nsIOsmozilla , public nsClassInfoMixin
-{
-public:
- nsOsmozillaPeer(Osmozilla *osmo);
- virtual ~nsOsmozillaPeer();
-
- // methods from nsISupports
- NS_IMETHOD QueryInterface(const nsIID & aIID, void **aInstancePtr);
- NS_IMETHOD_(nsrefcnt) AddRef();
- NS_IMETHOD_(nsrefcnt) Release();
-
-public:
- NS_DECL_NSIOSMOZILLA
- void SetInstance(Osmozilla *osmo);
-
-protected:
- nsrefcnt mRefCnt;
- Osmozilla *mPlugin;
-};
-
-
-static NS_DEFINE_IID(kIZillaPluginIID, NS_IOSMOZILLA_IID);
-static NS_DEFINE_IID(kIClassInfoIID, NS_ICLASSINFO_IID);
-static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
-
-nsOsmozillaPeer::nsOsmozillaPeer(Osmozilla *osmo)
-{
- mPlugin=osmo;
- mRefCnt = 0;
-}
-
-nsOsmozillaPeer::~nsOsmozillaPeer()
-{
-}
-// Notice that we expose our claim to implement nsIClassInfo.
-//NS_IMPL_ISUPPORTS2(nsOsmozillaPeer, nsITestPlugin, nsIClassInfo)
-
-// the following method will be callable from JavaScript
-NS_IMETHODIMP nsOsmozillaPeer::Pause() {
- Osmozilla_Pause(mPlugin);
- return NS_OK;
-}
-NS_IMETHODIMP nsOsmozillaPeer::Play() {
- Osmozilla_Play(mPlugin);
- return NS_OK;
-}
-NS_IMETHODIMP nsOsmozillaPeer::Stop() {
- Osmozilla_Stop(mPlugin);
- return NS_OK;
-}
-
-NS_IMETHODIMP nsOsmozillaPeer::Update(const char *type, const char *commands)
-{
- Osmozilla_Update(mPlugin, type, commands);
- return NS_OK;
-}
-
-NS_IMETHODIMP nsOsmozillaPeer::QualitySwitch(int switch_up)
-{
- Osmozilla_QualitySwitch(mPlugin, switch_up);
- return NS_OK;
-}
-
-NS_IMETHODIMP nsOsmozillaPeer::SetURL(const char *url)
-{
- Osmozilla_SetURL(mPlugin, url);
- return NS_OK;
-}
-
-void nsOsmozillaPeer::SetInstance(Osmozilla *osmo)
-{
- mPlugin = osmo;
-}
-
-NS_IMETHODIMP_(nsrefcnt) nsOsmozillaPeer::AddRef()
-{
- ++mRefCnt;
- return mRefCnt;
-}
-
-NS_IMETHODIMP_(nsrefcnt) nsOsmozillaPeer::Release()
-{
- --mRefCnt;
- if (mRefCnt == 0) {
- delete this;
- return 0;
- }
- return mRefCnt;
-}
-
-// here nsOsmozillaPeer should return three interfaces it can be asked for by their iid's
-// static casts are necessary to ensure that correct pointer is returned
-NS_IMETHODIMP nsOsmozillaPeer::QueryInterface(const nsIID & aIID,
- void **aInstancePtr)
-{
- if (!aInstancePtr)
- return NS_ERROR_NULL_POINTER;
-
- if (aIID.Equals(kIZillaPluginIID)) {
- *aInstancePtr = NS_STATIC_CAST(nsIOsmozilla *, this);
- AddRef();
- return NS_OK;
- }
-
- if (aIID.Equals(kIClassInfoIID)) {
- *aInstancePtr = NS_STATIC_CAST(nsIClassInfo *, this);
- AddRef();
- return NS_OK;
- }
-
- if (aIID.Equals(kISupportsIID)) {
- *aInstancePtr = NS_STATIC_CAST(nsISupports *, (NS_STATIC_CAST (nsIOsmozilla *, this)));
- AddRef();
- return NS_OK;
- }
- return NS_NOINTERFACE;
-}
-
-extern NPNetscapeFuncs *sBrowserFunctions;
-
-void NPOsmozilla_GetServiceManager()
-{
- // this is probably a good place to get the service manager
- // note that Mozilla will add reference, so do not forget to release
- nsISupports *sm = NULL;
-
- if (!sBrowserFunctions) return;
- sBrowserFunctions->getvalue(NULL, NPNVserviceManager, &sm);
-
- // Mozilla returns nsIServiceManager so we can use it directly; doing QI on
- // nsISupports here can still be more appropriate in case something is changed
- // in the future so we don't need to do casting of any sort.
- if (sm) {
- sm->QueryInterface(NS_GET_IID(nsIServiceManager), (void **) &gServiceManager);
- NS_RELEASE(sm);
- }
-}
-
-void NPOsmozilla_ReleaseServiceManager()
-{
-#ifdef GECKO_XPCOM
- // we should release the service manager
- NS_IF_RELEASE(gServiceManager);
- gServiceManager = NULL;
-#endif
-}
-
-void NPOsmozilla_ShutdownScript(Osmozilla *osmo)
-{
- nsOsmozillaPeer *peer = (nsOsmozillaPeer *) osmo->scriptable_peer;
- if (peer != NULL) {
- peer->SetInstance(NULL);
- NS_IF_RELEASE(peer);
- }
-}
-
-
-NPError NPOsmozilla_GetPeer(Osmozilla *osmo, void *value)
-{
- if (!osmo->scriptable_peer) {
- osmo->scriptable_peer = new nsOsmozillaPeer(osmo);
- if (!osmo->scriptable_peer) return NPERR_OUT_OF_MEMORY_ERROR;
- NS_ADDREF( (nsOsmozillaPeer *) osmo->scriptable_peer);
- }
-
- NS_ADDREF( (nsOsmozillaPeer *)osmo->scriptable_peer);
- *(nsISupports **) value = (nsISupports *) osmo->scriptable_peer;
- return NPERR_NO_ERROR;
-}
-
-NPError NPOsmozilla_GetPeerIID(Osmozilla *osmo, void *value)
-{
- static nsIID scriptableIID = NS_IOSMOZILLA_IID;
- if (!sBrowserFunctions) return NPERR_OUT_OF_MEMORY_ERROR;
-
- nsIID *ptr = (nsIID *) sBrowserFunctions->memalloc( sizeof(nsIID) );
- if (! ptr) return NPERR_OUT_OF_MEMORY_ERROR;
-
- *ptr = scriptableIID;
- *(nsIID **) value = ptr;
- return NPERR_NO_ERROR;
-}
-
-#else
-
-enum
-{
- kOSMOZILLA_ID_METHOD_PLAY = 0,
- kOSMOZILLA_ID_METHOD_PAUSE,
- kOSMOZILLA_ID_METHOD_STOP,
- kOSMOZILLA_ID_METHOD_UPDATE,
- kOSMOZILLA_ID_METHOD_QUALITY_SWITCH,
- kOSMOZILLA_ID_METHOD_SET_URL,
-
- kOSMOZILLA_NUM_METHODS
-};
-
-NPIdentifier v_OSMOZILLA_MethodIdentifiers[kOSMOZILLA_NUM_METHODS];
-const NPUTF8 * v_OSMOZILLA_MethodNames[kOSMOZILLA_NUM_METHODS] = {
- "Play",
- "Pause",
- "Stop",
- "Update",
- "QualitySwitch",
- "SetURL",
-};
-
-NPClass osmozilla_script_class;
-
-typedef struct {
- NPClass *_class;
- uint32_t referenceCount;
- Osmozilla *osmo;
-} OsmozillaObject;
-
-NPObject *OSMOZILLA_Allocate(NPP npp, NPClass *theClass)
-{
- OsmozillaObject *obj = NULL;
-
- sBrowserFunctions->getstringidentifiers(v_OSMOZILLA_MethodNames, kOSMOZILLA_NUM_METHODS, v_OSMOZILLA_MethodIdentifiers);
- obj = (OsmozillaObject *)malloc(sizeof(OsmozillaObject));
- obj->osmo = (Osmozilla *) npp->pdata;
- return (NPObject *)obj;
-}
-
-void OSMOZILLA_Deallocate(NPObject* obj)
-{
- free(obj);
- return;
-}
-
-void OSMOZILLA_Invalidate(NPObject* obj)
-{
- return;
-}
-
-bool OSMOZILLA_HasMethod(NPObject* obj, NPIdentifier name)
-{
- int i = 0;
- while (i < kOSMOZILLA_NUM_METHODS) {
- if ( name == v_OSMOZILLA_MethodIdentifiers[i] ) {
- return 1;
- }
- i++;
- }
- return 0;
-}
-
-bool OSMOZILLA_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result)
-{
- OsmozillaObject *npo = (OsmozillaObject *)obj;
- if (!npo->osmo) return 0;
- if (name == v_OSMOZILLA_MethodIdentifiers[kOSMOZILLA_ID_METHOD_PLAY]) {
- Osmozilla_Play(npo->osmo);
- return 1;
- }
- if (name == v_OSMOZILLA_MethodIdentifiers[kOSMOZILLA_ID_METHOD_PAUSE]) {
- Osmozilla_Pause(npo->osmo);
- return 1;
- }
- if (name == v_OSMOZILLA_MethodIdentifiers[kOSMOZILLA_ID_METHOD_STOP]) {
- Osmozilla_Stop(npo->osmo);
- return 1;
- }
- if (name == v_OSMOZILLA_MethodIdentifiers[kOSMOZILLA_ID_METHOD_UPDATE]) {
- const char *mime = NULL;
- const char *update = NULL;
- if (argCount==2) {
- mime = (args[0].type==NPVariantType_String) ? args[0].value.stringValue.UTF8Characters : NULL;
- update = (args[1].type==NPVariantType_String) ? args[1].value.stringValue.UTF8Characters : NULL;
- }
- if (!update) return 0;
- Osmozilla_Update(npo->osmo, mime, update);
- return 1;
- }
- if (name == v_OSMOZILLA_MethodIdentifiers[kOSMOZILLA_ID_METHOD_QUALITY_SWITCH]) {
- int up = 1;
- if (argCount==1) {
- if (args[0].type==NPVariantType_Bool) up = args[0].value.boolValue ? 1 : 0;
- else if (args[0].type==NPVariantType_Int32) up = args[0].value.intValue ? 1 : 0;
- }
- Osmozilla_QualitySwitch(npo->osmo, up);
- return 1;
- }
- if (name == v_OSMOZILLA_MethodIdentifiers[kOSMOZILLA_ID_METHOD_SET_URL]) {
- const char *url = "";
- if (argCount>=1) {
- if (args[0].type==NPVariantType_String)
- url = args[0].value.stringValue.UTF8Characters;
- }
- Osmozilla_SetURL(npo->osmo, url);
- return 1;
- }
- return 0;
-}
-
-bool OSMOZILLA_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
-{
- return 1;
-}
-
-bool OSMOZILLA_HasProperty(NPObject* obj, NPIdentifier name)
-{
- bool result = 0;
- if ( sBrowserFunctions->identifierisstring(name) )
- {
- NPUTF8 *val = sBrowserFunctions->utf8fromidentifier(name);
-
- if ( !strcmp(val, "DownloadProgress") )
- {
- result = 1;
- }
-
- sBrowserFunctions->memfree(val);
- }
- /*nothing exposed yet*/
- return result;
-}
-
-bool OSMOZILLA_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result)
-{
- OsmozillaObject *npo = (OsmozillaObject *)obj;
- if (!npo->osmo) return 0;
- if ( sBrowserFunctions->identifierisstring(name) )
- {
- NPUTF8 *val = sBrowserFunctions->utf8fromidentifier(name);
-
- if ( !strcmp(val, "DownloadProgress") )
- {
- int val = Osmozilla_GetDownloadProgress(npo->osmo);
- INT32_TO_NPVARIANT(val, *result);
- }
-
- sBrowserFunctions->memfree(val);
- }
- return 1;
-}
-
-bool OSMOZILLA_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value)
-{
- return 1;
-}
-
-bool OSMOZILLA_RemoveProperty(NPObject *npobj, NPIdentifier name)
-{
- return 1;
-}
-
-bool OSMOZILLA_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count)
-{
- return 1;
-}
-
-void Osmozilla_InitScripting(Osmozilla *osmo)
-{
- osmozilla_script_class.allocate = OSMOZILLA_Allocate;
- osmozilla_script_class.deallocate = OSMOZILLA_Deallocate;
- osmozilla_script_class.invalidate = OSMOZILLA_Invalidate;
- osmozilla_script_class.hasMethod = OSMOZILLA_HasMethod;
- osmozilla_script_class.invoke = OSMOZILLA_Invoke;
- osmozilla_script_class.invokeDefault = OSMOZILLA_InvokeDefault;
- osmozilla_script_class.hasProperty = OSMOZILLA_HasProperty;
- osmozilla_script_class.getProperty = OSMOZILLA_GetProperty;
- osmozilla_script_class.setProperty = OSMOZILLA_SetProperty;
- osmozilla_script_class.removeProperty = OSMOZILLA_RemoveProperty;
- osmozilla_script_class.enumerate = OSMOZILLA_Enumerate;
-
- /*create script object*/
- osmo->script_obj = sBrowserFunctions->createobject(osmo->np_instance, &osmozilla_script_class);
-
-}
-
-#endif //GECKO_XPCOM
-
+++ /dev/null
-/*
-* GPAC - Multimedia Framework C SDK
-*
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
-* All rights reserved
-*
-* This file is part of GPAC / Osmozilla NPAPI plugin
-*
-* GPAC is free software; you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License as published by
-* the Free Software Foundation; either version 2, or (at your option)
-* any later version.
-*
-* GPAC is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; see the file COPYING. If not, write to
-* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-*/
-
-#ifndef _OSMO_NPAPI_H_
-#define _OSMO_NPAPI_H_
-
-
-#ifdef WIN32
-#include <windows.h>
-#ifndef __cplusplus
-typedef BOOL bool;
-#endif //__cplusplus
-#endif
-
-#include "npapi.h"
-
-/*check this with gecko 1.9.2*/
-#if (NP_VERSION_MINOR < 20)
-#define GECKO_XPCOM
-#endif
-
-#ifdef GECKO_XPCOM
-#include "npupp.h"
-
-#ifndef uint16_t
-typedef uint16 uint16_t;
-#endif
-
-#ifndef int16_t
-typedef int16 int16_t;
-#endif
-
-#define NPINT32 int32
-
-#else
-
-#include "npfunctions.h"
-
-#define NPINT32 int32_t
-
-#endif
-
-#ifdef XP_UNIX
-#include <stdio.h>
-#endif //XP_UNIX
-
-
-#ifndef HIBYTE
-#define HIBYTE(i) (i >> 8)
-#endif
-
-#ifndef LOBYTE
-#define LOBYTE(i) (i & 0xff)
-#endif
-
-/*functions callbacks to browser*/
-NPError Osmozilla_GetURL(NPP instance, const char *url, const char *target);
-void Osmozilla_SetStatus(NPP instance, const char *message);
-
-
-/*
-Plugins functions exposed to browser
-*/
-NPError NPOsmozilla_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
-NPError NPOsmozilla_Destroy(NPP instance, NPSavedData** save);
-NPError NPOsmozilla_SetWindow(NPP instance, NPWindow* window);
-NPError NPOsmozilla_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
-NPError NPOsmozilla_DestroyStream(NPP instance, NPStream* stream, NPError reason);
-NPINT32 NPOsmozilla_WriteReady(NPP instance, NPStream* stream);
-NPINT32 NPOsmozilla_Write(NPP instance, NPStream* stream, NPINT32 offset, NPINT32 len, void* buffer);
-void NPOsmozilla_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
-void NPOsmozilla_Print(NPP instance, NPPrint* platformPrint);
-int16_t NPOsmozilla_HandleEvent(NPP instance, void* event);
-void NPOsmozilla_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData);
-NPError NPOsmozilla_GetValue(NPP instance, NPPVariable variable, void *result);
-NPError NPOsmozilla_SetValue(NPP instance, NPNVariable variable, void *value);
-
-
-/*
-Functions called by browser
-*/
-
-typedef struct __tag_osmozilla Osmozilla;
-
-/*base functions*/
-int Osmozilla_Initialize(Osmozilla *osmo, signed short argc, char* argn[], char* argv[]);
-void Osmozilla_Shutdown(Osmozilla *osmo);
-int Osmozilla_SetWindow(Osmozilla *osmozilla, void *os_wnd_handle, void *os_wnd_display, unsigned int width, unsigned int height);
-void Osmozilla_ConnectTo(Osmozilla *osmozilla, const char *url);
-void Osmozilla_Print(Osmozilla *osmozilla, unsigned int is_embed, void *os_print_dc, unsigned int target_x, unsigned int target_y, unsigned int target_width, unsigned int target_height);
-char *Osmozilla_GetVersion();
-
-
-/*scripting functions*/
-void Osmozilla_Play(Osmozilla *osmo);
-void Osmozilla_Pause(Osmozilla *osmo);
-void Osmozilla_Stop(Osmozilla *osmo);
-void Osmozilla_Update(Osmozilla *osmo, const char *type, const char *commands);
-void Osmozilla_QualitySwitch(Osmozilla *osmo, int switch_up);
-void Osmozilla_SetURL(Osmozilla *osmo, const char *url);
-int Osmozilla_GetDownloadProgress(Osmozilla *osmo);
-
-
-#ifdef GECKO_XPCOM
-
-void NPOsmozilla_GetServiceManager();
-void NPOsmozilla_ReleaseServiceManager();
-void NPOsmozilla_ShutdownScript(Osmozilla *osmo);
-NPError NPOsmozilla_GetPeer(Osmozilla *osmo, void *value);
-NPError NPOsmozilla_GetPeerIID(Osmozilla *osmo, void *value);
-
-#endif //GECKO_XPCOM
-
-#endif //_NPPLAT_H_
+++ /dev/null
-/*
-* GPAC - Multimedia Framework C SDK
-*
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
-* All rights reserved
-*
-* This file is part of GPAC / Osmozilla NPAPI plugin
-*
-* GPAC is free software; you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License as published by
-* the Free Software Foundation; either version 2, or (at your option)
-* any later version.
-*
-* GPAC is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; see the file COPYING. If not, write to
-* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-*/
-
-#include "osmozilla.h"
-
-#ifdef XP_WIN
-#include <windows.h>
-#endif
-
-#include <gpac/options.h>
-#include <gpac/terminal.h>
-#include <gpac/term_info.h>
-
-
-short Osmozilla_GetURL(NPP instance, const char *url, const char *target);
-void Osmozilla_SetStatus(NPP instance, const char *message);
-
-
-void Osmozilla_Shutdown(Osmozilla *osmo)
-{
- if (osmo->url) gf_free(osmo->url);
- osmo->url = NULL;
- if (osmo->term) {
- GF_Terminal *a_term = osmo->term;
- osmo->term = NULL;
- gf_term_del(a_term);
- }
- if (osmo->user) {
- if (osmo->user->modules) gf_modules_del(osmo->user->modules);
- if (osmo->user->config) gf_cfg_del(osmo->user->config);
- gf_free(osmo->user);
- osmo->user = NULL;
- }
-}
-
-static void osmozilla_do_log(void *cbk, GF_LOG_Level level, GF_LOG_Tool tool, const char *fmt, va_list list)
-{
- FILE *logs = (FILE *) cbk;
- vfprintf(logs, fmt, list);
- fflush(logs);
-}
-
-
-Bool Osmozilla_EventProc(void *opaque, GF_Event *evt)
-{
- char msg[1024];
- Osmozilla *osmo = (Osmozilla *)opaque;
- if (!osmo->term) return GF_FALSE;
-
- switch (evt->type) {
- case GF_EVENT_MESSAGE:
- if (!evt->message.message) return GF_FALSE;
- if (evt->message.error)
- sprintf((char *)msg, "GPAC: %s (%s)", evt->message.message, gf_error_to_string(evt->message.error));
- else
- sprintf((char *)msg, "GPAC: %s", evt->message.message);
-
- Osmozilla_SetStatus(osmo->np_instance, msg);
- break;
- case GF_EVENT_PROGRESS:
- if (evt->progress.done == evt->progress.total) {
- Osmozilla_SetStatus(osmo->np_instance, "");
- osmo->download_progress = 100;
- } else {
- char *szTitle = (char *)"";
- if (evt->progress.progress_type==0) szTitle = (char *)"Buffer ";
- else if (evt->progress.progress_type==1)
- {
- szTitle = (char *)"Download ";
- osmo->download_progress = (int) (100.0*evt->progress.done) / evt->progress.total;
- }
- else if (evt->progress.progress_type==2) szTitle = (char *)"Import ";
-
- sprintf(msg, "(GPAC) %s: %02.2f", szTitle, (100.0*evt->progress.done) / evt->progress.total);
- Osmozilla_SetStatus(osmo->np_instance, msg);
- }
- break;
-
- /*IGNORE any scene size, just work with the size allocated in the parent doc*/
- case GF_EVENT_SCENE_SIZE:
- gf_term_set_size(osmo->term, osmo->width, osmo->height);
- break;
- /*window has been resized (full-screen plugin), resize*/
- case GF_EVENT_SIZE:
- osmo->width = evt->size.width;
- osmo->height = evt->size.height;
- gf_term_set_size(osmo->term, osmo->width, osmo->height);
- break;
- case GF_EVENT_CONNECT:
- osmo->is_connected = evt->connect.is_connected;
- break;
- case GF_EVENT_DURATION:
- osmo->can_seek = evt->duration.can_seek;
- osmo->duration = evt->duration.duration;
- break;
- case GF_EVENT_DBLCLICK:
- gf_term_set_option(osmo->term, GF_OPT_FULLSCREEN, !gf_term_get_option(osmo->term, GF_OPT_FULLSCREEN));
- break;
- case GF_EVENT_NAVIGATE_INFO:
- strcpy(msg, evt->navigate.to_url);
- Osmozilla_SetStatus(osmo->np_instance, msg);
- break;
- case GF_EVENT_NAVIGATE:
- if (gf_term_is_supported_url(osmo->term, evt->navigate.to_url, GF_TRUE, osmo->disable_mime ? GF_TRUE : GF_FALSE)) {
- gf_term_navigate_to(osmo->term, evt->navigate.to_url);
- return GF_TRUE;
- } else {
- u32 i;
- char *target = (char *)"_self";
-
- for (i=0; i<evt->navigate.param_count; i++) {
- if (!strcmp(evt->navigate.parameters[i], "_parent")) target = (char *)"_parent";
- else if (!strcmp(evt->navigate.parameters[i], "_blank")) target = (char *)"_blank";
- else if (!strcmp(evt->navigate.parameters[i], "_top")) target = (char *)"_top";
- else if (!strcmp(evt->navigate.parameters[i], "_new")) target = (char *)"_new";
- else if (!strnicmp(evt->navigate.parameters[i], "_target=", 8)) target = (char *) evt->navigate.parameters[i]+8;
- }
- Osmozilla_GetURL(osmo->np_instance, evt->navigate.to_url, target);
- return GF_TRUE;
- }
- break;
- }
- return GF_FALSE;
-}
-
-int Osmozilla_Initialize(Osmozilla *osmo, signed short argc, char* argn[], char* argv[])
-{
- const char *str;
- int i;
- osmo->auto_start = 1;
- osmo->use_gui = 0;
-
- /*options sent from plugin*/
- for(i=0; i<argc; i++) {
- if (!argn[i] || !argv[i]) continue;
- if (!stricmp(argn[i],"autostart") && (!stricmp(argv[i], "false") || !stricmp(argv[i], "no")) )
- osmo->auto_start = 0;
-
- else if (!stricmp(argn[i],"src") ) {
- if (osmo->url) gf_free(osmo->url);
- osmo->url = gf_strdup(argv[i]);
- }
- else if (!stricmp(argn[i],"use3d") && (!stricmp(argv[i], "true") || !stricmp(argv[i], "yes") ) ) {
- osmo->use_3d = 1;
- }
- else if (!stricmp(argn[i],"loop") && (!stricmp(argv[i], "true") || !stricmp(argv[i], "yes") ) ) {
- osmo->loop = 1;
- }
- else if (!stricmp(argn[i],"aspectratio")) {
- osmo->aspect_ratio = GF_ASPECT_RATIO_KEEP;
- if (!stricmp(argv[i], "keep")) osmo->aspect_ratio = GF_ASPECT_RATIO_KEEP;
- else if (!stricmp(argv[i], "16:9")) osmo->aspect_ratio = GF_ASPECT_RATIO_16_9;
- else if (!stricmp(argv[i], "4:3")) osmo->aspect_ratio = GF_ASPECT_RATIO_4_3;
- else if (!stricmp(argv[i], "fill")) osmo->aspect_ratio = GF_ASPECT_RATIO_FILL_SCREEN;
- }
- else if (!stricmp(argn[i],"gui") && (!stricmp(argv[i], "true") || !stricmp(argv[i], "yes") ) )
- osmo->use_gui = 1;
- }
-
- /*URL is not absolute, request new stream to mozilla - we don't pass absolute URLs since some may not be
- handled by gecko */
- if (osmo->url) {
- Bool absolute_url = GF_FALSE;
- if (strstr(osmo->url, "://")) absolute_url = GF_TRUE;
- else if (osmo->url[0] == '/') {
- FILE *test = gf_fopen(osmo->url, "rb");
- if (test) {
- absolute_url = GF_TRUE;
- gf_fclose(test);
- }
- }
- else if ((osmo->url[1] == ':') && ((osmo->url[2] == '\\') || (osmo->url[2] == '/'))) absolute_url = GF_TRUE;
-
- if (!absolute_url) {
- char *url = osmo->url;
- osmo->url = NULL;
- Osmozilla_GetURL(osmo->np_instance, url, NULL);
- gf_free(url);
- }
- }
-
- GF_SAFEALLOC(osmo->user, GF_User);
- osmo->user->config = gf_cfg_init(NULL, NULL);
- /*need to have a valid cfg file for now*/
- if (!osmo->user->config) {
- gf_free(osmo->user);
- osmo->user = NULL;
-#ifdef WIN32
- MessageBox(NULL, "GPAC CONFIGURATION FILE NOT FOUND OR INVALID", "OSMOZILLA FATAL ERROR", MB_OK);
-#else
- fprintf(stdout, "OSMOZILLA FATAL ERROR\nGPAC CONFIGURATION FILE NOT FOUND OR INVALID\n");
-#endif
- return 0;
- }
-
- osmo->user->modules = gf_modules_new(NULL, osmo->user->config);
- if (!gf_modules_get_count(osmo->user->modules)) {
- if (osmo->user->modules) gf_modules_del(osmo->user->modules);
- gf_free(osmo->user);
- osmo->user = NULL;
-#ifdef WIN32
- MessageBox(NULL, "GPAC MODULES NOT FOUND", "OSMOZILLA FATAL ERROR", MB_OK);
-#else
- fprintf(stdout, "OSMOZILLA FATAL ERROR\nGPAC MODULES NOT FOUND\n");
-#endif
- return 0;
- }
-
- osmo->user->opaque = osmo;
- osmo->user->EventProc = Osmozilla_EventProc;
-
- /*always fetch mime ? Check with anchor examples*/
- osmo->disable_mime = 0;
- str = gf_cfg_get_key(osmo->user->config, "General", "NoMIMETypeFetch");
- if (str && !strcmp(str, "yes")) osmo->disable_mime = 0;
- /*check log file*/
- str = gf_cfg_get_key(osmo->user->config, "General", "LogFile");
- if (str) {
- osmo->logs = gf_fopen(str, "wt");
- if (osmo->logs) gf_log_set_callback(osmo->logs, osmozilla_do_log);
- }
-
- /*setup logs*/
- if (gf_log_set_tools_levels(gf_cfg_get_key(osmo->user->config, "General", "Logs")) != GF_OK)
- fprintf(stdout, "Osmozilla: invalid log level specified\n");
-
- fprintf(stdout, "Osmozilla initialized\n");
- return 1;
-}
-
-int Osmozilla_SetWindow(Osmozilla *osmo, void *os_wnd_handle, void *os_wnd_display, unsigned int width, unsigned int height)
-{
- const char *gui;
-
- if (!osmo->user) return 0;
-
- if (osmo->window_set) {
- osmo->width = width;
- osmo->height = height;
- if (osmo->is_connected) gf_term_set_size(osmo->term, osmo->width, osmo->height);
- return 1;
- }
- if (!os_wnd_handle) return 0;
-
- osmo->width = width;
- osmo->height = height;
-
- osmo->user->os_window_handler = os_wnd_handle;
- osmo->user->os_display = os_wnd_display;
-
- /*Everything is now setup, create the terminal*/
- fprintf(stdout, "Creating Osmozilla terminal\n");
- osmo->term = gf_term_new(osmo->user);
- if (!osmo->term) return 0;
- fprintf(stdout, "Osmozilla terminal created\n");
-
- gf_term_set_option(osmo->term, GF_OPT_ASPECT_RATIO, osmo->aspect_ratio);
- osmo->window_set = 1;
-
-#ifdef XP_WIN
- SetFocus((HWND)os_wnd_handle);
-#endif
-
- /*stream not ready*/
- if (!osmo->url || !osmo->auto_start) {
- fprintf(stdout, "Osmozilla ready - not connecting to %s yet\n", osmo->url);
- return 1;
- }
-
- /*connect from 0 and pause if not autoplay*/
- gui = gf_cfg_get_key(osmo->user->config, "General", "StartupFile");
- if (gui && osmo->use_gui) {
- gf_cfg_set_key(osmo->user->config, "Temp", "BrowserMode", "yes");
- gf_cfg_set_key(osmo->user->config, "Temp", "GUIStartupFile", osmo->url);
- gf_term_connect(osmo->term, gui);
- } else {
- gf_term_connect(osmo->term, osmo->url);
- }
- fprintf(stdout, "Osmozilla connected to %s\n", osmo->url);
- return 1;
-}
-
-char *Osmozilla_GetVersion()
-{
- return (char *) "GPAC Plugin " GPAC_FULL_VERSION " for NPAPI compatible Web Browsers. For more information go to <a href=\"http://gpac.io\">GPAC website</a>";
-}
-
-void Osmozilla_ConnectTo(Osmozilla *osmo, const char *url)
-{
- if (!osmo->user) return;
-
- if ( osmo->url && !strcmp(url, osmo->url))
- return;
-
- fprintf(stdout, "Osmozilla connecting to %s\n", url);
-
- if (osmo->url) gf_free(osmo->url);
- osmo->url = gf_strdup(url);
-
- /*connect from 0 and pause if not autoplay*/
- if (osmo->auto_start) {
- const char *gui = gf_cfg_get_key(osmo->user->config, "General", "StartupFile");
- if (gui && osmo->use_gui) {
- gf_cfg_set_key(osmo->user->config, "Temp", "BrowserMode", "yes");
- gf_cfg_set_key(osmo->user->config, "Temp", "GUIStartupFile", url);
- gf_term_connect(osmo->term, gui);
- } else {
- gf_term_connect(osmo->term, url);
- }
- }
- fprintf(stdout, "Osmozilla connected to %s\n", url);
-}
-
-void Osmozilla_Pause(Osmozilla *osmo)
-{
- if (osmo->term) {
- if (gf_term_get_option(osmo->term, GF_OPT_PLAY_STATE) == GF_STATE_PAUSED) {
- gf_term_set_option(osmo->term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
- } else {
- gf_term_set_option(osmo->term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
- }
- }
-}
-
-void Osmozilla_Play(Osmozilla *osmo)
-{
- if (!osmo->is_connected) {
- if (osmo->url) gf_term_connect(osmo->term, (const char *) osmo->url);
- } else {
- gf_term_set_option(osmo->term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
- }
-}
-
-void Osmozilla_Stop(Osmozilla *osmo)
-{
- if (osmo->term) gf_term_disconnect(osmo->term);
-}
-
-#ifdef XP_WIN
-PBITMAPINFO CreateBitmapInfoStruct(GF_VideoSurface *pfb)
-{
- PBITMAPINFO pbmi;
- WORD cClrBits;
-
- cClrBits = 32;
-
- pbmi = (PBITMAPINFO) LocalAlloc(LPTR,
- sizeof(BITMAPINFOHEADER));
-
- pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- pbmi->bmiHeader.biWidth = pfb->width;
- pbmi->bmiHeader.biHeight = 1;
- pbmi->bmiHeader.biPlanes = 1;
- pbmi->bmiHeader.biBitCount = cClrBits;
-
- pbmi->bmiHeader.biCompression = BI_RGB;
- pbmi->bmiHeader.biSizeImage = ((pbmi->bmiHeader.biWidth * cClrBits +31) & ~31) /8
- * pbmi->bmiHeader.biHeight;
- pbmi->bmiHeader.biClrImportant = 0;
- return pbmi;
-}
-#endif
-
-void Osmozilla_Print(Osmozilla *osmo, unsigned int is_embed, void *os_print_dc, unsigned int target_x, unsigned int target_y, unsigned int target_width, unsigned int target_height)
-{
- if (is_embed) {
-#ifdef XP_MACOS
- /*
- os_print_dc contains a THPrint reference on MacOS
- */
- }
-#endif // XP_MACOS
-#ifdef XP_UNIX
- /*
- os_print_dc contains a NPPrintCallbackStruct on Unix and
- the plug-in location and size in the NPWindow are in page coordinates (720/ inch), but the printer requires point coordinates (72/inch)
- */
-#endif // XP_UNIX
-#ifdef XP_WIN
- /*
- The coordinates for the window rectangle are in TWIPS format.
- This means that you need to convert the x-y coordinates using the Windows API call DPtoLP when you output text
- */
- GF_VideoSurface fb;
- u32 xsrc, ysrc;
- u16 src_16;
- char *src;
- float deltay;
- int ysuiv = 0;
- char *ligne;
- BITMAPINFO *infoSrc;
- HDC pDC = (HDC)os_print_dc;
- /*lock the source buffer */
- gf_term_get_screen_buffer(osmo->term, &fb);
- infoSrc = CreateBitmapInfoStruct(&fb);
- deltay = (float)target_height/(float)fb.height;
- ligne = (char *) LocalAlloc(GMEM_FIXED, fb.width*4);
- for (ysrc=0; ysrc<fb.height; ysrc++) {
- int ycrt, delta;
- char *dst = (char*)ligne;
- src = fb.video_buffer + ysrc * fb.pitch_y;
- for (xsrc=0; xsrc<fb.width; xsrc++)
- {
- switch (fb.pixel_format) {
- case GF_PIXEL_RGB_32:
- case GF_PIXEL_ARGB:
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- src+=4;
- break;
- case GF_PIXEL_BGR_32:
- case GF_PIXEL_RGBA:
- dst[0] = src[3];
- dst[1] = src[2];
- dst[2] = src[1];
- src+=4;
- break;
- case GF_PIXEL_RGB_24:
- dst[0] = src[2];
- dst[1] = src[1];
- dst[2] = src[0];
- src+=3;
- break;
- case GF_PIXEL_BGR_24:
- dst[0] = src[2];
- dst[1] = src[1];
- dst[2] = src[0];
- src+=3;
- break;
- case GF_PIXEL_RGB_565:
- src_16 = * ( (u16 *)src );
- dst[2] = (src_16 >> 8) & 0xf8;
- dst[2] += dst[2]>>5;
- dst[1] = (src_16 >> 3) & 0xfc;
- dst[1] += dst[1]>>6;
- dst[0] = (src_16 << 3) & 0xf8;
- dst[0] += dst[0]>>5;
- src+=2;
- break;
- case GF_PIXEL_RGB_555:
- src_16 = * (u16 *)src;
- dst[2] = (src_16 >> 7) & 0xf8;
- dst[2] += dst[2]>>5;
- dst[1] = (src_16 >> 2) & 0xf8;
- dst[1] += dst[1]>>5;
- dst[0] = (src_16 << 3) & 0xf8;
- dst[0] += dst[0]>>5;
- src+=2;
- break;
- }
- dst += 4;
- }
- ycrt = ysuiv;
- ysuiv = (u32) ( ((float)ysrc+1.0)*deltay);
- delta = ysuiv-ycrt;
- StretchDIBits(
- pDC, target_x, target_y, target_width,
- delta,
- 0, 0, fb.width, 1,
- ligne, infoSrc, DIB_RGB_COLORS, SRCCOPY);
- }
-
- /*unlock GPAC frame buffer */
- gf_term_release_screen_buffer(osmo->term, &fb);
- /* gf_free temporary objects */
- GlobalFree(ligne);
- LocalFree(infoSrc);
-#endif // XP_WIN
-
- return;
-}
-
-/*TODO - this is full print, present the print dialog and manage the print*/
-}
-
-void Osmozilla_Update(Osmozilla *osmo, const char *type, const char *commands)
-{
- if (osmo->term) {
- GF_Err e = gf_term_scene_update(osmo->term, (char *) type, (char *) commands);
- if (e) {
- char szMsg[1024];
- sprintf((char *)szMsg, "GPAC: Error applying update (%s)", gf_error_to_string(e) );
- Osmozilla_SetStatus(osmo->np_instance, szMsg);
- }
- }
-}
-
-void Osmozilla_QualitySwitch(Osmozilla *osmo, int switch_up)
-{
- if (osmo->term)
- gf_term_switch_quality(osmo->term, switch_up ? GF_TRUE : GF_FALSE);
-}
-
-void Osmozilla_SetURL(Osmozilla *osmo, const char *url)
-{
- if (osmo->term) {
- if (osmo->url) gf_free(osmo->url);
- osmo->url = gf_strdup(url);
- gf_term_connect(osmo->term, osmo->url);
- }
-}
-
-int Osmozilla_GetDownloadProgress(Osmozilla *osmo)
-{
- if (osmo->term)
- return osmo->download_progress;
- return 0;
-}
+++ /dev/null
-LIBRARY nposmozilla
-
-EXPORTS
- NP_GetEntryPoints @1
- NP_Initialize @2
- NP_Shutdown @3
+++ /dev/null
-/*
-* GPAC - Multimedia Framework C SDK
-*
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
-* All rights reserved
-*
-* This file is part of GPAC / Osmozilla NPAPI plugin
-*
-* GPAC is free software; you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License as published by
-* the Free Software Foundation; either version 2, or (at your option)
-* any later version.
-*
-* GPAC is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; see the file COPYING. If not, write to
-* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-*/
-
-#ifndef __OSMOZILLA_H__
-#define __OSMOZILLA_H__
-
-
-/*DO NOT INCLUDE ANY GPAC FILE IN THIS HEADER, IT CAUSES TYPE REDEFINITION CONFLICT ON OSX*/
-typedef struct _tag_terminal GF_Terminal;
-typedef struct _tag_user GF_User;
-
-#include <stdio.h>
-
-
-typedef struct _NPP *NPP;
-
-typedef struct __tag_osmozilla
-{
- /*plugiun & window info*/
- NPP np_instance;
- int window_set;
- unsigned int height, width;
-
- int supports_xembed;
- /*GPAC term*/
- GF_User *user;
- GF_Terminal *term;
-
- /*general options*/
- unsigned int loop, auto_start, is_connected, use_3d, disable_mime;
- unsigned int aspect_ratio;
-
- /*the URL we are connected to*/
- char *url;
- /*timing info of current url*/
- double duration;
- char can_seek;
- int use_gui;
- int download_progress;
-
- /*log file if any*/
- FILE *logs;
-
-#ifdef GECKO_XPCOM
- void *scriptable_peer;
-#else
- struct NPObject *script_obj;
-#endif
-
-} Osmozilla;
-
-
-#endif // __OSMOZILLA_H__
+++ /dev/null
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "winresrc.h"
-
-/*do not include setup.h*/
-#define _GF_SETUP_H_
-#include <gpac/tools.h>
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Neutral resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
-#ifdef _WIN32
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,1,0
- PRODUCTVERSION 1,0,1,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904e4"
- BEGIN
- VALUE "Comments", "\0"
- VALUE "CompanyName", " \0"
- VALUE "FileDescription", "Osmozilla allows playback of many media and rich media files. For more information, visit <a href=""http://gpac.io"">gpac.io</a>\0"
- VALUE "FileExtents", "*|aac|wrl,wrl.gz|x3dv,x3dv.gz,x3dvz|x3d,x3d.gz,x3dz|svg,svg.gz,svgz|mpg,mpeg,mp2,mpa,mpe,mpv2|asf,wma,wmv,asx,asr|avi|mp4,mpg4|mp4|m4a|3gp,3gpp|3gp,3gpp|3g2,3gp2|3g2,3gp2|mp2,mp3,mpga,mpega|ogg|sdp\0"
- VALUE "FileOpenName", "GPAC Plugin|AAC Music|VRML World|X3D/VRML World|X3D/XML World|SVG Document|MPEG Video|WindowsMedia Movies|AVI Movies|MPEG-4 Videos|MPEG-4 Movies|MPEG-4 Music|3GPP Movies|3GPP Music|3GPP2 Movies|3GPP2 Music|MP3 Music|OGG Movies|SDP Session\0"
- VALUE "FileVersion", GPAC_VERSION"-rev"GPAC_GIT_REVISION"\0"
- VALUE "InternalName", "nposmozilla\0"
- VALUE "LegalCopyright", "Copyright � Telecom ParisTech 2005-2007\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "MIMEType", "application/x-gpac|audio/aac|model/vrml|model/x3d+vrml|model/x3d+xml|image/svg+xml|video/mpeg|video/x-ms-asf|video/avi|video/mp4|application/mp4|audio/mp4|video/3gpp|audio/3gpp|video/3gpp2|audio/3gpp2|audio/mpeg|application/ogg|application/sdp\0"
- VALUE "OriginalFilename", "nposmozilla.dll\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Osmozilla - GPAC Plugin for Mozilla\0"
- VALUE "ProductVersion", GPAC_VERSION"-rev"GPAC_GIT_REVISION"\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1252
- END
-END
-
-#endif // !_MAC
-
-#endif // Neutral resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""winresrc.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{A0288B75-0D95-4106-A3A7-779A891E8FEF}</ProjectGuid>\r
- <RootNamespace>osmozilla</RootNamespace>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>DynamicLibrary</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>\r
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>\r
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</EmbedManifest>\r
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</EmbedManifest>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nposmozilla</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nposmozilla</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nposmozilla</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nposmozilla</TargetName>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Midl>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TargetEnvironment>Win32</TargetEnvironment>\r
- <TypeLibraryName>.\obj/osmozilla_deb/osmozilla.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>..\..\extra_lib\include\xulrunner-sdk\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;XP_WIN32;XP_WIN;_X86_;_WINDOWS;_USRDLL;NPBASIC_EXPORTS;MOZILLA_STRICT_API;XPCOM_GLUE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>.\obj/osmozilla_deb/osmozilla.pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>advapi32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <ModuleDefinitionFile>..\..\applications\osmozilla\osmozilla.def</ModuleDefinitionFile>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <ImportLibrary>.\obj/osmozilla_deb/nposmozilla.lib</ImportLibrary>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>.\obj/osmozilla_deb/osmozilla.bsc</OutputFile>\r
- </Bscmake>\r
- <PostBuildEvent>\r
- <Command>copy ..\..\applications\osmozilla\nsIOsmozilla.xpt_w32 ..\..\bin\$(Platform)\$(Configuration)\nposmozilla.xpt</Command>\r
- </PostBuildEvent>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <Midl>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TypeLibraryName>.\obj/osmozilla_deb/osmozilla.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>..\..\extra_lib\include\xulrunner-sdk\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;XP_WIN32;XP_WIN;_X86_;_WINDOWS;_USRDLL;NPBASIC_EXPORTS;MOZILLA_STRICT_API;XPCOM_GLUE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>.\obj/osmozilla_deb/osmozilla.pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>advapi32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <ModuleDefinitionFile>..\..\applications\osmozilla\osmozilla.def</ModuleDefinitionFile>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <ImportLibrary>.\obj/osmozilla_deb/nposmozilla.lib</ImportLibrary>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>.\obj/osmozilla_deb/osmozilla.bsc</OutputFile>\r
- </Bscmake>\r
- <PostBuildEvent>\r
- <Command>copy ..\..\applications\osmozilla\nsIOsmozilla.xpt_w32 ..\..\bin\$(Platform)\$(Configuration)\nposmozilla.xpt</Command>\r
- </PostBuildEvent>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Midl>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TargetEnvironment>Win32</TargetEnvironment>\r
- <TypeLibraryName>.\obj/osmozilla_rel/osmozilla.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>MaxSpeed</Optimization>\r
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>..\..\extra_lib\include\xulrunner-sdk\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;NPBASIC_EXPORTS;MOZILLA_STRICT_API;XP_WIN;_X86_;XPCOM_GLUE;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>.\obj/osmozilla_rel/osmozilla.pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\obj/osmozilla_rel/</AssemblerListingLocation>\r
- <ObjectFileName>.\obj/osmozilla_rel/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\obj/osmozilla_rel/</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>advapi32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <ModuleDefinitionFile>..\..\applications\osmozilla\osmozilla.def</ModuleDefinitionFile>\r
- <ProgramDatabaseFile>.\obj/osmozilla_rel/nposmozilla.pdb</ProgramDatabaseFile>\r
- <ImportLibrary>.\obj/osmozilla_rel/nposmozilla.lib</ImportLibrary>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- <PostBuildEvent>\r
- <Command>copy ..\..\applications\osmozilla\nsIOsmozilla.xpt_w32 ..\..\bin\$(Platform)\$(Configuration)\nposmozilla.xpt</Command>\r
- </PostBuildEvent>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <Midl>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MkTypLibCompatible>true</MkTypLibCompatible>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <TypeLibraryName>.\obj/osmozilla_rel/osmozilla.tlb</TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <InlineFunctionExpansion>Default</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>..\..\extra_lib\include\xulrunner-sdk\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;NPBASIC_EXPORTS;MOZILLA_STRICT_API;XP_WIN;_WIN64;XPCOM_GLUE;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>.\obj/osmozilla_rel/osmozilla.pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\obj/osmozilla_rel/</AssemblerListingLocation>\r
- <ObjectFileName>.\obj/osmozilla_rel/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\obj/osmozilla_rel/</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x0409</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>advapi32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <ModuleDefinitionFile>..\..\applications\osmozilla\osmozilla.def</ModuleDefinitionFile>\r
- <ProgramDatabaseFile>.\obj/osmozilla_rel/nposmozilla.pdb</ProgramDatabaseFile>\r
- <ImportLibrary>.\obj/osmozilla_rel/nposmozilla.lib</ImportLibrary>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>\r
- </Bscmake>\r
- <PostBuildEvent>\r
- <Command>copy ..\..\applications\osmozilla\nsIOsmozilla.xpt_w32 ..\..\bin\$(Platform)\$(Configuration)\nposmozilla.xpt</Command>\r
- </PostBuildEvent>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\applications\osmozilla\osmo_npapi.cpp" />\r
- <ClCompile Include="..\..\applications\osmozilla\osmozilla.cpp" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ResourceCompile Include="..\..\applications\osmozilla\osmozilla.rc">\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- </ResourceCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\applications\osmozilla\nsIOsmozilla.h" />\r
- <ClInclude Include="..\..\applications\osmozilla\osmo_npapi.h" />\r
- <ClInclude Include="..\..\applications\osmozilla\osmozilla.h" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="libgpac_dll.vcxproj">\r
- <Project>{d3540754-e0cf-4604-ac11-82de9bd4d814}</Project>\r
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-to regenerate plugin interface from IDL:
-
-xpidl -m header -I path_to\gecko-sdk\xpcom\idl nsIOsmozilla.idl
-xpidl -m typelib -I path_to\gecko-sdk\xpcom\idl nsIOsmozilla.idl
-xpt_link nposmozilla.xpt nsIOsmozilla.xpt
-
-This MUST be done for win32 and linux OSs independently, an .xpt file generated on one OS is not compatible with another OS...
-Please keep the w32 file "nsIOsmozilla.xpt_w32" and the linux one "nsIOsmozilla.xpt_linux" to bear with makefiles...
\ No newline at end of file
+++ /dev/null
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by osmozilla.rc
-//
-#define IDD_MAIN 101
-#define IDC_BUTTON_GO 1002
-#define IDC_STATIC_UA 1003
-#define IDC_BUTTON1 1005
-#define IDC_BUTTON_DONT 1005
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 102
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1006
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+++ /dev/null
-include ../../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/generators/WebGLGen
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= main.o
-
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=WGLGen$(EXE)
-else
-EXT=
-PROG=WGLGen
-endif
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o $@ $(OBJS) $(EXTRALIBS) -L../../../bin/gcc -L../../../extra_lib/lib/gcc -lgpac $(LDFLAGS)
-
-
-%.o: %.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-
-clean:
- rm -f $(OBJS) $(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Cyril Concolato
- * Copyright (c) Telecom ParisTech 2004-2012
- * All rights reserved
- *
- * This file is part of GPAC / SVG Scene Graph Generator sub-project
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/tools.h>
-#include <gpac/list.h>
-
-static void start_ctx(char *ctx_name, FILE **ifce_c, FILE **fun_c)
-{
- char szFile[GF_MAX_PATH];
- sprintf(szFile, "../../../src/jsmods/%s.c", ctx_name);
- FILE *res = gf_fopen(szFile, "wt");
- *ifce_c = res;
- *fun_c = gf_file_temp(NULL);
-
- fprintf(res, "/* !! AUTOGENERATED FILE - DO NOT MODIFY !! \n");
- fprintf(res, "\n%s implementation for QJS\n*/\n\n", ctx_name);
-}
-
-
-static void end_ctx(FILE *ifce_c, FILE *func_c, char *ctx_name)
-{
-
- fprintf(ifce_c, "static const JSCFunctionListEntry %s_funcs[] =\n\{\n", ctx_name);
- gf_fseek(func_c, 0, SEEK_SET);
- while (!feof(func_c)) {
- char szLine[4001];
- szLine[0] = 0;
- gf_fgets(szLine, 4000, func_c);
- gf_fputs(szLine, ifce_c);
- }
- gf_fclose(func_c);
- fprintf(ifce_c, "};\n");
- gf_fclose(ifce_c);
- gf_free(ctx_name);
-
-}
-
-static void put_const(FILE *fun_defs, char *c_name, char *c_val)
-{
- fprintf(fun_defs, "\tJS_PROP_INT32_DEF(\"%s\", %s, JS_PROP_CONFIGURABLE),\n", c_name, c_val);
-}
-static void put_fun(FILE *fun_defs, char *f_name)
-{
- fprintf(fun_defs, "\tJS_CFUNC_DEF(\"%s\", 0, wgl_%s),\n", f_name, f_name);
-}
-static void put_prop(FILE *fun_defs, char *ctx_name, char *pname, Bool is_readonly)
-{
- if (is_readonly) {
- fprintf(fun_defs, "\tJS_CGETSET_MAGIC_DEF(\"%s\", %s_getProperty, NULL, %s_PROP_%s),\n", pname, ctx_name, ctx_name, pname);
- } else {
- fprintf(fun_defs, "\tJS_CGETSET_MAGIC_DEF(\"%s\", %s_getProperty, %s_setProperty, %s_PROP_%s),\n", pname, ctx_name, ctx_name, ctx_name, pname);
- }
-}
-
-static const char *get_arg_type(char *arg_type, Bool *is_array)
-{
- *is_array = GF_FALSE;
- if (!strcmp(arg_type, "GLenum")) return "u32";
- if (!strcmp(arg_type, "DOMString")) return "const char *";
- if (!strcmp(arg_type, "DOMString?")) return "const char *";
- if (!strcmp(arg_type, "GLuint")) return "u32";
- if (!strcmp(arg_type, "GLint")) return "s32";
- if (!strcmp(arg_type, "GLuint")) return "u32";
- if (!strcmp(arg_type, "GLclampf")) return "Float";
- if (!strcmp(arg_type, "GLfloat")) return "Float";
- if (!strcmp(arg_type, "GLboolean")) return "Bool";
- if (!strcmp(arg_type, "boolean")) return "Bool";
- if (!strcmp(arg_type, "GLsizei")) return "u32";
- if (!strcmp(arg_type, "GLbitfield")) return "u32";
- if (!strcmp(arg_type, "GLshort")) return "s16";
- if (!strcmp(arg_type, "GLushort")) return "u16";
- if (!strcmp(arg_type, "GLsizeiptr")) return "u64";
- if (!strcmp(arg_type, "GLintptr")) return "u64";
- if (!strcmp(arg_type, "GLbyte")) return "s8";
- if (!strcmp(arg_type, "GLubyte")) return "u8";
- if (!strcmp(arg_type, "WebGLProgram?")) return "WebGLProgram";
- if (!strcmp(arg_type, "WebGLShader?")) return "WebGLShader";
- if (!strcmp(arg_type, "WebGLBuffer?")) return "WebGLBuffer";
- if (!strcmp(arg_type, "WebGLFramebuffer?")) return "WebGLFramebuffer";
- if (!strcmp(arg_type, "WebGLRenderbuffer?")) return "WebGLRenderbuffer";
- if (!strcmp(arg_type, "WebGLTexture?")) return "WebGLTexture";
- if (!strcmp(arg_type, "WebGLUniformLocation?")) return "WebGLUniformLocation";
- if (!strcmp(arg_type, "TexImageSource?")) return "TexImageSource";
- if (!strcmp(arg_type, "WebGLContextAttributes?")) return "WebGLContextAttributes";
- if (!strcmp(arg_type, "boolean?")) return "Bool";
- if (!strcmp(arg_type, "WebGLActiveInfo?")) return "JSValue";
-
- if (!strcmp(arg_type, "Float32Array")) {
- *is_array = GF_TRUE;
- return "Float *";
- }
- if (!strcmp(arg_type, "Int32Array")) {
- *is_array = GF_TRUE;
- return "s32 *";
- }
- if (!strcmp(arg_type, "sequence<DOMString>?")) {
- return "JSValue";
- }
- if (!strcmp(arg_type, "sequence<WebGLShader>?")) {
- return "JSValue";
- }
- if (!strcmp(arg_type, "ArrayBufferView")
- || !strcmp(arg_type, "ArrayBufferView?")
- || !strcmp(arg_type, "BufferDataSource?")
- ) {
- *is_array = GF_TRUE;
- return "u8 *";
- }
-
- if (!strcmp(arg_type, "object?")
- || !strcmp(arg_type, "WebGLShaderPrecisionFormat?")
- || !strcmp(arg_type, "any")
- ) {
- return NULL;
- }
-
- fprintf(stderr, "arg type %s not supported\n", arg_type);
- return "JSValue";
-}
-
-static void put_arg_get(FILE *ifce_c, char *fname, int idx, char *arg_type, char *arg_name)
-{
- Bool is_array;
- const char *native_type = get_arg_type(arg_type, &is_array);
- if (!native_type) return;
-
- if (!strcmp(native_type, "Bool")) {
- fprintf(ifce_c, "\tWGL_GET_BOOL(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(native_type, "s32")) {
- fprintf(ifce_c, "\tWGL_GET_S32(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(native_type, "u32")) {
- fprintf(ifce_c, "\tWGL_GET_U32(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(native_type, "u64")) {
- fprintf(ifce_c, "\tWGL_GET_U64(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(native_type, "s64")) {
- fprintf(ifce_c, "\tWGL_GET_S64(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(native_type, "s16")) {
- fprintf(ifce_c, "\tWGL_GET_S16(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(native_type, "u16")) {
- fprintf(ifce_c, "\tWGL_GET_U16(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(arg_type, "GLclampf")) {
- fprintf(ifce_c, "\tWGL_GET_FLOAT_CLAMP(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(native_type, "Float")) {
- fprintf(ifce_c, "\tWGL_GET_FLOAT(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(native_type, "const char *")) {
- fprintf(ifce_c, "\tWGL_GET_STRING(%s, argv[%d]);\n", arg_name, idx);
- }
- else if (!strcmp(native_type, "WebGLProgram")
- || !strcmp(native_type, "WebGLShader")
- || !strcmp(native_type, "WebGLBuffer")
- || !strcmp(native_type, "WebGLFramebuffer")
- || !strcmp(native_type, "WebGLRenderbuffer")
- || !strcmp(native_type, "WebGLTexture")
- || !strcmp(native_type, "WebGLUniformLocation")
- ) {
- fprintf(ifce_c, "\tWGL_GET_GLID(%s, argv[%d], %s_class_id);\n", arg_name, idx, native_type);
- }
-
- else if (!strcmp(arg_type, "BufferDataSource?")) {
- fprintf(ifce_c, "\tif(!JS_IsObject(argv[%d])) {\n", idx);
- fprintf(ifce_c, "\t\tWGL_GET_U32(%s_size, argv[%d]);\n", arg_name, idx);
- fprintf(ifce_c, "\t} else {\n");
- fprintf(ifce_c, "\t\t%s = wgl_GetArrayBuffer(ctx, &%s_size, argv[%d]);\n", arg_name, arg_name, idx);
- fprintf(ifce_c, "\t}\n");
- }
- else if (is_array && !strcmp(native_type, "u8 *")) {
- fprintf(ifce_c, "\tif(!JS_IsArray(ctx, argv[%d])) return js_throw_err(ctx, WGL_INVALID_VALUE);\n", idx);
- fprintf(ifce_c, "\t%s = wgl_GetArrayBuffer(ctx, &%s_size, argv[%d]);\n", arg_name, arg_name, idx);
- }
- else if (is_array && (!strcmp(native_type, "Float *") || !strcmp(native_type, "s32 *")) ) {
- u32 vlen = 1;
- if (strstr(fname, "2fv")) vlen = 2;
- else if (strstr(fname, "3fv")) vlen = 3;
- else if (strstr(fname, "4fv")) vlen = 4;
-
- if (!strcmp(native_type, "s32 *"))
- fprintf(ifce_c, "\tif (!WGL_LOAD_INT32_VEC(ctx, argv[%d], (s32 **) &%s, &%s_size, %d)) return js_throw_err(ctx, WGL_INVALID_VALUE);;\n", idx, arg_name, arg_name, vlen);
- else {
- Bool is_matrix = GF_FALSE;
- if (strstr(fname, "Matrix")) is_matrix = GF_TRUE;
- if (strstr(fname, "vertexAttrib")) {
- fprintf(ifce_c, "\tif (!WGL_LOAD_FLOAT_VEC(ctx, argv[%d], (Float **) &%s, NULL, %d, %d)) return js_throw_err(ctx, WGL_INVALID_VALUE);\n", idx, arg_name, vlen, is_matrix);
- } else {
- fprintf(ifce_c, "\tif (!WGL_LOAD_FLOAT_VEC(ctx, argv[%d], (Float **) &%s, &%s_size, %d, %d)) return js_throw_err(ctx, WGL_INVALID_VALUE);\n", idx, arg_name, arg_name, vlen, is_matrix);
- }
- }
- }
- else {
- fprintf(stderr, "arg type %s not supported\n", arg_type);
- }
-
-}
-
-static void put_arg_decl(FILE *ifce_c, char *fname, char *arg_type, char *arg_name)
-{
- Bool is_array = GF_FALSE;
- const char *native_type = get_arg_type(arg_type, &is_array);
- if (!native_type)
- return;
-
- if (is_array) {
- if (strstr(fname, "vertexAttrib1fv")) {
- fprintf(ifce_c, "\tFloat %s[1];\n", arg_name);
- } else if (strstr(fname, "vertexAttrib2fv")) {
- fprintf(ifce_c, "\tFloat %s[2];\n", arg_name);
- } else if (strstr(fname, "vertexAttrib3fv")) {
- fprintf(ifce_c, "\tFloat %s[3];\n", arg_name);
- } else if (strstr(fname, "vertexAttrib4fv")) {
- fprintf(ifce_c, "\tFloat %s[4];\n", arg_name);
- } else {
- fprintf(ifce_c, "\t%s %s = NULL;\n", native_type, arg_name);
- fprintf(ifce_c, "\tu32 %s_size = 0;\n", arg_name);
- }
- } else {
- if (strstr(arg_name, " *"))
- fprintf(ifce_c, "\t%s %s = NULL;\n", native_type, arg_name);
- else if (!strcmp(native_type, "JSValue"))
- fprintf(ifce_c, "\t%s %s = JS_UNDEFINED;\n", native_type, arg_name);
- else if (!strncmp(native_type, "WebGL", 5))
- fprintf(ifce_c, "\tGLuint %s = 0;\n", arg_name);
- else
- fprintf(ifce_c, "\t%s %s = 0;\n", native_type, arg_name);
- }
-}
-/*all functions that cannot be mapped directly due to to heavy syntax pacthing or our own hacking*/
-static const char *not_autogen_funcs = "getContextAttributes,isContextLost,getSupportedExtensions,getExtension,getBufferParameter,getParameter,getFramebufferAttachmentParameter,getProgramParameter,getRenderbufferParameter,getShaderParameter,getShaderPrecisionFormat,getProgramInfoLog,getShaderParameter,getShaderInfoLog,getShaderSource,getTexParameter,getUniform,getVertexAttrib,getVertexAttribOffset,readPixels,shaderSource,texImage2D,texSubImage2D,useProgram,activeTexture,bindTexture,getUniformLocation,createTexture,bindFramebuffer";
-
-static void wrap_func(FILE *ifce_c, char *fname, char *fun_def)
-{
- char *sep, *nsep;
- u32 len, i, nb_args;
- u32 first_char;
- u32 ret_type=0;
- Bool is_create=GF_FALSE;
- Bool is_delete_fun=GF_FALSE;
- char *ret_val=NULL, *exc_value=NULL, *arg_type[50], *arg_name[50];
-
- if (strstr(not_autogen_funcs, fname)) {
- fprintf(ifce_c, "\nstatic JSValue wgl_%s(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv);\n", fname);
- return;
- }
-
- fprintf(ifce_c, "\nstatic JSValue wgl_%s(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)\n{\n", fname);
-
- nb_args = 0;
- memset(arg_type, 0, sizeof(char *)*50);
- memset(arg_name, 0, sizeof(char *)*50);
-
- sep = fun_def;
- while (sep[0]==' ') sep++;
- /*parse exception*/
- if (sep[0]=='[') {
- nsep = strchr(sep, ']');
- assert(nsep);
- nsep[0]=0;
- exc_value = gf_strdup(sep);
- nsep[0]=']';
- sep = nsep+1;
- while (sep[0]==' ') sep++;
- }
- /*parse return value*/
- nsep = strchr(sep, ' ');
- assert(nsep);
- nsep[0] = 0;
- ret_val = strdup(sep);
- sep = nsep+1;
- len = strlen(fname);
- assert(!strncmp(sep, fname, len) );
- sep += len+1;
- while (sep) {
- char *next_arg;
- nsep = strchr(sep, ',');
- if (!nsep) {
- nsep = strchr(sep, ')');
- if (!nsep) break;
- }
- nsep[0]=0;
- next_arg = nsep+1;
-
- if (nb_args>=50) {
- assert(0);
- }
- nsep = strchr(sep, ' ');
- if (!nsep)
- break;
- assert(nsep);
- nsep[0] = 0;
- arg_type[nb_args] = gf_strdup(sep);
- arg_name[nb_args] = gf_strdup(nsep+1);
- nb_args++;
- sep = next_arg;
- while (sep[0]==' ') sep++;
- }
-
- fprintf(ifce_c, "\tJSValue ret_val_js = JS_UNDEFINED;\n");
-
- for (i=0; i<nb_args; i++) {
- put_arg_decl(ifce_c, fname, arg_type[i], arg_name[i]);
- }
- fprintf(ifce_c, "\tWGL_CHECK_CONTEXT\n");
-
- if (nb_args) {
- fprintf(ifce_c, "\tif (argc<%d) return js_throw_err(ctx, WGL_INVALID_VALUE);\n", nb_args);
- for (i=0; i<nb_args; i++) {
- put_arg_get(ifce_c, fname, i, arg_type[i], arg_name[i]);
- }
- }
-
- /*hack a few funcs with different signatures*/
- if (!strcmp(fname, "getActiveAttrib")) {
- fprintf(ifce_c, "\tret_val_js = webgl_getActiveAttrib(ctx, program, index);\n\treturn ret_val_js;\n");
- goto fun_done;
- }
- if (!strcmp(fname, "getActiveUniform")) {
- fprintf(ifce_c, "\tret_val_js = webgl_getActiveUniform(ctx, program, index);\n\treturn ret_val_js;\n");
- goto fun_done;
- }
- if (!strcmp(fname, "getAttachedShaders")) {
- fprintf(ifce_c, "\tret_val_js = webgl_getAttachedShaders(ctx, JS_GetOpaque(this_val, WebGLRenderingContextBase_class_id), program);\n\treturn ret_val_js;\n");
- goto fun_done;
- }
- if (!strcmp(fname, "getBufferParameter")) {
- fprintf(ifce_c, "\tret_val_js = webgl_getBufferParameter(ctx, target, pname);\n\treturn ret_val_js;\n");
- goto fun_done;
- }
-
- if (ret_val && strcmp(ret_val, "void")) {
- if (!strcmp(fname, "createBuffer") || !strcmp(fname, "createFramebuffer") || !strcmp(fname, "createTexture") || !strcmp(fname, "createRenderbuffer")) {
- fprintf(ifce_c, "\tGF_WebGLObject *wglo;\n");
- is_create = GF_TRUE;
- ret_type = 2;
-
- } else if (!strcmp(fname, "createProgram") || !strcmp(fname, "createShader")) {
- fprintf(ifce_c, "\tGF_WebGLObject *wglo;\n");
- ret_type = 2;
- } else {
- put_arg_decl(ifce_c, fname, ret_val, "ret_val");
- ret_type = 1;
- }
- }
-
- first_char = fname[0];
- if ((first_char < 'A') || (first_char > 'Z')) {
- first_char += 'A' - 'a';
- }
-
- if (is_create) {
- fprintf(ifce_c, "\tGF_SAFEALLOC(wglo, GF_WebGLObject);\n");
- fprintf(ifce_c, "\tif (!wglo) return js_throw_err(ctx, WGL_OUT_OF_MEMORY);\n");
- fprintf(ifce_c, "\twglo->par_ctx = JS_GetOpaque(this_val, WebGLRenderingContextBase_class_id);\n");
- fprintf(ifce_c, "\tglGen%ss(1, &wglo->gl_id", fname+6);
- } else {
- if (!strcmp(fname, "deleteShader") || !strcmp(fname, "deleteProgram")) {
- is_delete_fun=GF_TRUE;
- }
- if (!strcmp(fname, "deleteBuffer") || !strcmp(fname, "deleteTexture") || !strcmp(fname, "deleteFramebuffer") || !strcmp(fname, "deleteRenderbuffer")) {
- fprintf(ifce_c, "\tgl%c%ss(1, &", first_char, fname+1);
- is_delete_fun=GF_TRUE;
- }
- else if (!strcmp(fname, "createProgram") || !strcmp(fname, "createShader")) {
- fprintf(ifce_c, "\tGF_SAFEALLOC(wglo, GF_WebGLObject);\n");
- fprintf(ifce_c, "\tif (!wglo) return js_throw_err(ctx, WGL_OUT_OF_MEMORY);\n");
- fprintf(ifce_c, "\twglo->par_ctx = JS_GetOpaque(this_val, WebGLRenderingContextBase_class_id);\n");
- fprintf(ifce_c, "\twglo->gl_id = gl%c%s(", first_char, fname+1);
- } else if (!strcmp(fname, "clearDepth") || !strcmp(fname, "depthRange")) {
- fprintf(ifce_c, "#if defined(GPAC_USE_GLES2)\n");
- fprintf(ifce_c, "\tgl%c%sf(\n", first_char, fname+1);
- fprintf(ifce_c, "#else\n");
- fprintf(ifce_c, "\tgl%c%s(\n", first_char, fname+1);
- fprintf(ifce_c, "#endif\n\t\t");
- } else {
- fprintf(ifce_c, "\t");
- if (ret_type==1) {
- fprintf(ifce_c, "ret_val = ");
- }
- if (!strncmp(fname, "uniform", 7)) {
-
- fprintf(ifce_c, "/*hack for GPAC textures, we create uniforms with loc -2 for such textures*/\n\tif ((s32) location>=0)\n\t\t");
- }
- fprintf(ifce_c, "gl%c%s(", first_char, fname+1);
- }
- }
-
- Bool prev_is_transpose = GF_FALSE;
- for (i=0; i<nb_args; i++) {
- Bool is_array;
- get_arg_type(arg_type[i], &is_array);
-
- if (!strcmp(arg_name[i], "transpose")) {
- fprintf(ifce_c, "%s_size, ", arg_name[i+1]);
- prev_is_transpose = GF_TRUE;
- }
- else if (prev_is_transpose) {
- is_array = GF_FALSE;
- }
-
- if (is_array && (
- !strcmp(fname, "bufferData") || !strcmp(fname, "bufferSubData")
- || !strcmp(fname, "compressedTexImage2D") || !strcmp(fname, "compressedTexSubImage2D")
- || !strncmp(fname, "uniform", 7)
-
- )) {
- is_array = GF_FALSE;
- fprintf(ifce_c, "%s_size, ", arg_name[i]);
- }
- if (!strcmp(arg_type[i], "GLintptr") && (!strcmp(fname, "vertexAttribPointer") || !strcmp(fname, "drawElements")) ) {
- fprintf(ifce_c, "(void *)");
- }
-
- fprintf(ifce_c, "%s", arg_name[i]);
-
- if (is_array) {
- if (strstr(fname, "vertexAttrib1fv")) {}
- else if (strstr(fname, "vertexAttrib2fv")) {}
- else if (strstr(fname, "vertexAttrib3fv")) {}
- else if (strstr(fname, "vertexAttrib4fv")) {}
- else {
- fprintf(ifce_c, ", %s_size", arg_name[i]);
- }
- }
- if (i+1<nb_args)
- fprintf(ifce_c, ", ");
- }
-
- fprintf(ifce_c, ");\n");
- if (is_delete_fun) {
- Bool is_array;
- const char *nat_type = get_arg_type(arg_type[0], &is_array);
- fprintf(ifce_c, "\t{\n\tGF_WebGLObject *glo = JS_GetOpaque(argv[0], %s_class_id);\n\tif (glo) {\n\tglo->gl_id=0;\n", nat_type);
- fprintf(ifce_c, "\tJS_FreeValue(ctx, glo->obj);\n\tglo->obj = JS_UNDEFINED;\n\tgf_list_del_item(glo->par_ctx->all_objects, glo);\n");
- fprintf(ifce_c, "\t}\n\t}\n");
- }
-
- if (ret_type==1) {
-
- if (!strcmp(ret_val, "GLenum") || !strcmp(ret_val, "GLint")) {
- fprintf(ifce_c, "\tret_val_js = JS_NewInt32(ctx, ret_val);\n");
- } else if (!strcmp(ret_val, "GLboolean") ) {
- fprintf(ifce_c, "\tret_val_js = JS_NewBool(ctx, ret_val);\n");
- } else if (!strcmp(ret_val, "WebGLProgram") ) {
- fprintf(ifce_c, "\tret_val_js = JS_NewObjectClass(ctx, WebGLProgram_class_id);\n");
- fprintf(ifce_c, "\tJS_SetOpaque(ret_val_js, wglo);\n");
- } else {
- fprintf(stderr, "retval %s not supported in %s\n", ret_val, fname);
- }
- } else if (ret_type==2) {
- Bool is_array;
- const char *native_type = get_arg_type(ret_val, &is_array);
- fprintf(ifce_c, "\tret_val_js = JS_NewObjectClass(ctx, %s_class_id);\n", native_type);
- fprintf(ifce_c, "\tJS_SetOpaque(ret_val_js, wglo);\n");
- fprintf(ifce_c, "\twglo->obj = JS_DupValue(ctx, ret_val_js);\n");
- fprintf(ifce_c, "\twglo->class_id = %s_class_id;\n", native_type);
- fprintf(ifce_c, "\tgf_list_add(wglo->par_ctx->all_objects, wglo);\n");
- }
-
- for (i=0; i<nb_args; i++) {
- Bool is_array;
- const char *native_type = get_arg_type(arg_type[i], &is_array);
- if (!native_type) continue;
- if (!strcmp(native_type, "const char *")) {
- fprintf(ifce_c, "\tJS_FreeCString(ctx, %s);\n", arg_name[i]);
- }
-
- if (is_array && strcmp(native_type, "u8 *")) {
- if (strstr(fname, "vertexAttrib1fv")) {
- } else if (strstr(fname, "vertexAttrib2fv")) {
- } else if (strstr(fname, "vertexAttrib3fv")) {
- } else if (strstr(fname, "vertexAttrib4fv")) {
- } else {
- fprintf(ifce_c, "\tif (%s) gf_free(%s);\n", arg_name[i], arg_name[i]);
- }
- }
- }
-
- fprintf(ifce_c, "\treturn ret_val_js;\n");
-
-fun_done:
- while (nb_args>1) {
- gf_free(arg_type[nb_args-1]);
- gf_free(arg_name[nb_args-1]);
- nb_args--;
- }
- gf_free(ret_val);
- fprintf(ifce_c, "}\n");
-}
-
-
-static void load_idl(const char *file)
-{
- Bool in_ctxbase = GF_FALSE;
- char szLine[4001], *sep;
- char *curCtx = NULL;
- u32 len;
- FILE * idl = gf_fopen(file, "rt");
- FILE *ifce_c=NULL;
- FILE *fun_defs=NULL;
-
- while (!feof(idl)) {
- gf_fgets(szLine, 4000, idl);
- if (strstr(szLine, "implements"))
- continue;
- len = strlen(szLine);
- while (len && strchr(" \n", szLine[len])) {
- szLine[len] = 0;
- len--;
- }
- if (!len) continue;
-
- if (!in_ctxbase) {
- if (!strstr(szLine, "RenderingContextBase"))
- continue;
- in_ctxbase = GF_TRUE;
- sep = strchr(szLine, ' ');
- assert(sep);
- curCtx = gf_strdup(sep+1);
- start_ctx(curCtx, &ifce_c, &fun_defs);
- continue;
- } else {
- if (strstr(szLine, "};")){
- in_ctxbase = GF_FALSE;
- end_ctx(ifce_c, fun_defs, curCtx);
- ifce_c = NULL;
- continue;
- }
- }
-
- if (strstr(szLine, "/*")) continue;
- sep = strstr(szLine, "const ");
- if (sep) {
- char *cname, *nsep;
- sep = strchr(sep+7, ' ');
- assert(sep);
- sep++;
- nsep = strchr(sep, ' ');
- assert(nsep);
- nsep[0] = 0;
- cname = gf_strdup(sep);
- sep = strchr(nsep+1, '=');
- assert(sep);
- sep++;
- while (sep[0]==' ') sep++;
- nsep = strchr(sep, ';');
- assert(nsep);
- nsep[0]=0;
- put_const(fun_defs, cname, sep);
- gf_free(cname);
- continue;
- }
- sep = strstr(szLine, "typedef");
- if (sep) continue;
-
- sep = strstr(szLine, "attribute");
- if (sep) {
- char *nsep;
- Bool is_readonly = GF_FALSE;
- sep = szLine;
- while (sep[0]==' ') sep++;
- if (!strncmp(sep, "readonly", 8)) {
- is_readonly = GF_TRUE;
- sep+=9;
- }
- sep += 10;
- sep = strchr(sep, ' ');
- assert(sep);
- sep+=1;
- nsep = strchr(sep, ';');
- assert(nsep);
- nsep[0] = 0;
- put_prop(fun_defs, curCtx, sep, is_readonly);
- continue;
- }
- /*double type declaration for glXXXifv*/
- if (strstr(szLine, ", sequence<"))
- continue;
- /*double type declaration for bufferData*/
- if (strstr(szLine, ", GLsizeiptr size"))
- continue;
- /*double type declaration for texImage2D and texSubImage2D*/
- if (strstr(szLine, ", TexImageSource"))
- continue;
-
- sep = strstr(szLine, "(");
- /*this is a function*/
- if (sep) {
- char *nsep, *fname;
- sep = strchr(szLine, ']');
- if (sep) sep+=1;
- else sep = szLine;
- while (sep[0] == ' ') sep++;
- sep = strchr(sep, ' ');
- assert(sep);
- sep++;
- nsep = strchr(sep, '(');
- assert(nsep);
- nsep[0] = 0;
- fname = gf_strdup(sep);
- put_fun(fun_defs, sep);
- nsep[0] = '(';
-
- wrap_func(ifce_c, fname, szLine);
- gf_free(fname);
- continue;
- }
- fprintf(stderr, "instruction %s not handled\n", szLine);
- }
-
-
- gf_fclose(idl);
-}
-
-int main(int argc, char **argv)
-{
- u32 i=0;
- for (i=1; i<argc; i++) {
- load_idl(argv[i]);
- }
-
- return 0;
-}
-
-
+++ /dev/null
-// AUTOGENERATED FILE -- DO NOT EDIT -- SEE Makefile
-//
-// WebGL IDL definitions scraped from the Khronos specification:
-// https://www.khronos.org/registry/webgl/specs/latest/
-//
-// This IDL depends on the typed array specification defined at:
-// https://www.khronos.org/registry/typedarray/specs/latest/typedarrays.idl
-
-typedef unsigned long GLenum;
-typedef boolean GLboolean;
-typedef unsigned long GLbitfield;
-typedef byte GLbyte; /* 'byte' should be a signed 8 bit type. */
-typedef short GLshort;
-typedef long GLint;
-typedef long GLsizei;
-typedef long long GLintptr;
-typedef long long GLsizeiptr;
-// Ideally the typedef below would use 'unsigned byte', but that doesn't currently exist in Web IDL.
-typedef octet GLubyte; /* 'octet' should be an unsigned 8 bit type. */
-typedef unsigned short GLushort;
-typedef unsigned long GLuint;
-typedef unrestricted float GLfloat;
-typedef unrestricted float GLclampf;
-
-
-dictionary WebGLContextAttributes {
- GLboolean alpha = true;
- GLboolean depth = true;
- GLboolean stencil = false;
- GLboolean antialias = true;
- GLboolean premultipliedAlpha = true;
- GLboolean preserveDrawingBuffer = false;
- GLboolean preferLowPowerToHighPerformance = false;
- GLboolean failIfMajorPerformanceCaveat = false;
-};
-
-interface WebGLObject {
-};
-
-interface WebGLBuffer : WebGLObject {
-};
-
-interface WebGLFramebuffer : WebGLObject {
-};
-
-interface WebGLProgram : WebGLObject {
-};
-
-interface WebGLRenderbuffer : WebGLObject {
-};
-
-interface WebGLShader : WebGLObject {
-};
-
-interface WebGLTexture : WebGLObject {
-};
-
-interface WebGLUniformLocation {
-};
-
-interface WebGLActiveInfo {
- readonly attribute GLint size;
- readonly attribute GLenum type;
- readonly attribute DOMString name;
-};
-
-interface WebGLShaderPrecisionFormat {
- readonly attribute GLint rangeMin;
- readonly attribute GLint rangeMax;
- readonly attribute GLint precision;
-};
-
-[NoInterfaceObject]
-interface WebGLRenderingContextBase
-{
-
- /* ClearBufferMask */
- const GLenum DEPTH_BUFFER_BIT = 0x00000100;
- const GLenum STENCIL_BUFFER_BIT = 0x00000400;
- const GLenum COLOR_BUFFER_BIT = 0x00004000;
-
- /* BeginMode */
- const GLenum POINTS = 0x0000;
- const GLenum LINES = 0x0001;
- const GLenum LINE_LOOP = 0x0002;
- const GLenum LINE_STRIP = 0x0003;
- const GLenum TRIANGLES = 0x0004;
- const GLenum TRIANGLE_STRIP = 0x0005;
- const GLenum TRIANGLE_FAN = 0x0006;
-
- /* AlphaFunction (not supported in ES20) */
- /* NEVER */
- /* LESS */
- /* EQUAL */
- /* LEQUAL */
- /* GREATER */
- /* NOTEQUAL */
- /* GEQUAL */
- /* ALWAYS */
-
- /* BlendingFactorDest */
- const GLenum ZERO = 0;
- const GLenum ONE = 1;
- const GLenum SRC_COLOR = 0x0300;
- const GLenum ONE_MINUS_SRC_COLOR = 0x0301;
- const GLenum SRC_ALPHA = 0x0302;
- const GLenum ONE_MINUS_SRC_ALPHA = 0x0303;
- const GLenum DST_ALPHA = 0x0304;
- const GLenum ONE_MINUS_DST_ALPHA = 0x0305;
-
- /* BlendingFactorSrc */
- /* ZERO */
- /* ONE */
- const GLenum DST_COLOR = 0x0306;
- const GLenum ONE_MINUS_DST_COLOR = 0x0307;
- const GLenum SRC_ALPHA_SATURATE = 0x0308;
- /* SRC_ALPHA */
- /* ONE_MINUS_SRC_ALPHA */
- /* DST_ALPHA */
- /* ONE_MINUS_DST_ALPHA */
-
- /* BlendEquationSeparate */
- const GLenum FUNC_ADD = 0x8006;
- const GLenum BLEND_EQUATION = 0x8009;
- const GLenum BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */
- const GLenum BLEND_EQUATION_ALPHA = 0x883D;
-
- /* BlendSubtract */
- const GLenum FUNC_SUBTRACT = 0x800A;
- const GLenum FUNC_REVERSE_SUBTRACT = 0x800B;
-
- /* Separate Blend Functions */
- const GLenum BLEND_DST_RGB = 0x80C8;
- const GLenum BLEND_SRC_RGB = 0x80C9;
- const GLenum BLEND_DST_ALPHA = 0x80CA;
- const GLenum BLEND_SRC_ALPHA = 0x80CB;
- const GLenum CONSTANT_COLOR = 0x8001;
- const GLenum ONE_MINUS_CONSTANT_COLOR = 0x8002;
- const GLenum CONSTANT_ALPHA = 0x8003;
- const GLenum ONE_MINUS_CONSTANT_ALPHA = 0x8004;
- const GLenum BLEND_COLOR = 0x8005;
-
- /* Buffer Objects */
- const GLenum ARRAY_BUFFER = 0x8892;
- const GLenum ELEMENT_ARRAY_BUFFER = 0x8893;
- const GLenum ARRAY_BUFFER_BINDING = 0x8894;
- const GLenum ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
-
- const GLenum STREAM_DRAW = 0x88E0;
- const GLenum STATIC_DRAW = 0x88E4;
- const GLenum DYNAMIC_DRAW = 0x88E8;
-
- const GLenum BUFFER_SIZE = 0x8764;
- const GLenum BUFFER_USAGE = 0x8765;
-
- const GLenum CURRENT_VERTEX_ATTRIB = 0x8626;
-
- /* CullFaceMode */
- const GLenum FRONT = 0x0404;
- const GLenum BACK = 0x0405;
- const GLenum FRONT_AND_BACK = 0x0408;
-
- /* DepthFunction */
- /* NEVER */
- /* LESS */
- /* EQUAL */
- /* LEQUAL */
- /* GREATER */
- /* NOTEQUAL */
- /* GEQUAL */
- /* ALWAYS */
-
- /* EnableCap */
- /* TEXTURE_2D */
- const GLenum CULL_FACE = 0x0B44;
- const GLenum BLEND = 0x0BE2;
- const GLenum DITHER = 0x0BD0;
- const GLenum STENCIL_TEST = 0x0B90;
- const GLenum DEPTH_TEST = 0x0B71;
- const GLenum SCISSOR_TEST = 0x0C11;
- const GLenum POLYGON_OFFSET_FILL = 0x8037;
- const GLenum SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
- const GLenum SAMPLE_COVERAGE = 0x80A0;
-
- /* ErrorCode */
- const GLenum NO_ERROR = 0;
- const GLenum INVALID_ENUM = 0x0500;
- const GLenum INVALID_VALUE = 0x0501;
- const GLenum INVALID_OPERATION = 0x0502;
- const GLenum OUT_OF_MEMORY = 0x0505;
-
- /* FrontFaceDirection */
- const GLenum CW = 0x0900;
- const GLenum CCW = 0x0901;
-
- /* GetPName */
- const GLenum LINE_WIDTH = 0x0B21;
- const GLenum ALIASED_POINT_SIZE_RANGE = 0x846D;
- const GLenum ALIASED_LINE_WIDTH_RANGE = 0x846E;
- const GLenum CULL_FACE_MODE = 0x0B45;
- const GLenum FRONT_FACE = 0x0B46;
- const GLenum DEPTH_RANGE = 0x0B70;
- const GLenum DEPTH_WRITEMASK = 0x0B72;
- const GLenum DEPTH_CLEAR_VALUE = 0x0B73;
- const GLenum DEPTH_FUNC = 0x0B74;
- const GLenum STENCIL_CLEAR_VALUE = 0x0B91;
- const GLenum STENCIL_FUNC = 0x0B92;
- const GLenum STENCIL_FAIL = 0x0B94;
- const GLenum STENCIL_PASS_DEPTH_FAIL = 0x0B95;
- const GLenum STENCIL_PASS_DEPTH_PASS = 0x0B96;
- const GLenum STENCIL_REF = 0x0B97;
- const GLenum STENCIL_VALUE_MASK = 0x0B93;
- const GLenum STENCIL_WRITEMASK = 0x0B98;
- const GLenum STENCIL_BACK_FUNC = 0x8800;
- const GLenum STENCIL_BACK_FAIL = 0x8801;
- const GLenum STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
- const GLenum STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
- const GLenum STENCIL_BACK_REF = 0x8CA3;
- const GLenum STENCIL_BACK_VALUE_MASK = 0x8CA4;
- const GLenum STENCIL_BACK_WRITEMASK = 0x8CA5;
- const GLenum VIEWPORT = 0x0BA2;
- const GLenum SCISSOR_BOX = 0x0C10;
- /* SCISSOR_TEST */
- const GLenum COLOR_CLEAR_VALUE = 0x0C22;
- const GLenum COLOR_WRITEMASK = 0x0C23;
- const GLenum UNPACK_ALIGNMENT = 0x0CF5;
- const GLenum PACK_ALIGNMENT = 0x0D05;
- const GLenum MAX_TEXTURE_SIZE = 0x0D33;
- const GLenum MAX_VIEWPORT_DIMS = 0x0D3A;
- const GLenum SUBPIXEL_BITS = 0x0D50;
- const GLenum RED_BITS = 0x0D52;
- const GLenum GREEN_BITS = 0x0D53;
- const GLenum BLUE_BITS = 0x0D54;
- const GLenum ALPHA_BITS = 0x0D55;
- const GLenum DEPTH_BITS = 0x0D56;
- const GLenum STENCIL_BITS = 0x0D57;
- const GLenum POLYGON_OFFSET_UNITS = 0x2A00;
- /* POLYGON_OFFSET_FILL */
- const GLenum POLYGON_OFFSET_FACTOR = 0x8038;
- const GLenum TEXTURE_BINDING_2D = 0x8069;
- const GLenum SAMPLE_BUFFERS = 0x80A8;
- const GLenum SAMPLES = 0x80A9;
- const GLenum SAMPLE_COVERAGE_VALUE = 0x80AA;
- const GLenum SAMPLE_COVERAGE_INVERT = 0x80AB;
-
- /* GetTextureParameter */
- /* TEXTURE_MAG_FILTER */
- /* TEXTURE_MIN_FILTER */
- /* TEXTURE_WRAP_S */
- /* TEXTURE_WRAP_T */
-
- const GLenum COMPRESSED_TEXTURE_FORMATS = 0x86A3;
-
- /* HintMode */
- const GLenum DONT_CARE = 0x1100;
- const GLenum FASTEST = 0x1101;
- const GLenum NICEST = 0x1102;
-
- /* HintTarget */
- const GLenum GENERATE_MIPMAP_HINT = 0x8192;
-
- /* DataType */
- const GLenum BYTE = 0x1400;
- const GLenum UNSIGNED_BYTE = 0x1401;
- const GLenum SHORT = 0x1402;
- const GLenum UNSIGNED_SHORT = 0x1403;
- const GLenum INT = 0x1404;
- const GLenum UNSIGNED_INT = 0x1405;
- const GLenum FLOAT = 0x1406;
-
- /* PixelFormat */
- const GLenum DEPTH_COMPONENT = 0x1902;
- const GLenum ALPHA = 0x1906;
- const GLenum RGB = 0x1907;
- const GLenum RGBA = 0x1908;
- const GLenum LUMINANCE = 0x1909;
- const GLenum LUMINANCE_ALPHA = 0x190A;
-
- /* PixelType */
- /* UNSIGNED_BYTE */
- const GLenum UNSIGNED_SHORT_4_4_4_4 = 0x8033;
- const GLenum UNSIGNED_SHORT_5_5_5_1 = 0x8034;
- const GLenum UNSIGNED_SHORT_5_6_5 = 0x8363;
-
- /* Shaders */
- const GLenum FRAGMENT_SHADER = 0x8B30;
- const GLenum VERTEX_SHADER = 0x8B31;
- const GLenum MAX_VERTEX_ATTRIBS = 0x8869;
- const GLenum MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
- const GLenum MAX_VARYING_VECTORS = 0x8DFC;
- const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
- const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
- const GLenum MAX_TEXTURE_IMAGE_UNITS = 0x8872;
- const GLenum MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
- const GLenum SHADER_TYPE = 0x8B4F;
- const GLenum DELETE_STATUS = 0x8B80;
- const GLenum LINK_STATUS = 0x8B82;
- const GLenum VALIDATE_STATUS = 0x8B83;
- const GLenum ATTACHED_SHADERS = 0x8B85;
- const GLenum ACTIVE_UNIFORMS = 0x8B86;
- const GLenum ACTIVE_ATTRIBUTES = 0x8B89;
- const GLenum SHADING_LANGUAGE_VERSION = 0x8B8C;
- const GLenum CURRENT_PROGRAM = 0x8B8D;
-
- /* StencilFunction */
- const GLenum NEVER = 0x0200;
- const GLenum LESS = 0x0201;
- const GLenum EQUAL = 0x0202;
- const GLenum LEQUAL = 0x0203;
- const GLenum GREATER = 0x0204;
- const GLenum NOTEQUAL = 0x0205;
- const GLenum GEQUAL = 0x0206;
- const GLenum ALWAYS = 0x0207;
-
- /* StencilOp */
- /* ZERO */
- const GLenum KEEP = 0x1E00;
- const GLenum REPLACE = 0x1E01;
- const GLenum INCR = 0x1E02;
- const GLenum DECR = 0x1E03;
- const GLenum INVERT = 0x150A;
- const GLenum INCR_WRAP = 0x8507;
- const GLenum DECR_WRAP = 0x8508;
-
- /* StringName */
- const GLenum VENDOR = 0x1F00;
- const GLenum RENDERER = 0x1F01;
- const GLenum VERSION = 0x1F02;
-
- /* TextureMagFilter */
- const GLenum NEAREST = 0x2600;
- const GLenum LINEAR = 0x2601;
-
- /* TextureMinFilter */
- /* NEAREST */
- /* LINEAR */
- const GLenum NEAREST_MIPMAP_NEAREST = 0x2700;
- const GLenum LINEAR_MIPMAP_NEAREST = 0x2701;
- const GLenum NEAREST_MIPMAP_LINEAR = 0x2702;
- const GLenum LINEAR_MIPMAP_LINEAR = 0x2703;
-
- /* TextureParameterName */
- const GLenum TEXTURE_MAG_FILTER = 0x2800;
- const GLenum TEXTURE_MIN_FILTER = 0x2801;
- const GLenum TEXTURE_WRAP_S = 0x2802;
- const GLenum TEXTURE_WRAP_T = 0x2803;
-
- /* TextureTarget */
- const GLenum TEXTURE_2D = 0x0DE1;
- const GLenum TEXTURE = 0x1702;
-
- const GLenum TEXTURE_CUBE_MAP = 0x8513;
- const GLenum TEXTURE_BINDING_CUBE_MAP = 0x8514;
- const GLenum TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
- const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
- const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
- const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
- const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
- const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
- const GLenum MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
-
- /* TextureUnit */
- const GLenum TEXTURE0 = 0x84C0;
- const GLenum TEXTURE1 = 0x84C1;
- const GLenum TEXTURE2 = 0x84C2;
- const GLenum TEXTURE3 = 0x84C3;
- const GLenum TEXTURE4 = 0x84C4;
- const GLenum TEXTURE5 = 0x84C5;
- const GLenum TEXTURE6 = 0x84C6;
- const GLenum TEXTURE7 = 0x84C7;
- const GLenum TEXTURE8 = 0x84C8;
- const GLenum TEXTURE9 = 0x84C9;
- const GLenum TEXTURE10 = 0x84CA;
- const GLenum TEXTURE11 = 0x84CB;
- const GLenum TEXTURE12 = 0x84CC;
- const GLenum TEXTURE13 = 0x84CD;
- const GLenum TEXTURE14 = 0x84CE;
- const GLenum TEXTURE15 = 0x84CF;
- const GLenum TEXTURE16 = 0x84D0;
- const GLenum TEXTURE17 = 0x84D1;
- const GLenum TEXTURE18 = 0x84D2;
- const GLenum TEXTURE19 = 0x84D3;
- const GLenum TEXTURE20 = 0x84D4;
- const GLenum TEXTURE21 = 0x84D5;
- const GLenum TEXTURE22 = 0x84D6;
- const GLenum TEXTURE23 = 0x84D7;
- const GLenum TEXTURE24 = 0x84D8;
- const GLenum TEXTURE25 = 0x84D9;
- const GLenum TEXTURE26 = 0x84DA;
- const GLenum TEXTURE27 = 0x84DB;
- const GLenum TEXTURE28 = 0x84DC;
- const GLenum TEXTURE29 = 0x84DD;
- const GLenum TEXTURE30 = 0x84DE;
- const GLenum TEXTURE31 = 0x84DF;
- const GLenum ACTIVE_TEXTURE = 0x84E0;
-
- /* TextureWrapMode */
- const GLenum REPEAT = 0x2901;
- const GLenum CLAMP_TO_EDGE = 0x812F;
- const GLenum MIRRORED_REPEAT = 0x8370;
-
- /* Uniform Types */
- const GLenum FLOAT_VEC2 = 0x8B50;
- const GLenum FLOAT_VEC3 = 0x8B51;
- const GLenum FLOAT_VEC4 = 0x8B52;
- const GLenum INT_VEC2 = 0x8B53;
- const GLenum INT_VEC3 = 0x8B54;
- const GLenum INT_VEC4 = 0x8B55;
- const GLenum BOOL = 0x8B56;
- const GLenum BOOL_VEC2 = 0x8B57;
- const GLenum BOOL_VEC3 = 0x8B58;
- const GLenum BOOL_VEC4 = 0x8B59;
- const GLenum FLOAT_MAT2 = 0x8B5A;
- const GLenum FLOAT_MAT3 = 0x8B5B;
- const GLenum FLOAT_MAT4 = 0x8B5C;
- const GLenum SAMPLER_2D = 0x8B5E;
- const GLenum SAMPLER_CUBE = 0x8B60;
-
- /* Vertex Arrays */
- const GLenum VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
- const GLenum VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
- const GLenum VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
- const GLenum VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
- const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
- const GLenum VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
- const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
-
- /* Read Format */
- const GLenum IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A;
- const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
-
- /* Shader Source */
- const GLenum COMPILE_STATUS = 0x8B81;
-
- /* Shader Precision-Specified Types */
- const GLenum LOW_FLOAT = 0x8DF0;
- const GLenum MEDIUM_FLOAT = 0x8DF1;
- const GLenum HIGH_FLOAT = 0x8DF2;
- const GLenum LOW_INT = 0x8DF3;
- const GLenum MEDIUM_INT = 0x8DF4;
- const GLenum HIGH_INT = 0x8DF5;
-
- /* Framebuffer Object. */
- const GLenum FRAMEBUFFER = 0x8D40;
- const GLenum RENDERBUFFER = 0x8D41;
-
- const GLenum RGBA4 = 0x8056;
- const GLenum RGB5_A1 = 0x8057;
- const GLenum RGB565 = 0x8D62;
- const GLenum DEPTH_COMPONENT16 = 0x81A5;
- const GLenum STENCIL_INDEX = 0x1901;
- const GLenum STENCIL_INDEX8 = 0x8D48;
- const GLenum DEPTH_STENCIL = 0x84F9;
-
- const GLenum RENDERBUFFER_WIDTH = 0x8D42;
- const GLenum RENDERBUFFER_HEIGHT = 0x8D43;
- const GLenum RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
- const GLenum RENDERBUFFER_RED_SIZE = 0x8D50;
- const GLenum RENDERBUFFER_GREEN_SIZE = 0x8D51;
- const GLenum RENDERBUFFER_BLUE_SIZE = 0x8D52;
- const GLenum RENDERBUFFER_ALPHA_SIZE = 0x8D53;
- const GLenum RENDERBUFFER_DEPTH_SIZE = 0x8D54;
- const GLenum RENDERBUFFER_STENCIL_SIZE = 0x8D55;
-
- const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
- const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
- const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
- const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
-
- const GLenum COLOR_ATTACHMENT0 = 0x8CE0;
- const GLenum DEPTH_ATTACHMENT = 0x8D00;
- const GLenum STENCIL_ATTACHMENT = 0x8D20;
- const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A;
-
- const GLenum NONE = 0;
-
- const GLenum FRAMEBUFFER_COMPLETE = 0x8CD5;
- const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
- const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
- const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
- const GLenum FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
-
- const GLenum FRAMEBUFFER_BINDING = 0x8CA6;
- const GLenum RENDERBUFFER_BINDING = 0x8CA7;
- const GLenum MAX_RENDERBUFFER_SIZE = 0x84E8;
-
- const GLenum INVALID_FRAMEBUFFER_OPERATION = 0x0506;
-
- /* WebGL-specific enums */
- const GLenum UNPACK_FLIP_Y_WEBGL = 0x9240;
- const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
- const GLenum CONTEXT_LOST_WEBGL = 0x9242;
- const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
- const GLenum BROWSER_DEFAULT_WEBGL = 0x9244;
-
- readonly attribute HTMLCanvasElement canvas;
- readonly attribute GLsizei drawingBufferWidth;
- readonly attribute GLsizei drawingBufferHeight;
-
- [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
- [WebGLHandlesContextLoss] boolean isContextLost();
-
- sequence<DOMString>? getSupportedExtensions();
- object? getExtension(DOMString name);
-
- void activeTexture(GLenum texture);
- void attachShader(WebGLProgram? program, WebGLShader? shader);
- void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name);
- void bindBuffer(GLenum target, WebGLBuffer? buffer);
- void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
- void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
- void bindTexture(GLenum target, WebGLTexture? texture);
- void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- void blendEquation(GLenum mode);
- void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
- void blendFunc(GLenum sfactor, GLenum dfactor);
- void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-
- typedef (ArrayBuffer or ArrayBufferView) BufferDataSource;
- void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
- void bufferData(GLenum target, BufferDataSource? data, GLenum usage);
- void bufferSubData(GLenum target, GLintptr offset, BufferDataSource? data);
-
- [WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
- void clear(GLbitfield mask);
- void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- void clearDepth(GLclampf depth);
- void clearStencil(GLint s);
- void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
- void compileShader(WebGLShader? shader);
-
- void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, ArrayBufferView data);
- void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, ArrayBufferView data);
-
- void copyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
- void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-
- WebGLBuffer? createBuffer();
- WebGLFramebuffer? createFramebuffer();
- WebGLProgram? createProgram();
- WebGLRenderbuffer? createRenderbuffer();
- WebGLShader? createShader(GLenum type);
- WebGLTexture? createTexture();
-
- void cullFace(GLenum mode);
-
- void deleteBuffer(WebGLBuffer? buffer);
- void deleteFramebuffer(WebGLFramebuffer? framebuffer);
- void deleteProgram(WebGLProgram? program);
- void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer);
- void deleteShader(WebGLShader? shader);
- void deleteTexture(WebGLTexture? texture);
-
- void depthFunc(GLenum func);
- void depthMask(GLboolean flag);
- void depthRange(GLclampf zNear, GLclampf zFar);
- void detachShader(WebGLProgram? program, WebGLShader? shader);
- void disable(GLenum cap);
- void disableVertexAttribArray(GLuint index);
- void drawArrays(GLenum mode, GLint first, GLsizei count);
- void drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset);
-
- void enable(GLenum cap);
- void enableVertexAttribArray(GLuint index);
- void finish();
- void flush();
- void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer? renderbuffer);
- void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture? texture, GLint level);
- void frontFace(GLenum mode);
-
- void generateMipmap(GLenum target);
-
- WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index);
- WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index);
- sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);
-
- [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram? program, DOMString name);
-
- any getBufferParameter(GLenum target, GLenum pname);
- any getParameter(GLenum pname);
-
- [WebGLHandlesContextLoss] GLenum getError();
-
- any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname);
- any getProgramParameter(WebGLProgram? program, GLenum pname);
- DOMString? getProgramInfoLog(WebGLProgram? program);
- any getRenderbufferParameter(GLenum target, GLenum pname);
- any getShaderParameter(WebGLShader? shader, GLenum pname);
- WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
- DOMString? getShaderInfoLog(WebGLShader? shader);
-
- DOMString? getShaderSource(WebGLShader? shader);
-
- any getTexParameter(GLenum target, GLenum pname);
-
- any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
-
- WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name);
-
- any getVertexAttrib(GLuint index, GLenum pname);
-
- [WebGLHandlesContextLoss] GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname);
-
- void hint(GLenum target, GLenum mode);
- [WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer);
- [WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap);
- [WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer);
- [WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program);
- [WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer);
- [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader);
- [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture);
- void lineWidth(GLfloat width);
- void linkProgram(WebGLProgram? program);
- void pixelStorei(GLenum pname, GLint param);
- void polygonOffset(GLfloat factor, GLfloat units);
-
- void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView? pixels);
-
- void renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
- void sampleCoverage(GLclampf value, GLboolean invert);
- void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
-
- void shaderSource(WebGLShader? shader, DOMString source);
-
- void stencilFunc(GLenum func, GLint ref, GLuint mask);
- void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
- void stencilMask(GLuint mask);
- void stencilMaskSeparate(GLenum face, GLuint mask);
- void stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
- void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
-
- typedef (ImageData or HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) TexImageSource;
- void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
- void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, TexImageSource? source); // May throw DOMException
-
- void texParameterf(GLenum target, GLenum pname, GLfloat param);
- void texParameteri(GLenum target, GLenum pname, GLint param);
-
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView? pixels);
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, TexImageSource? source); // May throw DOMException
-
- void uniform1f(WebGLUniformLocation? location, GLfloat x);
- void uniform1fv(WebGLUniformLocation? location, Float32Array v);
- void uniform1fv(WebGLUniformLocation? location, sequence<GLfloat> v);
- void uniform1i(WebGLUniformLocation? location, GLint x);
- void uniform1iv(WebGLUniformLocation? location, Int32Array v);
- void uniform1iv(WebGLUniformLocation? location, sequence<long> v);
- void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
- void uniform2fv(WebGLUniformLocation? location, Float32Array v);
- void uniform2fv(WebGLUniformLocation? location, sequence<GLfloat> v);
- void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
- void uniform2iv(WebGLUniformLocation? location, Int32Array v);
- void uniform2iv(WebGLUniformLocation? location, sequence<long> v);
- void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
- void uniform3fv(WebGLUniformLocation? location, Float32Array v);
- void uniform3fv(WebGLUniformLocation? location, sequence<GLfloat> v);
- void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
- void uniform3iv(WebGLUniformLocation? location, Int32Array v);
- void uniform3iv(WebGLUniformLocation? location, sequence<long> v);
- void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void uniform4fv(WebGLUniformLocation? location, Float32Array v);
- void uniform4fv(WebGLUniformLocation? location, sequence<GLfloat> v);
- void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
- void uniform4iv(WebGLUniformLocation? location, Int32Array v);
- void uniform4iv(WebGLUniformLocation? location, sequence<long> v);
-
- void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
- void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
- void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
- void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
- void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
- void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
-
- void useProgram(WebGLProgram? program);
- void validateProgram(WebGLProgram? program);
-
- void vertexAttrib1f(GLuint indx, GLfloat x);
- void vertexAttrib1fv(GLuint indx, Float32Array values);
- void vertexAttrib1fv(GLuint indx, sequence<GLfloat> values);
- void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
- void vertexAttrib2fv(GLuint indx, Float32Array values);
- void vertexAttrib2fv(GLuint indx, sequence<GLfloat> values);
- void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
- void vertexAttrib3fv(GLuint indx, Float32Array values);
- void vertexAttrib3fv(GLuint indx, sequence<GLfloat> values);
- void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void vertexAttrib4fv(GLuint indx, Float32Array values);
- void vertexAttrib4fv(GLuint indx, sequence<GLfloat> values);
- void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset);
-
- void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
-};
-
-interface WebGLRenderingContext
-{
-};
-WebGLRenderingContext implements WebGLRenderingContextBase;
-
-
-[Constructor(DOMString type, optional WebGLContextEventInit eventInit)]
-interface WebGLContextEvent : Event {
- readonly attribute DOMString statusMessage;
-};
-
-// EventInit is defined in the DOM4 specification.
-dictionary WebGLContextEventInit : EventInit {
- DOMString statusMessage;
-};
+++ /dev/null
-// AUTOGENERATED FILE -- DO NOT EDIT -- SEE Makefile
-//
-// WebGL IDL definitions scraped from the Khronos specification:
-// https://www.khronos.org/registry/webgl/specs/latest/
-//
-// This IDL depends on the typed array specification defined at:
-// https://www.khronos.org/registry/typedarray/specs/latest/typedarrays.idl
-
-typedef long long GLint64;
-typedef unsigned long long GLuint64;
-
-
-interface WebGLQuery : WebGLObject {
-};
-
-interface WebGLSampler : WebGLObject {
-};
-
-interface WebGLSync : WebGLObject {
-};
-
-interface WebGLTransformFeedback : WebGLObject {
-};
-
-interface WebGLVertexArrayObject : WebGLObject {
-};
-
-typedef (Float32Array or sequence<GLfloat>) Float32List;
-typedef (Int32Array or sequence<GLint>) Int32List;
-typedef (Uint32Array or sequence<GLuint>) Uint32List;
-
-[NoInterfaceObject]
-interface WebGL2RenderingContextBase
-{
- const GLenum READ_BUFFER = 0x0C02;
- const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
- const GLenum UNPACK_SKIP_ROWS = 0x0CF3;
- const GLenum UNPACK_SKIP_PIXELS = 0x0CF4;
- const GLenum PACK_ROW_LENGTH = 0x0D02;
- const GLenum PACK_SKIP_ROWS = 0x0D03;
- const GLenum PACK_SKIP_PIXELS = 0x0D04;
- const GLenum COLOR = 0x1800;
- const GLenum DEPTH = 0x1801;
- const GLenum STENCIL = 0x1802;
- const GLenum RED = 0x1903;
- const GLenum RGB8 = 0x8051;
- const GLenum RGBA8 = 0x8058;
- const GLenum RGB10_A2 = 0x8059;
- const GLenum TEXTURE_BINDING_3D = 0x806A;
- const GLenum UNPACK_SKIP_IMAGES = 0x806D;
- const GLenum UNPACK_IMAGE_HEIGHT = 0x806E;
- const GLenum TEXTURE_3D = 0x806F;
- const GLenum TEXTURE_WRAP_R = 0x8072;
- const GLenum MAX_3D_TEXTURE_SIZE = 0x8073;
- const GLenum UNSIGNED_INT_2_10_10_10_REV = 0x8368;
- const GLenum MAX_ELEMENTS_VERTICES = 0x80E8;
- const GLenum MAX_ELEMENTS_INDICES = 0x80E9;
- const GLenum TEXTURE_MIN_LOD = 0x813A;
- const GLenum TEXTURE_MAX_LOD = 0x813B;
- const GLenum TEXTURE_BASE_LEVEL = 0x813C;
- const GLenum TEXTURE_MAX_LEVEL = 0x813D;
- const GLenum MIN = 0x8007;
- const GLenum MAX = 0x8008;
- const GLenum DEPTH_COMPONENT24 = 0x81A6;
- const GLenum MAX_TEXTURE_LOD_BIAS = 0x84FD;
- const GLenum TEXTURE_COMPARE_MODE = 0x884C;
- const GLenum TEXTURE_COMPARE_FUNC = 0x884D;
- const GLenum CURRENT_QUERY = 0x8865;
- const GLenum QUERY_RESULT = 0x8866;
- const GLenum QUERY_RESULT_AVAILABLE = 0x8867;
- const GLenum STREAM_READ = 0x88E1;
- const GLenum STREAM_COPY = 0x88E2;
- const GLenum STATIC_READ = 0x88E5;
- const GLenum STATIC_COPY = 0x88E6;
- const GLenum DYNAMIC_READ = 0x88E9;
- const GLenum DYNAMIC_COPY = 0x88EA;
- const GLenum MAX_DRAW_BUFFERS = 0x8824;
- const GLenum DRAW_BUFFER0 = 0x8825;
- const GLenum DRAW_BUFFER1 = 0x8826;
- const GLenum DRAW_BUFFER2 = 0x8827;
- const GLenum DRAW_BUFFER3 = 0x8828;
- const GLenum DRAW_BUFFER4 = 0x8829;
- const GLenum DRAW_BUFFER5 = 0x882A;
- const GLenum DRAW_BUFFER6 = 0x882B;
- const GLenum DRAW_BUFFER7 = 0x882C;
- const GLenum DRAW_BUFFER8 = 0x882D;
- const GLenum DRAW_BUFFER9 = 0x882E;
- const GLenum DRAW_BUFFER10 = 0x882F;
- const GLenum DRAW_BUFFER11 = 0x8830;
- const GLenum DRAW_BUFFER12 = 0x8831;
- const GLenum DRAW_BUFFER13 = 0x8832;
- const GLenum DRAW_BUFFER14 = 0x8833;
- const GLenum DRAW_BUFFER15 = 0x8834;
- const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
- const GLenum MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
- const GLenum SAMPLER_3D = 0x8B5F;
- const GLenum SAMPLER_2D_SHADOW = 0x8B62;
- const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
- const GLenum PIXEL_PACK_BUFFER = 0x88EB;
- const GLenum PIXEL_UNPACK_BUFFER = 0x88EC;
- const GLenum PIXEL_PACK_BUFFER_BINDING = 0x88ED;
- const GLenum PIXEL_UNPACK_BUFFER_BINDING = 0x88EF;
- const GLenum FLOAT_MAT2x3 = 0x8B65;
- const GLenum FLOAT_MAT2x4 = 0x8B66;
- const GLenum FLOAT_MAT3x2 = 0x8B67;
- const GLenum FLOAT_MAT3x4 = 0x8B68;
- const GLenum FLOAT_MAT4x2 = 0x8B69;
- const GLenum FLOAT_MAT4x3 = 0x8B6A;
- const GLenum SRGB = 0x8C40;
- const GLenum SRGB8 = 0x8C41;
- const GLenum SRGB8_ALPHA8 = 0x8C43;
- const GLenum COMPARE_REF_TO_TEXTURE = 0x884E;
- const GLenum RGBA32F = 0x8814;
- const GLenum RGB32F = 0x8815;
- const GLenum RGBA16F = 0x881A;
- const GLenum RGB16F = 0x881B;
- const GLenum VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD;
- const GLenum MAX_ARRAY_TEXTURE_LAYERS = 0x88FF;
- const GLenum MIN_PROGRAM_TEXEL_OFFSET = 0x8904;
- const GLenum MAX_PROGRAM_TEXEL_OFFSET = 0x8905;
- const GLenum MAX_VARYING_COMPONENTS = 0x8B4B;
- const GLenum TEXTURE_2D_ARRAY = 0x8C1A;
- const GLenum TEXTURE_BINDING_2D_ARRAY = 0x8C1D;
- const GLenum R11F_G11F_B10F = 0x8C3A;
- const GLenum UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
- const GLenum RGB9_E5 = 0x8C3D;
- const GLenum UNSIGNED_INT_5_9_9_9_REV = 0x8C3E;
- const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
- const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
- const GLenum TRANSFORM_FEEDBACK_VARYINGS = 0x8C83;
- const GLenum TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
- const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
- const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
- const GLenum RASTERIZER_DISCARD = 0x8C89;
- const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
- const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
- const GLenum INTERLEAVED_ATTRIBS = 0x8C8C;
- const GLenum SEPARATE_ATTRIBS = 0x8C8D;
- const GLenum TRANSFORM_FEEDBACK_BUFFER = 0x8C8E;
- const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
- const GLenum RGBA32UI = 0x8D70;
- const GLenum RGB32UI = 0x8D71;
- const GLenum RGBA16UI = 0x8D76;
- const GLenum RGB16UI = 0x8D77;
- const GLenum RGBA8UI = 0x8D7C;
- const GLenum RGB8UI = 0x8D7D;
- const GLenum RGBA32I = 0x8D82;
- const GLenum RGB32I = 0x8D83;
- const GLenum RGBA16I = 0x8D88;
- const GLenum RGB16I = 0x8D89;
- const GLenum RGBA8I = 0x8D8E;
- const GLenum RGB8I = 0x8D8F;
- const GLenum RED_INTEGER = 0x8D94;
- const GLenum RGB_INTEGER = 0x8D98;
- const GLenum RGBA_INTEGER = 0x8D99;
- const GLenum SAMPLER_2D_ARRAY = 0x8DC1;
- const GLenum SAMPLER_2D_ARRAY_SHADOW = 0x8DC4;
- const GLenum SAMPLER_CUBE_SHADOW = 0x8DC5;
- const GLenum UNSIGNED_INT_VEC2 = 0x8DC6;
- const GLenum UNSIGNED_INT_VEC3 = 0x8DC7;
- const GLenum UNSIGNED_INT_VEC4 = 0x8DC8;
- const GLenum INT_SAMPLER_2D = 0x8DCA;
- const GLenum INT_SAMPLER_3D = 0x8DCB;
- const GLenum INT_SAMPLER_CUBE = 0x8DCC;
- const GLenum INT_SAMPLER_2D_ARRAY = 0x8DCF;
- const GLenum UNSIGNED_INT_SAMPLER_2D = 0x8DD2;
- const GLenum UNSIGNED_INT_SAMPLER_3D = 0x8DD3;
- const GLenum UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4;
- const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7;
- const GLenum DEPTH_COMPONENT32F = 0x8CAC;
- const GLenum DEPTH32F_STENCIL8 = 0x8CAD;
- const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
- const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
- const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
- const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
- const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
- const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
- const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
- const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
- const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
- const GLenum FRAMEBUFFER_DEFAULT = 0x8218;
- const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A;
- const GLenum DEPTH_STENCIL = 0x84F9;
- const GLenum UNSIGNED_INT_24_8 = 0x84FA;
- const GLenum DEPTH24_STENCIL8 = 0x88F0;
- const GLenum UNSIGNED_NORMALIZED = 0x8C17;
- const GLenum DRAW_FRAMEBUFFER_BINDING = 0x8CA6; /* Same as FRAMEBUFFER_BINDING */
- const GLenum READ_FRAMEBUFFER = 0x8CA8;
- const GLenum DRAW_FRAMEBUFFER = 0x8CA9;
- const GLenum READ_FRAMEBUFFER_BINDING = 0x8CAA;
- const GLenum RENDERBUFFER_SAMPLES = 0x8CAB;
- const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
- const GLenum MAX_COLOR_ATTACHMENTS = 0x8CDF;
- const GLenum COLOR_ATTACHMENT1 = 0x8CE1;
- const GLenum COLOR_ATTACHMENT2 = 0x8CE2;
- const GLenum COLOR_ATTACHMENT3 = 0x8CE3;
- const GLenum COLOR_ATTACHMENT4 = 0x8CE4;
- const GLenum COLOR_ATTACHMENT5 = 0x8CE5;
- const GLenum COLOR_ATTACHMENT6 = 0x8CE6;
- const GLenum COLOR_ATTACHMENT7 = 0x8CE7;
- const GLenum COLOR_ATTACHMENT8 = 0x8CE8;
- const GLenum COLOR_ATTACHMENT9 = 0x8CE9;
- const GLenum COLOR_ATTACHMENT10 = 0x8CEA;
- const GLenum COLOR_ATTACHMENT11 = 0x8CEB;
- const GLenum COLOR_ATTACHMENT12 = 0x8CEC;
- const GLenum COLOR_ATTACHMENT13 = 0x8CED;
- const GLenum COLOR_ATTACHMENT14 = 0x8CEE;
- const GLenum COLOR_ATTACHMENT15 = 0x8CEF;
- const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
- const GLenum MAX_SAMPLES = 0x8D57;
- const GLenum HALF_FLOAT = 0x140B;
- const GLenum RG = 0x8227;
- const GLenum RG_INTEGER = 0x8228;
- const GLenum R8 = 0x8229;
- const GLenum RG8 = 0x822B;
- const GLenum R16F = 0x822D;
- const GLenum R32F = 0x822E;
- const GLenum RG16F = 0x822F;
- const GLenum RG32F = 0x8230;
- const GLenum R8I = 0x8231;
- const GLenum R8UI = 0x8232;
- const GLenum R16I = 0x8233;
- const GLenum R16UI = 0x8234;
- const GLenum R32I = 0x8235;
- const GLenum R32UI = 0x8236;
- const GLenum RG8I = 0x8237;
- const GLenum RG8UI = 0x8238;
- const GLenum RG16I = 0x8239;
- const GLenum RG16UI = 0x823A;
- const GLenum RG32I = 0x823B;
- const GLenum RG32UI = 0x823C;
- const GLenum VERTEX_ARRAY_BINDING = 0x85B5;
- const GLenum R8_SNORM = 0x8F94;
- const GLenum RG8_SNORM = 0x8F95;
- const GLenum RGB8_SNORM = 0x8F96;
- const GLenum RGBA8_SNORM = 0x8F97;
- const GLenum SIGNED_NORMALIZED = 0x8F9C;
- const GLenum COPY_READ_BUFFER = 0x8F36;
- const GLenum COPY_WRITE_BUFFER = 0x8F37;
- const GLenum COPY_READ_BUFFER_BINDING = 0x8F36; /* Same as COPY_READ_BUFFER */
- const GLenum COPY_WRITE_BUFFER_BINDING = 0x8F37; /* Same as COPY_WRITE_BUFFER */
- const GLenum UNIFORM_BUFFER = 0x8A11;
- const GLenum UNIFORM_BUFFER_BINDING = 0x8A28;
- const GLenum UNIFORM_BUFFER_START = 0x8A29;
- const GLenum UNIFORM_BUFFER_SIZE = 0x8A2A;
- const GLenum MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
- const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
- const GLenum MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
- const GLenum MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
- const GLenum MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
- const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
- const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
- const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
- const GLenum ACTIVE_UNIFORM_BLOCKS = 0x8A36;
- const GLenum UNIFORM_TYPE = 0x8A37;
- const GLenum UNIFORM_SIZE = 0x8A38;
- const GLenum UNIFORM_BLOCK_INDEX = 0x8A3A;
- const GLenum UNIFORM_OFFSET = 0x8A3B;
- const GLenum UNIFORM_ARRAY_STRIDE = 0x8A3C;
- const GLenum UNIFORM_MATRIX_STRIDE = 0x8A3D;
- const GLenum UNIFORM_IS_ROW_MAJOR = 0x8A3E;
- const GLenum UNIFORM_BLOCK_BINDING = 0x8A3F;
- const GLenum UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
- const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
- const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
- const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
- const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
- const GLenum INVALID_INDEX = 0xFFFFFFFF;
- const GLenum MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122;
- const GLenum MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125;
- const GLenum MAX_SERVER_WAIT_TIMEOUT = 0x9111;
- const GLenum OBJECT_TYPE = 0x9112;
- const GLenum SYNC_CONDITION = 0x9113;
- const GLenum SYNC_STATUS = 0x9114;
- const GLenum SYNC_FLAGS = 0x9115;
- const GLenum SYNC_FENCE = 0x9116;
- const GLenum SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
- const GLenum UNSIGNALED = 0x9118;
- const GLenum SIGNALED = 0x9119;
- const GLenum ALREADY_SIGNALED = 0x911A;
- const GLenum TIMEOUT_EXPIRED = 0x911B;
- const GLenum CONDITION_SATISFIED = 0x911C;
- const GLenum WAIT_FAILED = 0x911D;
- const GLenum SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
- const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;
- const GLenum ANY_SAMPLES_PASSED = 0x8C2F;
- const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
- const GLenum SAMPLER_BINDING = 0x8919;
- const GLenum RGB10_A2UI = 0x906F;
- const GLenum INT_2_10_10_10_REV = 0x8D9F;
- const GLenum TRANSFORM_FEEDBACK = 0x8E22;
- const GLenum TRANSFORM_FEEDBACK_PAUSED = 0x8E23;
- const GLenum TRANSFORM_FEEDBACK_ACTIVE = 0x8E24;
- const GLenum TRANSFORM_FEEDBACK_BINDING = 0x8E25;
- const GLenum TEXTURE_IMMUTABLE_FORMAT = 0x912F;
- const GLenum MAX_ELEMENT_INDEX = 0x8D6B;
- const GLenum TEXTURE_IMMUTABLE_LEVELS = 0x82DF;
-
- const GLint64 TIMEOUT_IGNORED = -1;
-
- /* WebGL-specific enums */
- const GLenum MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 0x9247;
-
- /* Buffer objects */
- // WebGL1:
- void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
- void bufferData(GLenum target, ArrayBuffer? srcData, GLenum usage);
- void bufferData(GLenum target, ArrayBufferView srcData, GLenum usage);
- void bufferSubData(GLenum target, GLintptr dstByteOffset, BufferDataSource srcData);
- // WebGL2:
- void bufferData(GLenum target, ArrayBufferView srcData, GLenum usage, GLuint srcOffset,
- optional GLuint length = 0);
- void bufferSubData(GLenum target, GLintptr dstByteOffset, ArrayBufferView srcData,
- GLuint srcOffset, optional GLuint length = 0);
-
- void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset,
- GLintptr writeOffset, GLsizeiptr size);
- // MapBufferRange, in particular its read-only and write-only modes,
- // can not be exposed safely to JavaScript. GetBufferSubData
- // replaces it for the purpose of fetching data back from the GPU.
- void getBufferSubData(GLenum target, GLintptr srcByteOffset, ArrayBufferView dstData,
- optional GLuint dstOffset = 0, optional GLuint length = 0);
-
- /* Framebuffer objects */
- void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0,
- GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
- void framebufferTextureLayer(GLenum target, GLenum attachment, WebGLTexture? texture, GLint level,
- GLint layer);
- void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);
- void invalidateSubFramebuffer(GLenum target, sequence<GLenum> attachments,
- GLint x, GLint y, GLsizei width, GLsizei height);
- void readBuffer(GLenum src);
-
- /* Renderbuffer objects */
- any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname);
- void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat,
- GLsizei width, GLsizei height);
-
- /* Texture objects */
- void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width,
- GLsizei height);
- void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width,
- GLsizei height, GLsizei depth);
-
- // WebGL1 legacy entrypoints:
- void texImage2D(GLenum target, GLint level, GLint internalformat,
- GLsizei width, GLsizei height, GLint border, GLenum format,
- GLenum type, ArrayBufferView? pixels);
- void texImage2D(GLenum target, GLint level, GLint internalformat,
- GLenum format, GLenum type, TexImageSource source); // May throw DOMException
-
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type, ArrayBufferView? pixels);
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLenum format, GLenum type, TexImageSource source); // May throw DOMException
-
- // WebGL2 entrypoints:
- void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
- GLint border, GLenum format, GLenum type, GLintptr pboOffset);
- void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
- GLint border, GLenum format, GLenum type,
- TexImageSource source); // May throw DOMException
- void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
- GLint border, GLenum format, GLenum type, ArrayBufferView srcData,
- GLuint srcOffset);
-
- void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
- GLsizei depth, GLint border, GLenum format, GLenum type, GLintptr pboOffset);
- void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
- GLsizei depth, GLint border, GLenum format, GLenum type,
- TexImageSource source); // May throw DOMException
- void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
- GLsizei depth, GLint border, GLenum format, GLenum type, ArrayBufferView? srcData);
- void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
- GLsizei depth, GLint border, GLenum format, GLenum type, ArrayBufferView srcData,
- GLuint srcOffset);
-
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
- GLsizei height, GLenum format, GLenum type, GLintptr pboOffset);
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
- GLsizei height, GLenum format, GLenum type,
- TexImageSource source); // May throw DOMException
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
- GLsizei height, GLenum format, GLenum type, ArrayBufferView srcData,
- GLuint srcOffset);
-
- void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
- GLintptr pboOffset);
- void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
- TexImageSource source); // May throw DOMException
- void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
- ArrayBufferView? srcData, optional GLuint srcOffset = 0);
-
- void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height);
-
- void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width,
- GLsizei height, GLint border, GLintptr offset);
- void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width,
- GLsizei height, GLint border, ArrayBufferView srcData,
- optional GLuint srcOffset = 0, optional GLuint srcLengthOverride = 0);
-
- void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width,
- GLsizei height, GLsizei depth, GLint border, GLintptr offset);
- void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width,
- GLsizei height, GLsizei depth, GLint border, ArrayBufferView srcData,
- optional GLuint srcOffset = 0, optional GLuint srcLengthOverride = 0);
-
- void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height, GLenum format, GLintptr offset);
- void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height, GLenum format,
- ArrayBufferView srcData,
- optional GLuint srcOffset = 0,
- optional GLuint srcLengthOverride = 0);
-
- void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLintptr offset);
- void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, ArrayBufferView srcData,
- optional GLuint srcOffset = 0,
- optional GLuint srcLengthOverride = 0);
-
- /* Programs and shaders */
- [WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram program, DOMString name);
-
- /* Uniforms */
- void uniform1ui(WebGLUniformLocation? location, GLuint v0);
- void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1);
- void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
- void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
- void uniform1fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
- void uniform2fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
- void uniform3fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
- void uniform4fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
-
- void uniform1iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
- void uniform2iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
- void uniform3iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
- void uniform4iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
-
- void uniform1uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
- void uniform2uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
- void uniform3uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
- void uniform4uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
- optional GLuint srcLength = 0);
-
- void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
-
- void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
-
- void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
-
- /* Vertex attribs */
- void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
- void vertexAttribI4iv(GLuint index, Int32List values);
- void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
- void vertexAttribI4uiv(GLuint index, Uint32List values);
- void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-
- /* Writing to the drawing buffer */
- void vertexAttribDivisor(GLuint index, GLuint divisor);
- void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
- void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount);
- void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset);
-
- /* Reading back pixels */
- // WebGL1:
- void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
- ArrayBufferView? dstData);
- // WebGL2:
- void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
- GLintptr offset);
- void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
- ArrayBufferView dstData, GLuint dstOffset);
-
- /* Multiple Render Targets */
- void drawBuffers(sequence<GLenum> buffers);
-
- void clearBufferfv(GLenum buffer, GLint drawbuffer, Float32List values,
- optional GLuint srcOffset = 0);
- void clearBufferiv(GLenum buffer, GLint drawbuffer, Int32List values,
- optional GLuint srcOffset = 0);
- void clearBufferuiv(GLenum buffer, GLint drawbuffer, Uint32List values,
- optional GLuint srcOffset = 0);
-
- void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-
- /* Query Objects */
- WebGLQuery? createQuery();
- void deleteQuery(WebGLQuery? query);
- [WebGLHandlesContextLoss] GLboolean isQuery(WebGLQuery? query);
- void beginQuery(GLenum target, WebGLQuery query);
- void endQuery(GLenum target);
- WebGLQuery? getQuery(GLenum target, GLenum pname);
- any getQueryParameter(WebGLQuery query, GLenum pname);
-
- /* Sampler Objects */
- WebGLSampler? createSampler();
- void deleteSampler(WebGLSampler? sampler);
- [WebGLHandlesContextLoss] GLboolean isSampler(WebGLSampler? sampler);
- void bindSampler(GLuint unit, WebGLSampler? sampler);
- void samplerParameteri(WebGLSampler sampler, GLenum pname, GLint param);
- void samplerParameterf(WebGLSampler sampler, GLenum pname, GLfloat param);
- any getSamplerParameter(WebGLSampler sampler, GLenum pname);
-
- /* Sync objects */
- WebGLSync? fenceSync(GLenum condition, GLbitfield flags);
- [WebGLHandlesContextLoss] GLboolean isSync(WebGLSync? sync);
- void deleteSync(WebGLSync? sync);
- GLenum clientWaitSync(WebGLSync sync, GLbitfield flags, GLuint64 timeout);
- void waitSync(WebGLSync sync, GLbitfield flags, GLint64 timeout);
- any getSyncParameter(WebGLSync sync, GLenum pname);
-
- /* Transform Feedback */
- WebGLTransformFeedback? createTransformFeedback();
- void deleteTransformFeedback(WebGLTransformFeedback? tf);
- [WebGLHandlesContextLoss] GLboolean isTransformFeedback(WebGLTransformFeedback? tf);
- void bindTransformFeedback (GLenum target, WebGLTransformFeedback? tf);
- void beginTransformFeedback(GLenum primitiveMode);
- void endTransformFeedback();
- void transformFeedbackVaryings(WebGLProgram program, sequence<DOMString> varyings, GLenum bufferMode);
- WebGLActiveInfo? getTransformFeedbackVarying(WebGLProgram program, GLuint index);
- void pauseTransformFeedback();
- void resumeTransformFeedback();
-
- /* Uniform Buffer Objects and Transform Feedback Buffers */
- void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer);
- void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size);
- any getIndexedParameter(GLenum target, GLuint index);
- sequence<GLuint>? getUniformIndices(WebGLProgram program, sequence<DOMString> uniformNames);
- any getActiveUniforms(WebGLProgram program, sequence<GLuint> uniformIndices, GLenum pname);
- GLuint getUniformBlockIndex(WebGLProgram program, DOMString uniformBlockName);
- any getActiveUniformBlockParameter(WebGLProgram program, GLuint uniformBlockIndex, GLenum pname);
- DOMString? getActiveUniformBlockName(WebGLProgram program, GLuint uniformBlockIndex);
- void uniformBlockBinding(WebGLProgram program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-
- /* Vertex Array Objects */
- WebGLVertexArrayObject? createVertexArray();
- void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
- [WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
- void bindVertexArray(WebGLVertexArrayObject? array);
-};
-WebGL2RenderingContextBase implements WebGLRenderingContextBase;
-
-interface WebGL2RenderingContext
-{
-};
-WebGL2RenderingContext implements WebGL2RenderingContextBase;
-
-
+++ /dev/null
-include ../../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/testapps/atscdmx
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= main.o
-
-LINKFLAGS=-L../../../bin/gcc
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=atscdmx$(EXE)
-else
-EXT=
-PROG=atscdmx
-endif
-LINKFLAGS+=-lgpac
-
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2018
- * All rights reserved
- *
- * This file is part of GPAC - ATSC/ROUTE implementation
- *
- */
-
-#include <gpac/atsc.h>
-#include <time.h>
-
-void PrintUsage()
-{
- fprintf(stderr, "USAGE: [OPTS]\n"
-#ifdef GPAC_MEMORY_TRACKING
- "-mem-track: enables memory tracker\n"
- "-mem-track-stack: enables memory tracker with stack dumping\n"
-#endif
- "-log-file file: sets output log file. Also works with -lf\n"
- "-logs log_args: sets log tools and levels, formatted as a ':'-separated list of toolX[:toolZ]@levelX\n"
- "-log-clock or -lc logs time in micro sec since start time of GPAC before each log line.\n"
- "-log-utc or -lu logs UTC time in ms before each log line.\n"
- "-ifce IP: IP adress of network interface to use\n"
- "-dir PATH: local filesystem path to which the files are written. If not set, memory mode is used.\n"
- " NOTE: memory mode is not yet implemented ...\n"
- "-service ID: ID of the service to play. If not set, all services are dumped. If 0, no services are dumped\n"
- "\n"
- "\n on OSX with VM packet replay you will need to force mcast routing, eg:\n"
- "route add -net 239.255.1.4/32 -interface vboxnet0\n"
- );
-}
-
-static u64 log_time_start = 0;
-static Bool log_utc_time = GF_FALSE;
-static u64 last_log_time=0;
-static void on_atscd_log(void *cbk, GF_LOG_Level ll, GF_LOG_Tool lm, const char *fmt, va_list list)
-{
- FILE *logs = cbk ? cbk : stderr;
- if (log_time_start) {
- u64 now = gf_sys_clock_high_res();
- fprintf(logs, "At "LLD" (diff %d) - ", now - log_time_start, (u32) (now - last_log_time) );
- last_log_time = now;
- }
- if (log_utc_time) {
- u64 utc_clock = gf_net_get_utc() ;
- time_t secs = utc_clock/1000;
- struct tm t;
- t = *gmtime(&secs);
- fprintf(logs, "UTC %d-%02d-%02dT%02d:%02d:%02dZ (TS "LLU") - ", 1900+t.tm_year, t.tm_mon+1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, utc_clock);
- }
- vfprintf(logs, fmt, list);
- fflush(logs);
-}
-
-int main(int argc, char **argv)
-{
- u32 i, serviceID=0xFFFFFFFF;
- Bool run = GF_TRUE;
- GF_MemTrackerType mem_track = GF_MemTrackerNone;
- const char *ifce = NULL;
- const char *dir = NULL;
- FILE *logfile = NULL;
- GF_ATSCDmx *atscd;
- if (argc<1) {
- PrintUsage();
- return 0;
- }
- for (i=0; i<(u32)argc; i++) {
- char *arg = argv[i];
- if (!strcmp(arg, "-mem-track") || !strcmp(arg, "-mem-track-stack")) {
-#ifdef GPAC_MEMORY_TRACKING
- mem_track = !strcmp(arg, "-mem-track-stack") ? GF_MemTrackerBackTrace : GF_MemTrackerSimple;
-#else
- fprintf(stderr, "WARNING - GPAC not compiled with Memory Tracker - ignoring \"%s\"\n", argv[i]);
-#endif
- }
- }
-
- /*****************/
- /* gpac init */
- /*****************/
-#ifdef GPAC_MEMORY_TRACKING
- gf_sys_init(mem_track);
-#else
- gf_sys_init(GF_MemTrackerNone);
-#endif
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_WARNING);
- gf_log_set_tool_level(GF_LOG_CONTAINER, GF_LOG_INFO);
-
- //parse args
- for (i=0; i<(u32)argc; i++) {
- char *arg = argv[i];
-
- if (!strcmp(arg, "-ifce")) ifce=argv[++i];
- else if (!strcmp(arg, "-dir")) dir=argv[++i];
- else if (!strcmp(arg, "-service")) serviceID=atoi(argv[++i]);
- else if (!strcmp(arg, "-log-file") || !strcmp(arg, "-lf")) {
- logfile = gf_fopen(argv[i+1], "wt");
- i++;
- } else if (!strcmp(arg, "-logs") ) {
- if (gf_log_set_tools_levels(argv[i+1]) != GF_OK) {
- return 1;
- }
- i++;
- } else if (!strcmp(arg, "-log-clock") || !strcmp(arg, "-lc")) {
- log_time_start = 1;
- } else if (!strcmp(arg, "-log-utc") || !strcmp(arg, "-lu")) {
- log_utc_time = 1;
- }
- }
-
- gf_log_set_callback(logfile, on_atscd_log);
- if (log_time_start) log_time_start = gf_sys_clock_high_res();
- /*****************/
- /* atsc init */
- /*****************/
- atscd = gf_atsc3_dmx_new(ifce, dir, 0);
- gf_atsc3_tune_in(atscd, serviceID, GF_FALSE);
-
- while (atscd && run) {
- GF_Err e = gf_atsc3_dmx_process(atscd);
- if (e == GF_IP_NETWORK_EMPTY)
- gf_sleep(1);
-
- if (gf_prompt_has_input()) {
- u8 c = gf_prompt_get_char();
- switch (c) {
- case 'q':
- run = GF_FALSE;
- break;
- }
- }
- }
- gf_atsc3_dmx_del(atscd);
-
- if (logfile) gf_fclose(logfile);
- gf_sys_close();
-
-#ifdef GPAC_MEMORY_TRACKING
- if (mem_track && (gf_memory_size() || gf_file_handles_count() )) {
- gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
- gf_memory_print();
- return 2;
- }
-#endif
- return 0;
-}
-
+++ /dev/null
-include ../../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/testapps/bmp4demux
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= main.o
-
-LINKFLAGS=-L../../../bin/gcc
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=bmp4demux$(EXE)
-else
-EXT=
-PROG=bmp4demux
-endif
-LINKFLAGS+=-lgpac
-
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual Studio 2010\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bmp4demux", "bmp4demux.vcxproj", "{978A2D9F-E44F-4073-8032-333563BCC160}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Win32 = Debug|Win32\r
- Release|Win32 = Release|Win32\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.Build.0 = Debug|Win32\r
- {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.ActiveCfg = Release|Win32\r
- {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.Build.0 = Release|Win32\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\..\src\isomedia\avc_ext.c">\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_3gpp.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_adobe.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_apple.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_base.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_drm.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_meta.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_funcs.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\data_map.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\drm_sample.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\isom_intern.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\isom_read.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\isom_store.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\isom_write.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\media.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\media_odf.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\meta.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\movie_fragments.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\sample_descs.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\stbl_read.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\stbl_write.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\track.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\ttml.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\tx3g.c" />\r
- <ClCompile Include="..\..\..\src\media_tools\webvtt.c" />\r
- <ClCompile Include="..\..\..\src\odf\descriptors.c" />\r
- <ClCompile Include="..\..\..\src\odf\desc_private.c" />\r
- <ClCompile Include="..\..\..\src\odf\odf_code.c" />\r
- <ClCompile Include="..\..\..\src\odf\odf_codec.c" />\r
- <ClCompile Include="..\..\..\src\odf\odf_command.c" />\r
- <ClCompile Include="..\..\..\src\odf\odf_parse.c" />\r
- <ClCompile Include="..\..\..\src\odf\slc.c" />\r
- <ClCompile Include="..\..\..\src\utils\alloc.c" />\r
- <ClCompile Include="..\..\..\src\utils\bitstream.c" />\r
- <ClCompile Include="..\..\..\src\utils\configfile.c" />\r
- <ClCompile Include="..\..\..\src\utils\error.c" />\r
- <ClCompile Include="..\..\..\src\utils\list.c" />\r
- <ClCompile Include="..\..\..\src\utils\os_divers.c" />\r
- <ClCompile Include="..\..\..\src\utils\os_file.c" />\r
- <ClCompile Include="..\..\..\src\utils\os_thread.c" />\r
- <ClCompile Include="..\..\..\src\utils\url.c" />\r
- <ClCompile Include="main.c" />\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{978A2D9F-E44F-4073-8032-333563BCC160}</ProjectGuid>\r
- <ProjectName>bmp4demux</ProjectName>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <PlatformToolset>v110</PlatformToolset>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <PlatformToolset>v100</PlatformToolset>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>11.0.60610.1</_ProjectFileVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir>obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental>true</LinkIncremental>\r
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules />\r
- <CodeAnalysisRuleAssemblies />\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir>obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental>false</LinkIncremental>\r
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules />\r
- <CodeAnalysisRuleAssemblies />\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Midl>\r
- <TypeLibraryName>.\Debug/bmp4demux.tlb</TypeLibraryName>\r
- <HeaderFileName />\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>\r
- </PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <UndefinePreprocessorDefinitions>\r
- </UndefinePreprocessorDefinitions>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>$(OutDir);../../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>.\Debug/bmp4demux.bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Midl>\r
- <TypeLibraryName>.\Release/bmp4demux.tlb</TypeLibraryName>\r
- <HeaderFileName />\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>MaxSpeed</Optimization>\r
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>.\Release/bmp4demux.pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
- <ObjectFileName>.\Release/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../../extra_lib/lib/w32_rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ProgramDatabaseFile>.\Release/bmp4demux.pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>.\Release/bmp4demux.bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <ClCompile Include="..\..\..\src\isomedia\avc_ext.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_3gpp.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_adobe.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_apple.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_base.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_drm.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_meta.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_funcs.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\data_map.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\drm_sample.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\isom_intern.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\isom_read.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\isom_store.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\isom_write.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\media.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\media_odf.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\meta.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\movie_fragments.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\sample_descs.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\stbl_read.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\stbl_write.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\track.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\tx3g.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\bitstream.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\error.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\list.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\desc_private.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\descriptors.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\odf_code.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\odf_codec.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\odf_command.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\odf_parse.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\media_tools\webvtt.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="main.c" />
- <ClCompile Include="..\..\..\src\utils\url.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\slc.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\alloc.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\configfile.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\os_divers.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\os_thread.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\ttml.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\os_file.c">
- <Filter>others</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <Filter Include="isoff">
- <UniqueIdentifier>{c9a8f639-328c-4505-be50-4859357c2c00}</UniqueIdentifier>
- </Filter>
- <Filter Include="others">
- <UniqueIdentifier>{e5ca7285-ca00-49d8-ac81-dff3d494be9a}</UniqueIdentifier>
- </Filter>
- </ItemGroup>
-</Project>
\ No newline at end of file
+++ /dev/null
-#!/bin/sh
-gcc -o fmp4demux main.c ../../../src/utils/os_config_init.c ../../../src/utils/os_divers.c ../../../src/utils/os_file.c ../../../src/utils/os_thread.c ../../../src/utils/alloc.c ../../../src/utils/bitstream.c ../../../src/utils/configfile.c ../../../src/odf/desc_private.c ../../../src/odf/descriptors.c ../../../src/utils/error.c ../../../src/utils/list.c ../../../src/odf/odf_code.c ../../../src/odf/odf_codec.c ../../../src/odf/odf_command.c ../../../src/odf/odf_parse.c ../../../src/odf/slc.c ../../../src/utils/url.c ../../../src/media_tools/webvtt.c ../../../src/isomedia/avc_ext.c ../../../src/isomedia/box_code_3gpp.c ../../../src/isomedia/box_code_adobe.c ../../../src/isomedia/box_code_apple.c ../../../src/isomedia/box_code_base.c ../../../src/isomedia/box_code_drm.c ../../../src/isomedia/box_code_meta.c ../../../src/isomedia/box_funcs.c ../../../src/isomedia/data_map.c ../../../src/isomedia/drm_sample.c ../../../src/isomedia/isom_intern.c ../../../src/isomedia/isom_read.c ../../../src/isomedia/isom_store.c ../../../src/isomedia/isom_write.c ../../../src/isomedia/media.c ../../../src/isomedia/media_odf.c ../../../src/isomedia/meta.c ../../../src/isomedia/movie_fragments.c ../../../src/isomedia/sample_descs.c ../../../src/isomedia/stbl_read.c ../../../src/isomedia/stbl_write.c ../../../src/isomedia/track.c ../../../src/isomedia/tx3g.c -L../../../bin/gcc -lpthread -ldl -I../../../include -DGPAC_MINIMAL_ODF -DGPAC_DISABLE_AV_PARSERS -DGPAC_DISABLE_ISOM_DUMP -DGPAC_DISABLE_ZLIB
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Cyril Concolato
- * Copyright (c) Telecom ParisTech 2013-
- * All rights reserved
- *
- * This file is part of GPAC / sample MP4 demultiplexing application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/tools.h>
-#include <gpac/isomedia.h>
-
-int main(int argc, char **argv)
-{
- /* The ISO progressive reader */
- GF_ISOFile *movie;
- /* Error indicator */
- GF_Err e;
- /* Number of bytes required to finish the current ISO Box reading */
- u64 missing_bytes;
- /* Return value for the program */
- int ret = 0;
- u32 track_id = 1;
- u32 track_number;
- u32 sample_count;
- u32 sample_index;
-
- /* Usage */
- if (argc < 2) {
- fprintf(stdout, "Usage: %s filename [track_id]\n", argv[0]);
- return 1;
- }
- if (argc == 3) {
- track_id = atoi(argv[2]);
- }
-
- e = gf_isom_open_progressive(argv[1], 0, 0, &movie, &missing_bytes);
- if ((e != GF_OK && e != GF_ISOM_INCOMPLETE_FILE) || movie == NULL) {
- fprintf(stdout, "Could not open file %s for reading (%s).\n", argv[1], gf_error_to_string(e));
- return 1;
- }
-
- track_number = gf_isom_get_track_by_id(movie, track_id);
- if (track_number == 0) {
- fprintf(stdout, "Could not find track ID=%u of file %s.\n", track_id, argv[1]);
- ret = 1;
- goto exit;
- }
-
- sample_count = gf_isom_get_sample_count(movie, track_number);
- sample_index = 1;
- while (sample_index <= sample_count) {
- GF_ISOSample *iso_sample;
- u32 sample_description_index;
-
- iso_sample = gf_isom_get_sample(movie, track_number, sample_index, &sample_description_index);
- if (iso_sample) {
- fprintf(stdout, "Found sample #%5d/%5d of length %8d, RAP: %d, DTS: "LLD", CTS: "LLD"\n", sample_index, sample_count, iso_sample->dataLength, iso_sample->IsRAP, iso_sample->DTS, iso_sample->DTS+iso_sample->CTS_Offset);
- sample_index++;
-
- /*release the sample data, once you're done with it*/
- gf_isom_sample_del(&iso_sample);
- } else {
- e = gf_isom_last_error(movie);
- if (e == GF_ISOM_INCOMPLETE_FILE) {
- missing_bytes = gf_isom_get_missing_bytes(movie, track_number);
- fprintf(stdout, "Missing "LLU" bytes on input file\n", missing_bytes);
- gf_sleep(1000);
- }
- }
- }
-
-exit:
- gf_isom_close(movie);
-
- return ret;
-}
+++ /dev/null
-include ../../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/testapps/broadcaster
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-SOURCES=
-APPNAME=broadcaster
-
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS=RTP_serv_generator.o RTP_serv_packetizer.o RTP_serv_sender.o broadcaster.o sdp_generator.o debug.o
-
-LINKFLAGS=-L../../../bin/gcc -lgpac
-
-all: broadcaster
-
-broadcaster: $(OBJS) *.h
- $(CC) -o $(APPNAME) $(OBJS) $(LINKFLAG) $(LDFLAGS)
-
-clean:
- -rm -f $(OBJS) $(APPNAME) *~
-
-
+++ /dev/null
-#include <assert.h>
-#include <string.h>
-#include <errno.h>
-
-#include "RTP_serv_generator.h"
-#include "debug.h"
-
-/* Callback function called when encoding of BT is done */
-GF_Err SampleCallBack(void *calling_object, u16 ESID, char *au, u32 size, u64 ts)
-{
- PNC_CallbackData *data = (PNC_CallbackData *)calling_object;
- /* call the packetizer to create RTP packets */
- PNC_ProcessData(data, au, size, ts);
- return GF_OK;
-}
-
-GF_Err (*MySampleCallBack)(void *, u16, char *data, u32 size, u64 ts) = &SampleCallBack;
-
-PNC_CallbackData *PNC_Init_SceneGenerator(GF_RTPChannel *p_chan, GF_RTPHeader *p_hdr, char *default_scene,
- u32 socketType, u16 socketPort, int debug)
-{
- GF_Err e;
- PNC_CallbackData *data = gf_malloc(sizeof(PNC_CallbackData));
- int *i;
- data->chan = p_chan;
- data->hdr = p_hdr;
- data->debug = debug;
- memset( (void*) (data->buffer), '\0', RECV_BUFFER_SIZE_FOR_COMMANDS);
- data->bufferPosition = 0;
- /* Loading the initial scene as the encoding context */
- data->codec = gf_seng_init((void*)data, default_scene);
- if (!data->codec) {
- fprintf(stderr, "Cannot create BIFS Engine from %s\n", default_scene);
- gf_free(data);
- return NULL;
- }
- data->server_socket = NULL;
- data->socket = NULL;
-
- if (socketType == GF_SOCK_TYPE_TCP)
- {
- data->server_socket = gf_sk_new(socketType);
- e = gf_sk_bind(data->server_socket, NULL, (u16) socketPort, NULL, 0, 0);
- if (e)
- fprintf(stderr, "Failed to bind : %s\n", gf_error_to_string(e));
- e |= gf_sk_listen(data->server_socket, 1);
- if (e)
- fprintf(stderr, "Failed to listen : %s\n", gf_error_to_string(e));
- e |= gf_sk_set_block_mode(data->server_socket, 0);
- if (e)
- fprintf(stderr, "Failed to set block mode : %s\n", gf_error_to_string(e));
- e |= gf_sk_server_mode(data->server_socket, 0);
- if (e)
- fprintf(stderr, "Failed to set server mode : %s\n", gf_error_to_string(e));
- } else {
- data->socket = gf_sk_new(socketType);
- e = gf_sk_bind(data->socket, NULL, (u16) socketPort, NULL, 0, 0);
- }
- /*
- char buffIp[1024];
- u16 port = 0;
- u32 socket_type = 0;
- e |= gf_sk_get_local_ip(data->socket, buffIp);
- e |= gf_sk_get_local_info(data->socket, &port, &socket_type);
- dprintf(DEBUG_RTP_serv_generator, "RTS_serv_generator %s:%d %s\n",
- buffIp, port, socket_type==GF_SOCK_TYPE_UDP?"UDP":"TCP", e==GF_OK?"OK":"ERROR");
- */
- if (e) {
- fprintf(stderr, "Cannot bind socket to port %d (%s)\n", socketPort, gf_error_to_string(e));
- if (data->socket)
- gf_sk_del(data->socket);
- if (data->server_socket)
- gf_sk_del(data->server_socket);
- gf_free(data);
- return NULL;
- }
- data->extension = gf_malloc(sizeof(PNC_CallbackExt));
- ((PNC_CallbackExt * )data->extension)->i = 0;
- ((PNC_CallbackExt * )data->extension)->lastTS = 0;
- i = &((PNC_CallbackExt*)data->extension)->i;
- return data;
-}
-
-void PNC_SendInitScene(PNC_CallbackData * data)
-{
- data->RAP = 1;
- data->SAUN_inc = 1;
- gf_seng_encode_context(data->codec, MySampleCallBack);
-}
-
-void PNC_Close_SceneGenerator(PNC_CallbackData * data)
-{
- if (data->extension) gf_free(data->extension);
- gf_seng_terminate(data->codec);
- gf_rtp_del(data->chan);
- PNC_ClosePacketizer(data);
- gf_free(data);
-}
-
-
-/**
- * Finds the command directive if any
- */
-static int findCommand(const char * buffer, int searchFrom)
-{
- char * sstr;
- assert( buffer );
- assert( searchFrom >= 0);
- /** We may have received #RTP_STREAM_ directive before the last update */
- if (searchFrom < 30) {
- searchFrom = 0;
- } else {
- searchFrom-= 30;
- }
- sstr = strstr(&(buffer[searchFrom]), "#_RTP_STREAM_");
- if (sstr) {
- return (sstr - buffer);
- }
- return -1;
-}
-
-static GF_Err processSend(PNC_CallbackData * data, char * bsBuffer)
-{
- GF_Err error;
- assert( data );
- assert( bsBuffer );
- assert( data->codec );
- dprintf(DEBUG_RTP_serv_generator, "RTP STREAM SEND\n");
- gf_mx_p(data->carrousel_mutex);
- error = gf_seng_encode_from_string(data->codec, 0, 0, bsBuffer, MySampleCallBack);
- gf_mx_v(data->carrousel_mutex);
- gf_free( bsBuffer );
- return error;
-}
-
-static GF_Err processRapReset(PNC_CallbackData * data, char * bsBuffer)
-{
- GF_Err error;
- dprintf(DEBUG_RTP_serv_generator, "RTP STREAM RAP RESET\n");
- gf_mx_p(data->carrousel_mutex);
- data->RAP = 1;
- data->RAPsent++;
- data->SAUN_inc = 1;
- error = gf_seng_aggregate_context(data->codec, 0);
- if (error == GF_OK)
- error = gf_seng_encode_context(data->codec, MySampleCallBack);
- gf_mx_v(data->carrousel_mutex);
- gf_free( bsBuffer );
- return error;
-}
-
-static GF_Err processRap(PNC_CallbackData * data, char * bsBuffer)
-{
- GF_Err error;
- dprintf(DEBUG_RTP_serv_generator, "RTP STREAM RAP\n");
- gf_mx_p(data->carrousel_mutex);
- data->SAUN_inc = 1;
- data->RAP = 1;
- data->RAPsent++;
- error = gf_seng_aggregate_context(data->codec, 0);
- if (GF_OK == error)
- error = gf_seng_encode_context(data->codec, MySampleCallBack);
- gf_mx_v(data->carrousel_mutex);
- gf_free( bsBuffer );
- return error;
-}
-
-static GF_Err processSendCritical(PNC_CallbackData * data, char * bsBuffer)
-{
- GF_Err error;
- dprintf(DEBUG_RTP_serv_generator, "RTP STREAM SEND CRITICAL\n");
- gf_mx_p(data->carrousel_mutex);
- data->SAUN_inc = 1;
- error = gf_seng_encode_from_string(data->codec, 0, 0, bsBuffer, MySampleCallBack);
- gf_mx_v(data->carrousel_mutex);
- gf_free( bsBuffer );
- return error;
-}
-
-/**
- * Allocates a new buffer for output and copy everything in it;
- * then copy off data from newStart to upToPosition.
- */
-static char * eat_buffer_to_bs(char * data, int newStart, int upToPosition, int dataFullSize)
-{
- char * newBuffer;
-
- /* Sanity checks */
- assert(data);
- assert(newStart >= 0);
- assert(upToPosition >= 0);
- assert(dataFullSize > 0);
- assert(newStart < upToPosition);
- data[upToPosition] = '\0';
- newBuffer = NULL;
-
- /*new length + '\0'*/
- assert(dataFullSize >= upToPosition-newStart+2);
- newBuffer = (char*)gf_malloc(dataFullSize);
- memcpy(newBuffer, data, dataFullSize);
- memcpy(data, newBuffer+newStart, upToPosition-newStart+1);
- data[upToPosition-newStart+1]='\0';
- dprintf(DEBUG_RTP_serv_generator, "Generated : '%s'\n", newBuffer);
- return newBuffer;
-}
-
-GF_Err PNC_processBIFSGenerator(PNC_CallbackData * data)
-{
- const int tmpBufferSize = 2048;
- char *tmpBuffer = (char*)malloc(tmpBufferSize);
- int byteRead=0;
-
- char *bsBuffer;
- int retour=0;
- GF_Err e;
-
- if (data->server_socket)
- {
- data->socket = NULL;
- e = gf_sk_accept(data->server_socket, &(data->socket));
- if (e) {
- free(tmpBuffer);
- return GF_OK;
- } else {
- dprintf(DEBUG_RTP_serv_generator, "New TCP client connected !\n");
- }
- }
-
- do
- {
- if (data->socket == NULL)
- return GF_OK;
- e = gf_sk_receive(data->socket, tmpBuffer, tmpBufferSize, 0, & byteRead);
- switch (e) {
- case GF_IP_NETWORK_EMPTY:
- e = GF_OK;
- break;
- case GF_OK:
- if (byteRead > 0) {
- dprintf(DEBUG_RTP_serv_generator, "Received %d bytes\n", byteRead);
- /* We copy data in buffer */
- memcpy( &(data->buffer[data->bufferPosition]), tmpBuffer, byteRead );
- data->buffer[data->bufferPosition + byteRead] = '\0';
- retour = findCommand( data->buffer, data->bufferPosition);
- data->bufferPosition += byteRead;
- if (retour >= 0) {
- /** OK, it means we found a command ! */
- if (strncmp(&(data->buffer[retour+13]),
- "SEND_CRITICAL", 13)==0) {
- bsBuffer = eat_buffer_to_bs( data->buffer, retour, retour + 26, RECV_BUFFER_SIZE_FOR_COMMANDS);
- data->bufferPosition = 0;
- return processSendCritical(data, bsBuffer);
- }
- if (strncmp(&(data->buffer[retour+13]), "SEND", 4)==0) {
- bsBuffer = eat_buffer_to_bs( data->buffer, retour, retour + 17, RECV_BUFFER_SIZE_FOR_COMMANDS);
- data->bufferPosition = 0;
- return processSend(data, bsBuffer);
- }
- if (strncmp(&(data->buffer[retour+13]), "RAP", 3)==0) {
- bsBuffer = eat_buffer_to_bs( data->buffer, retour, retour + 16, RECV_BUFFER_SIZE_FOR_COMMANDS);
- data->bufferPosition = 0;
- return processRap(data, bsBuffer);
- }
- if (strncmp(&(data->buffer[retour+13]), "RAP_RESET", 9)==0) {
- bsBuffer = eat_buffer_to_bs( data->buffer, retour, retour + 22, RECV_BUFFER_SIZE_FOR_COMMANDS);
- data->bufferPosition = 0;
- return processRapReset(data, bsBuffer);
- }
- /** If we are here, it means probably we did not received fully the command */
- break;
- }
- }
- /* No bytes were received */
- break;
- default:
- fprintf(stderr, "Socket error while receiving BIFS data %s\n", gf_error_to_string(e));
- if (data->socket != NULL) {
- gf_sk_del(data->socket);
- data->socket = NULL;
- }
- return e;
- }
-
- } while (e == GF_OK);
-
- return GF_OK;
-}
+++ /dev/null
-#ifndef _RTP_SERV_GENERATOR_H_
-#define _RTP_SERV_GENERATOR_H_
-#include <stdlib.h>
-
-#include <gpac/ietf.h>
-#include <gpac/network.h> // sockets
-#include <gpac/internal/media_dev.h>
-#include <gpac/thread.h>
-#include <gpac/scene_engine.h>
-
-#include <time.h>
-#define RECV_BUFFER_SIZE_FOR_COMMANDS 262144
-
-
-/*callback type (allows reentrance)*/
-typedef struct tmp_PNC_CallbackData {
- GF_RTPChannel *chan;
- GF_RTPHeader *hdr;
- char * formatedPacket;
- int formatedPacketLength;
- GP_RTPPacketizer *rtpBuilder;
- GF_SceneEngine *codec;
-
- /* socket on which updates are received */
- GF_Socket *socket;
- GF_Socket *server_socket;
- /* socket on which bitrate feedback is sent */
- GF_Socket *feedback_socket;
-
- void *extension;
-
- /* indication that the Access Unit is a RAP */
- int RAP;
- /* RAP counter */
- int RAPsent;
- /* indication that the Access Unit Sequence Number should be increased */
- int SAUN_inc;
-
- GF_Mutex *carrousel_mutex;
- char buffer[RECV_BUFFER_SIZE_FOR_COMMANDS];
- int bufferPosition;
- int debug;
-} PNC_CallbackData;
-
-
-
-#define RTP_SERV_GENERATOR_DEBUG 0x4
-
-typedef struct tmp_PNC_CallbackExt {
- int i;
- int lastTS;
-} PNC_CallbackExt;
-
-
-/*exports*/
-extern GF_Err PNC_RAP(PNC_CallbackData *data);
-extern PNC_CallbackData* PNC_Init_SceneGenerator(GF_RTPChannel *p_chan, GF_RTPHeader *p_hdr, char *default_scene,
- u32 socketType, u16 socketPort, int debug);
-extern GF_Err PNC_processBIFSGenerator(PNC_CallbackData*);
-extern void PNC_Close_SceneGenerator(PNC_CallbackData*);
-
-extern void PNC_SendInitScene(PNC_CallbackData * data);
-
-#include "RTP_serv_packetizer.h"
-
-#endif
\ No newline at end of file
+++ /dev/null
-#include "RTP_serv_packetizer.h"
-#include "RTP_serv_sender.h"
-#include <assert.h>
-
-#include <gpac/ietf.h>
-#include <gpac/mpeg4_odf.h>
-#include <gpac/internal/media_dev.h>
-
-#define MAX_PACKET_SIZE 2000
-
-#include "debug.h"
-
-
-void OnNewPacket(void *cbk, GF_RTPHeader *header)
-{
- ((PNC_CallbackData *)cbk)->formatedPacketLength = 0;
-}
-
-void OnPacketDone(void *cbk, GF_RTPHeader *header)
-{
- PNC_CallbackData *data = (PNC_CallbackData *)cbk;
- dprintf(DEBUG_RTP_serv_packetizer, "RTP Packet done\n");
- PNC_SendRTP(data, ((PNC_CallbackData *)cbk)->formatedPacket, ((PNC_CallbackData *)cbk)->formatedPacketLength);
- ((PNC_CallbackData *)cbk)->formatedPacketLength = 0;
-}
-
-void OnData(void *cbk, char *data, u32 data_size, Bool is_head)
-{
- memcpy(((PNC_CallbackData *)cbk)->formatedPacket+((PNC_CallbackData *)cbk)->formatedPacketLength, data, data_size);
- ((PNC_CallbackData *)cbk)->formatedPacketLength += data_size;
-}
-
-void PNC_InitPacketiser(PNC_CallbackData * data, char *sdp_fmt, unsigned short mtu_size)
-{
- GP_RTPPacketizer *p;
- GF_SLConfig sl;
- memset(&sl, 0, sizeof(sl));
- sl.useTimestampsFlag = 1;
- sl.useRandomAccessPointFlag = 1;
- sl.timestampResolution = 1000;
- sl.AUSeqNumLength = 16;
-
- p = gf_rtp_builder_new(GF_RTP_PAYT_MPEG4,
- &sl,
- GP_RTP_PCK_SIGNAL_RAP | GP_RTP_PCK_SIGNAL_AU_IDX,
- data,
- OnNewPacket,
- OnPacketDone,
- NULL,
- OnData);
- if (!p) {
- fprintf(stderr, "Cannot create RTP builder \n");
- return;
- }
-
- /* Mtu size - 20 = payload max size */
- mtu_size-=20;
- gf_rtp_builder_init(p, 96, mtu_size, 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, NULL);
- gf_rtp_builder_format_sdp(p, "mpeg4-generic", sdp_fmt, NULL, 0);
- p->rtp_header.Version=2;
- p->rtp_header.SSRC=rand();
- data->hdr=& p->rtp_header;
- data->rtpBuilder=p;
- data->formatedPacket = gf_malloc(MAX_PACKET_SIZE);
- data->formatedPacketLength = 0;
-}
-
-void PNC_ClosePacketizer(PNC_CallbackData *data)
-{
- gf_free(data->formatedPacket);
- gf_rtp_builder_del(data->rtpBuilder);
-}
-
-GF_Err PNC_ProcessData(PNC_CallbackData * data, char *au, u32 size, u64 ts)
-{
- assert( data );
- assert( au );
- /* We need to set a TS different every time */
- data->hdr->TimeStamp = (u32) gf_sys_clock();
- data->rtpBuilder->sl_header.compositionTimeStamp = (u32) gf_sys_clock();
- data->rtpBuilder->sl_header.randomAccessPointFlag = data->RAP;
- if (data->SAUN_inc) data->rtpBuilder->sl_header.AU_sequenceNumber++;
-
- /* reset input data config */
- data->RAP=0;
- data->SAUN_inc=0;
-
- data->rtpBuilder->sl_header.paddingBits = 0;
- gf_rtp_builder_process(data->rtpBuilder, au, size, 1, size, 0, 0);
-
- return GF_OK;
-}
+++ /dev/null
-#ifndef __RTP_SERV_PACKETISER
-#define __RTP_SERV_PACKETISER
-
-#include <gpac/ietf.h>
-#include "gpac/scene_engine.h" // For M4Sample
-#include "RTP_serv_generator.h"
-
-/*exports*/
-void PNC_InitPacketiser(PNC_CallbackData *data, char *sdp_fmt, unsigned short mtu_size);
-GF_Err PNC_ProcessData(PNC_CallbackData *data, char *au, u32 size, u64 ts);
-void PNC_ClosePacketizer(PNC_CallbackData *data);
-
-#endif
+++ /dev/null
-#include "RTP_serv_sender.h"
-#include <gpac/internal/ietf_dev.h>
-#include <gpac/ietf.h>
-#include "debug.h"
-
-
-GF_Err PNC_InitRTP(GF_RTPChannel **chan, char *dest, int port, unsigned short mtu_size)
-{
- GF_Err res;
- GF_RTSPTransport tr;
-
- *chan = gf_rtp_new();
- res = gf_rtp_set_ports(*chan, 0);
- if (res) {
- fprintf(stderr, "Cannot set RTP ports: %s\n", gf_error_to_string(res));
- gf_rtp_del(*chan);
- return res;
- }
-
- tr.destination = dest;
- tr.IsUnicast = gf_sk_is_multicast_address(dest) ? 0 : 1;
- tr.Profile="RTP/AVP";//RTSP_PROFILE_RTP_AVP;
- tr.IsRecord = 0;
- tr.Append = 0;
- tr.source = "0.0.0.0";
- tr.SSRC=rand();
-
- tr.port_first = port;
- tr.port_last = port+1;
- if (tr.IsUnicast) {
- tr.client_port_first = port;
- tr.client_port_last = port+1;
- } else {
- tr.source = dest;
- tr.client_port_first = 0;
- tr.client_port_last = 0;
- }
-
- res = gf_rtp_setup_transport(*chan, &tr, dest);
- if (res) {
- fprintf(stderr, "Cannot setup RTP transport %s\n", gf_error_to_string(res));
- gf_rtp_del(*chan);
- return res;
- }
-
- res = gf_rtp_initialize(*chan, 0, 1, mtu_size, 0, 0, NULL);
- if (res) {
- fprintf(stderr, "Cannot initialize RTP transport %s\n", gf_error_to_string(res));
- gf_rtp_del(*chan);
- return res;
- }
- return GF_OK;
-}
-
-
-GF_Err PNC_SendRTP(PNC_CallbackData *data, char *payload, int payloadSize)
-{
- GF_Err e;
- unsigned char feedback_buffer[250];
-
- if (!data->hdr->TimeStamp)
- data->hdr->TimeStamp = ((PNC_CallbackExt * )data->extension)->lastTS;
-
- ((PNC_CallbackExt * )data->extension)->lastTS = data->hdr->TimeStamp;
-
- e = gf_rtp_send_packet(data->chan, data->hdr, payload, payloadSize, 0);
- dprintf(DEBUG_RTP_serv_sender, "SendPacket : %d, TimeStamp RTP = %d, sz= %d\n",
- e, data->hdr->TimeStamp, payloadSize);
-
- // sending feedback bytes
- memset(feedback_buffer, 0, sizeof(feedback_buffer));
- sprintf((char *) feedback_buffer, "DataSent=%d\nRAPsent=%d\n", payloadSize, data->RAPsent);
- e = gf_sk_send(data->feedback_socket, feedback_buffer, strlen((char *) feedback_buffer));
- dprintf(DEBUG_RTP_serv_packetizer, "Sent feedback data %d byte, return %d\n", payloadSize, e);
-
- return GF_OK;
-}
-
-GF_Err PNC_CloseRTP(GF_RTPChannel *chan)
-{
- gf_rtp_del(chan);
- return GF_OK;
-}
+++ /dev/null
-#ifndef __RTP_SERV_SENDER
-#define __RTP_SERV_SENDER
-
-#include <gpac/ietf.h> /// For GF_Err ...
-#include "RTP_serv_generator.h"
-
-extern void test_RTP_serv_send();
-
-extern GF_Err PNC_InitRTP(GF_RTPChannel **chan, char *dest, int port, unsigned short mtu_size);
-extern GF_Err PNC_SendRTP(PNC_CallbackData *data, char *payload, int payloadSize);
-extern GF_Err PNC_CloseRTP(GF_RTPChannel *chan);
-
-
-#endif
+++ /dev/null
-#include "broadcaster.h"
-#include "debug.h"
-
-static void printIncompatibleOptions()
-{
- fprintf(stderr, "Options config file and tcp port are incompatible !\n");
-}
-
-extern GF_Err SampleCallBack(void *, u16, char *data, u32 size, u64 ts);
-
-/**
- * Returns a port from a char value, will return 0 if port is not valid
- */
-static unsigned short port_from_string(const char * port_to_parse)
-{
- unsigned long int v;
- char * endptr = '\0';
- const char * value = port_to_parse;
- if (value == NULL || value[0] == '\0') {
- fprintf(stderr, "Value for port cannot be empty");
- return 0;
- }
- v = strtoul(value, &endptr, 10);
- if (*endptr != '\0' || v < 1 || v > 65535) {
- fprintf(stderr, "Value %s is not a valid port, port must be between 1 and 65535 !\n", value);
- return 0;
- }
- return (unsigned short) v;
-}
-
-static int command_line_parsing(int argc, const char** argv, unsigned short * tcp_port,
- char *config_file, int *config_flag, unsigned short * mtu_size,
- int * debug, u32 * socketType_for_updates)
-{
- int counter = 1;
- if (argc < 2 || argc%2 != 1) {
- fprintf(stderr, "Incorrect number of arguments, must be multiple of 2 (Please specify at least -f or -p arguments) !\n");
- return -5;
- }
-
- for(counter = 1; counter < (argc - 1); counter+=2)
- {
- const char * a = argv[counter];
- if (!strcmp("-p", a) || !strcmp("--port", a))
- {
- if (*config_flag)
- {
- printIncompatibleOptions();
- return -2;
- }
- (*tcp_port) = port_from_string( argv[counter + 1] );
- if (!(*tcp_port)) return -3;
- }
- else if (!strcmp("-f", a) || !strcmp("--file", a))
- {
- if (*tcp_port) {
- printIncompatibleOptions();
- return -2;
- }
- strcpy(config_file, argv[counter+1]);
- (*config_flag) = 1;
- }
- else if (!strcmp("-m", a) || !strcmp("--mtu", a))
- {
- if (mtu_size) {
- *mtu_size = atoi(argv[counter+1]);
- if (! (*mtu_size)) return -3;
- }
- }
- else if (!strcmp("-d", a) || !strcmp("--debug", a))
- {
- *debug = atoi(argv[counter+1]);
- }
- else if (!strcmp("-s", a) || !strcmp("--socket-type-for-updates", a))
- {
- *socketType_for_updates = 0 == stricmp("TCP", argv[counter+1]);
- }
- else
- {
- fprintf(stderr, "Unknown parameter %s.", a);
- return -2;
- }
- }
-
- if (!(*config_flag) && !(*tcp_port)) {
- fprintf(stderr, "No config file or port specified !\n");
- return -6;
- }
-
- return 0;
-}
-
-void print_usage(void)
-{
- fprintf(stdout, "BIFS Scene encoder and streamer (c) Telecom ParisTech 2009\n");
- fprintf(stdout, "USAGE: broadcaster [-p tcp_port] [-s TCP|UDP] [-f config_file_name] [-m mtu_size] -d [debug]\n");
- fprintf(stdout, "\tIndicate the location of the configuration file either with a TCP port number or a file name\n");
- fprintf(stdout, "\tmtu_size : the MTU size (default = 1492)\n");
- fprintf(stdout, "\t-s or --socket-type-for-updates : connection type for updates (UDP by default)\n");
- fprintf(stdout, "\tdebug: OR debug mask (broadcaster = 1, scene_generator=2, sdp_generator=4, ALL=31)\n");
-}
-
-u32 RAP_send(void *par)
-{
- RAP_Input *input = par;
- PNC_CallbackData *data = input->data;
-
- input->status = 1;
- while (input->status==1) {
- u32 *timer;
- gf_mx_p(input->carrousel_mutex);
-
- timer = input->RAPtimer;
- data->RAPsent++;
- dprintf(DEBUG_broadcaster, "Sending RAP, will sleep for %d seconds\n", *timer);
- data->RAP = 1;
- gf_seng_aggregate_context(data->codec, 0);
- gf_seng_encode_context(data->codec, SampleCallBack);
-
- gf_mx_v(input->carrousel_mutex);
- gf_sleep((*timer)*1000);
- }
- input->status = 2;
- return GF_OK;
-}
-
-GF_Err parse_config(GF_Config *gf_config_file, CONF_Data *conf, int debug)
-{
- conf->scene_init_file = gf_cfg_get_key(gf_config_file, MAIN_SECTION, SCENE_INIT);
- if (!conf->scene_init_file) {
- fprintf(stderr, "Cannot find initial scene from configuration file\n");
- return GF_IO_ERR;
- } else {
- dprintf(DEBUG_broadcaster, "Using initial scene: %s\n", conf->scene_init_file);
- }
-
- conf->rap_timer = gf_cfg_get_key(gf_config_file, MAIN_SECTION, RAP_TIMER);
- if (!conf->rap_timer) conf->rap_timer = "2";
- dprintf(DEBUG_broadcaster, "Using a RAP period of %s seconds\n", conf->rap_timer);
-
- conf->config_input_port = gf_cfg_get_key(gf_config_file, MAIN_SECTION, PORT_CONFIG);
- if (!conf->config_input_port) conf->config_input_port = "5000";
- dprintf(DEBUG_broadcaster, "Using Configuration Port: %s\n", conf->config_input_port);
-
- conf->modif_input_port = gf_cfg_get_key(gf_config_file, MAIN_SECTION, PORT_MODIF);
- if (!conf->modif_input_port)
- conf->modif_input_port = "8000";
- dprintf(DEBUG_broadcaster, "Using Update Port: %s\n", conf->modif_input_port);
-
- conf->dest_ip = gf_cfg_get_key(gf_config_file, DEST_SECTION, DEST_ADDRESS);
- if (!conf->dest_ip)
- conf->dest_ip = "127.0.0.1";
- conf->dest_port = gf_cfg_get_key(gf_config_file, DEST_SECTION, PORT_OUTPUT);
- if (!conf->dest_port)
- conf->dest_port = "7000";
- dprintf(DEBUG_broadcaster, "Destination: %s:%s\n", conf->dest_ip, conf->dest_port);
-
- conf->feedback_ip = gf_cfg_get_key(gf_config_file, FEEDBACK_SECTION, IP_FEEDBACK);
- if (!conf->feedback_ip) conf->feedback_ip = "127.0.0.1";
- conf->feedback_port = gf_cfg_get_key(gf_config_file, FEEDBACK_SECTION, PORT_FEEDBACK);
- if (!conf->feedback_port) conf->feedback_port = "5757";
- dprintf(DEBUG_broadcaster, "Feedback host: %s:%s\n", conf->feedback_ip, conf->feedback_port);
- return GF_OK;
-}
-
-u32 tcp_server(void *par)
-{
- TCP_Input *input = par;
- u32 *timer = input->RAPtimer;
- char buffer[MAX_BUF];
- unsigned char temp[MAX_BUF];
- FILE *fp;
- u32 byte_read;
- GF_Config *gf_config_file;
- GF_Socket *TCP_socket;
- GF_Socket *conn_socket;
- GF_Err e;
-
- int debug = input->debug;
- input->status = 1;
-
- TCP_socket = gf_sk_new(GF_SOCK_TYPE_TCP);
- e = gf_sk_bind(TCP_socket, NULL, input->port, NULL, 0, 0);
- e = gf_sk_listen(TCP_socket, 1);
- e = gf_sk_set_block_mode(TCP_socket, 1);
- e = gf_sk_server_mode(TCP_socket, 0);
-
- while(input->status == 1)
- {
- int ret;
- memset(buffer, 0, sizeof(buffer));
- e = gf_sk_accept(TCP_socket, &conn_socket);
- if (e == GF_OK) {
- memset(buffer, 0, sizeof(buffer));
- e = gf_sk_receive(conn_socket, buffer, MAX_BUF, 0, &byte_read);
- }
-
- switch (e) {
- case GF_IP_NETWORK_EMPTY:
- gf_sleep(33);
- continue;
- case GF_OK:
- break;
- default:
- fprintf(stderr, "Error with TCP socket : %s\n", gf_error_to_string(e));
- exit(1);
- break;
- }
-
- if((*(input->config_flag)) == 0)
- {
- u32 num_retry;
- fp = gf_fopen("temp.cfg", "w+");
- if (!fp) {
- fprintf(stderr, "Error opening temp file for the configuration\n");
- exit(1);
- }
- ret = gf_fwrite(buffer, 1, byte_read, fp);
- gf_fclose(fp);
-
- /* parsing config info */
- gf_config_file = gf_cfg_new(".", "temp.cfg");
- if (!gf_config_file) {
- fprintf(stderr, "Error opening the config file %s\n", gf_error_to_string(e));
- exit(-1);
- }
- parse_config(gf_config_file, input->config, debug);
-
- /* Acknowledging the configuration */
- gf_sk_send(conn_socket, "OK\n", 3);
-
- memset(temp, 0, sizeof(temp));
- fp = gf_fopen(input->config->scene_init_file, "w+");
- if (!fp) {
- fprintf(stderr, "Error opening temp file for reception of the initial scene\n");
- exit(1);
- }
- num_retry=10;
-
- while (1)
- {
- e = gf_sk_receive(conn_socket, temp, sizeof(temp), 0, &byte_read);
-
- if (e == GF_OK) {
- gf_fwrite(temp, 1, byte_read, fp);
- } else if (e==GF_IP_NETWORK_EMPTY) {
- num_retry--;
- if (!num_retry)
- break;
- gf_sleep(1);
- } else {
- fprintf(stderr, "Error receiving initial scene: %s\n", gf_error_to_string(e));
- break;
- }
- }
- gf_fclose(fp);
- *(input->config_flag) = 1;
- }
- /* we only wait now for the config updates */
- if ( (*(input->config_flag)) == 1) {
- ret = sscanf(buffer, "DelaiMax=%d\n", timer);
- fprintf(stdout, "RAP timer changed, now : %d\n", *timer);
- }
- gf_sk_del(conn_socket);
- }
-
- input->status = 2;
- return GF_OK;
-}
-
-u8 get_a_char();
-Bool has_input();
-
-int main (const int argc, const char** argv)
-{
- GF_Err e;
- Bool run;
-
- /* location of the configuration file: 0 wait for config on a socket, 1 use the given file */
- u32 config_flag;
- char config_file_name[MAX_BUF];
-
- int dest_port;
- unsigned short tcp_port = 0;
- /* Should be fine on WIFI network */
- unsigned short mtu_size = 1492;
- int debug = 0;
- TCP_Input *tcp_conf = NULL;
- GF_Thread *tcp_thread;
- GF_Err th_err_tcp;
-
- GF_Err th_err_rap;
- RAP_Input *rap_conf;
- GF_Thread *rap_thread;
-
- CONF_Data *conf;
- GF_Config *gf_config_file;
- GF_Err res;
-
- GF_Socket *UDP_feedback_socket;
- u32 socketType_for_updates;
-
- PNC_CallbackData * data;
- GF_RTPChannel * chan;
- GF_RTPHeader hdr;
- u32 timer = -1;
-
- GF_Mutex *carrousel_mutex;
- char sdp_fmt[5000];
- tcp_thread = NULL;
-
- /* init gpac lib */
- gf_sys_init(GF_MemTrackerNone);
-
- GF_SAFEALLOC(conf, CONF_Data);
-
- tcp_port = config_flag = 0;
- socketType_for_updates = GF_SOCK_TYPE_UDP;
- if (command_line_parsing(argc, argv, &tcp_port, config_file_name, (int *) &config_flag, &mtu_size, &debug, &socketType_for_updates)) {
- print_usage();
- return -1;
- }
- setDebugMode( debug );
- gf_config_file = NULL;
- if (config_flag == 1)
- {
- char *cfg_path;
- char *cfg_fname;
- char *tmp;
-
- cfg_fname = config_file_name;
- cfg_path = config_file_name;
- tmp = strrchr(cfg_fname, GF_PATH_SEPARATOR);
- if (tmp) {
- cfg_fname = tmp+1;
- tmp[0] = 0;
- } else {
- cfg_path = ".";
- }
- gf_config_file = gf_cfg_new(cfg_path, cfg_fname);
- if (!gf_config_file) {
- fprintf(stderr, "Cannot open config file %s\n", config_file_name);
- return -1;
- } else {
- dprintf(DEBUG_broadcaster, "Using config file %s.\n", config_file_name);
- }
- if (parse_config(gf_config_file, conf, debug)) return -1;
- tcp_port = atoi(conf->config_input_port);
- }
- else
- {
- GF_SAFEALLOC(tcp_conf, TCP_Input);
- tcp_conf->config_flag = &config_flag;
- tcp_conf->RAPtimer = &timer;
- tcp_conf->port = tcp_port;
- tcp_conf->config = conf;
- tcp_thread = gf_th_new("TCPInterface");
-
- /* Starting the thread which will write the received config in a temporary file */
- th_err_tcp = gf_th_run(tcp_thread, tcp_server, tcp_conf);
-
- fprintf(stdout, "Waiting for configuration on port %d...\n", tcp_conf->port);
-
- while(config_flag == 0) {
- gf_sleep(1000);
- }
- fprintf(stdout, "Configuration File received. Starting Streaming ...\n");
- }
-
- timer = atoi(conf->rap_timer);
- dest_port = atoi(conf->dest_port);
- res = PNC_InitRTP(&chan, (char *)conf->dest_ip, dest_port, mtu_size);
- if (res != 0) {
- fprintf(stderr, "Cannot initialize RTP output (error: %d)\n", res);
- exit(1);
- }
-
- carrousel_mutex = gf_mx_new("Carrousel");
- data = PNC_Init_SceneGenerator(chan, &hdr, (char *) conf->scene_init_file,
- socketType_for_updates, (u16) atoi(conf->modif_input_port), debug);
- if (!data) {
- fprintf(stderr, "Cannot initialize Scene Generator\n");
- exit(1);
- }
- data->carrousel_mutex = carrousel_mutex;
- data->RAPsent = 1;
-
- UDP_feedback_socket = gf_sk_new(GF_SOCK_TYPE_UDP);
- e = gf_sk_bind(UDP_feedback_socket, NULL, (u16)atoi(conf->feedback_port), (char*)conf->feedback_ip, (u16)atoi(conf->feedback_port), 0);
- if (e) {
- fprintf(stderr, "Cannot bind socket for bitrate feedback information (%s)\n", gf_error_to_string(e));
- } else {
- e = gf_sk_set_block_mode(UDP_feedback_socket, 1);
- if (e) {
- fprintf(stderr, "Cannot set feedback socket block mode (%s)\n", gf_error_to_string(e));
- }
- }
- data->feedback_socket = UDP_feedback_socket;
-
- PNC_InitPacketiser(data, sdp_fmt, mtu_size);
- PNC_SendInitScene(data);
-
- GF_SAFEALLOC(rap_conf, RAP_Input);
- rap_conf->RAPtimer = &timer;
- rap_conf->carrousel_mutex = carrousel_mutex;
- rap_conf->data = data;
- rap_thread = gf_th_new("RAPGenerator");
- th_err_rap = gf_th_run(rap_thread, RAP_send, rap_conf);
-
- sdp_generator(data, (char *)conf->dest_ip, sdp_fmt);
-
- run = 1;
- while (run)
- {
- e = PNC_processBIFSGenerator(data);
- if (e) {
- fprintf(stderr, "Cannot Process BIFS data (%s)\n", gf_error_to_string(e));
- break;
- }
-
- if (has_input()) {
- char c = get_a_char();
- switch (c) {
- case 'q':
- run = 0;
- break;
- }
- }
- gf_sleep(10);
- }
-
- /* waiting for termination of the RAP thread */
- rap_conf->status = 0;
- while (rap_conf->status != 2)
- gf_sleep(0);
- gf_free(rap_conf);
- gf_th_del(rap_thread);
-
- /* waiting for termination of the TCP listening thread */
- if (tcp_conf) {
- tcp_conf->status = 0;
- while (tcp_conf->status != 2)
- gf_sleep(0);
- gf_free(tcp_conf);
- gf_th_del(tcp_thread);
- }
-
- PNC_Close_SceneGenerator(data);
-
- gf_free(conf);
-
- if (gf_config_file)
- gf_cfg_del(gf_config_file);
-
- gf_mx_del(carrousel_mutex);
- gf_sys_close();
- return 0;
-}
-
-#ifdef WIN32
-#include <conio.h>
-#include <windows.h>
-Bool has_input()
-{
- return kbhit();
-}
-u8 get_a_char()
-{
- return getchar();
-}
-void set_echo_off(Bool echo_off)
-{
- DWORD flags;
- HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
- GetConsoleMode(hStdin, &flags);
- if (echo_off) flags &= ~ENABLE_ECHO_INPUT;
- else flags |= ENABLE_ECHO_INPUT;
- SetConsoleMode(hStdin, flags);
-}
-#else
-/*linux kbhit/getchar- borrowed on debian mailing lists, (author Mike Brownlow)*/
-#include <termios.h>
-
-static struct termios t_orig, t_new;
-static s32 ch_peek = -1;
-
-void init_keyboard()
-{
- tcgetattr(0, &t_orig);
- t_new = t_orig;
- t_new.c_lflag &= ~ICANON;
- t_new.c_lflag &= ~ECHO;
- t_new.c_lflag &= ~ISIG;
- t_new.c_cc[VMIN] = 1;
- t_new.c_cc[VTIME] = 0;
- tcsetattr(0, TCSANOW, &t_new);
-}
-void close_keyboard(Bool new_line)
-{
- tcsetattr(0,TCSANOW, &t_orig);
- if (new_line) fprintf(stdout, "\n");
-}
-
-void set_echo_off(Bool echo_off)
-{
- init_keyboard();
- if (echo_off) t_orig.c_lflag &= ~ECHO;
- else t_orig.c_lflag |= ECHO;
- close_keyboard(0);
-}
-
-Bool has_input()
-{
- u8 ch;
- s32 nread;
-
- init_keyboard();
- if (ch_peek != -1) return 1;
- t_new.c_cc[VMIN]=0;
- tcsetattr(0, TCSANOW, &t_new);
- nread = read(0, &ch, 1);
- t_new.c_cc[VMIN]=1;
- tcsetattr(0, TCSANOW, &t_new);
- if(nread == 1) {
- ch_peek = ch;
- return 1;
- }
- close_keyboard(0);
- return 0;
-}
-
-u8 get_a_char()
-{
- u8 ch;
- if (ch_peek != -1) {
- ch = ch_peek;
- ch_peek = -1;
- close_keyboard(1);
- return ch;
- }
- int v = read(0,&ch,1);
- close_keyboard(1);
- if (v == 0)
- return 0;
- return ch;
-}
-
-#endif
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="broadcaster" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
-\r
-CFG=broadcaster - Win32 Debug\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "broadcaster.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "broadcaster.mak" CFG="broadcaster - Win32 Debug"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "broadcaster - Win32 Release" (based on "Win32 (x86) Console Application")\r
-!MESSAGE "broadcaster - Win32 Debug" (based on "Win32 (x86) Console Application")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-RSC=rc.exe\r
-\r
-!IF "$(CFG)" == "broadcaster - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Release"\r
-# PROP BASE Intermediate_Dir "Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD BASE RSC /l 0x40c /d "NDEBUG"\r
-# ADD RSC /l 0x40c /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-\r
-!ELSEIF "$(CFG)" == "broadcaster - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "Debug"\r
-# PROP BASE Intermediate_Dir "Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c\r
-# ADD BASE RSC /l 0x40c /d "_DEBUG"\r
-# ADD RSC /l 0x40c /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 zlib.lib winmm.lib ws2_32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/broadcaster.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "broadcaster - Win32 Release"\r
-# Name "broadcaster - Win32 Debug"\r
-# Begin Group "Source Files"\r
-\r
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
-# Begin Source File\r
-\r
-SOURCE=.\broadcaster.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\debug.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\RTP_serv_generator.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\RTP_serv_packetizer.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\RTP_serv_sender.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\sdp_generator.c\r
-# End Source File\r
-# End Group\r
-# Begin Group "Header Files"\r
-\r
-# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
-# Begin Source File\r
-\r
-SOURCE=.\broadcaster.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\debug.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\RTP_serv_generator.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\RTP_serv_packetizer.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\RTP_serv_sender.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\sdp_generator.h\r
-# End Source File\r
-# End Group\r
-# Begin Group "Resource Files"\r
-\r
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
-# End Group\r
-# End Target\r
-# End Project\r
+++ /dev/null
-/* includes default */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* includes for gpac library */
-#include <gpac/scene_engine.h>
-#include <gpac/config_file.h>
-#include <gpac/thread.h>
-#include <gpac/network.h>
-#include <gpac/ietf.h>
-#include <gpac/mpeg4_odf.h>
-#include <gpac/base_coding.h>
-#include <gpac/constants.h>
-#include <gpac/scene_manager.h>
-#include <gpac/bifs.h>
-
-/* includes for BIFS carousel */
-/* RTP sends */
-#include "RTP_serv_sender.h"
-/* packetization */
-#include "RTP_serv_packetizer.h"
-/* applicative module */
-#include "RTP_serv_generator.h"
-
-/* for SDP generation */
-#include "sdp_generator.h"
-
-/* definitions */
-#define MAX_BUF 4096
-
-/* configuration data*/
-#define MAIN_SECTION "Broadcaster"
-#define SCENE_INIT "InitialScene"
-#define RAP_TIMER "RAPPeriod"
-#define PORT_CONFIG "ConfigPort"
-#define PORT_MODIF "SceneUpdatePort"
-
-#define DEST_SECTION "Destination"
-#define DEST_ADDRESS "IP"
-#define PORT_OUTPUT "Port"
-
-#define FEEDBACK_SECTION "Feedback"
-#define IP_FEEDBACK "IP"
-#define PORT_FEEDBACK "Port"
-
-/* data struct on the server side */
-typedef struct config_data
-{
- const char *rap_timer;
- const char *scene_init_file;
- const char *modif_input_port;
- const char *config_input_port;
-
- const char *feedback_ip;
- const char *feedback_port;
-
- const char *dest_ip;
- const char *dest_port;
-} CONF_Data;
-
-typedef struct tcp_input
-{
- u16 port; // server port
- u32 *config_flag; // indicates whether the tcp server waits for configuration data
- // GF_Socket *socket; // socket tcp for the GUI interface
- u32 *RAPtimer;
- CONF_Data *config;
- u32 status;
- int debug;
-} TCP_Input;
-
-typedef struct rap_input
-{
- GF_Mutex *carrousel_mutex;
- u32 *RAPtimer;
- PNC_CallbackData *data;
- u32 status;
-} RAP_Input;
-
-/*void command_line_parsing(int* argc, const char** argv, int *tcp_port, const char *config_file, int *config_flag);
-int server_command_line(char *arg_a, char *arg_b, char *value, int argument);*/
-u32 tcp_server(void *par);
-u32 RAP_send(void *par);
-void print_usage(void);
+++ /dev/null
-[Broadcaster]
-InitialScene=/var/www/initial.bt
-RAPPeriod=2
-ConfigPort=5500
-SceneUpdatePort=8100
-
-[Destination]
-#IP=233.64.133.10
-#IP=137.194.232.99
-IP=127.0.0.1
-Port=7100
-
-[Feedback]
-#IP=137.194.232.99
-IP=127.0.0.1
-Port=5758
+++ /dev/null
-#include "debug.h"
-#include <stdio.h>
-#include <stdarg.h>
-
-static int _broadcaster_debug = 0;
-
-void setDebugMode(int mode)
-{
- _broadcaster_debug = mode;
-}
-
-int getDebugMode()
-{
- return _broadcaster_debug;
-}
-
-void dprintf(debugMode debug, const char *msg, ...)
-{
- va_list ap;
- va_start( ap, msg );
- if ((debug & _broadcaster_debug) == debug)
- vfprintf(stderr, msg, ap);
- va_end(ap);
-}
+++ /dev/null
-#ifndef _BROADCASTER_DEBUG_H
-#define _BROADCASTER_DEBUG_H
-
-typedef enum _debugMode {
- DEBUG_broadcaster = 1,
- DEBUG_RTP_serv_generator = 2,
- DEBUG_RTP_serv_packetizer =4,
- DEBUG_RTP_serv_sender = 8,
- DEBUG_sdp_generator = 16
-} debugMode;
-
-void setDebugMode(int mode);
-
-int getDebugMode();
-
-void dprintf(debugMode debug, const char *msg, ...);
-
-#endif
+++ /dev/null
-<XMT-A xmlns="http://www.enst.fr/MPEG-4/XMT-A"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.enst.fr/MPEG-4/XMT-A xmt-a.xsd">
- <Header>
- <InitialObjectDescriptor>
- <Descr>
- <esDescr>
- <ES_Descriptor ES_ID="FluxBIFS" binaryID="1">
- <decConfigDescr>
- <DecoderConfigDescriptor objectTypeIndication="MPEG4Systems1" streamType="SceneDescription">
- <decSpecificInfo>
- <BIFSConfig>
- <commandStream pixelMetric="true">
- <size pixelWidth="540" pixelHeight="540"/>
- </commandStream>
- </BIFSConfig>
- </decSpecificInfo>
- </DecoderConfigDescriptor>
- </decConfigDescr>
- <slConfigDescr><SLConfigDescriptor><predefined value="2"/></SLConfigDescriptor></slConfigDescr>
- </ES_Descriptor>
- </esDescr>
- </Descr>
- </InitialObjectDescriptor>
- </Header>
- <Body>
- <Replace>
- <Scene>
- <OrderedGroup>
- <children>
- <Inline url="france.mp4"/>
- <!--
- <Shape>
- <geometry><Bitmap/></geometry>
- <appearance>
- <Appearance>
- <texture><ImageTexture url="'od://ImageJPEG'"/></texture>
- <material><Material2D filled="true"/></material>
- </Appearance>
- </appearance>
- </Shape>
- -->
- </children>
- <!--Start de Paris-->
- <children>
- <OrderedGroup>
- <!--Image de Paris -->
- <children>
- <Transform2D translation="-30 65">
- <children>
- <Shape>
- <geometry><Bitmap/></geometry>
- <appearance>
- <Appearance>
- <texture><ImageTexture DEF="FRXX0076image" url="http://localhost/meteo/sdk/32x32/na.png"/></texture>
- <material><Material2D filled="true"/></material>
- </Appearance>
- </appearance>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Temperature de la ville Paris-->
- <children>
- <Transform2D translation="-35 40">
- <children>
- <Shape>
- <geometry>
- <Text DEF="FRXX0076temp" string="N/A"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Nom de la ville Paris-->
- <children>
- <Transform2D translation="-40 80">
- <children>
- <Shape>
- <geometry>
- <Text string="Paris"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- </OrderedGroup>
- </children>
- <!--Fin de Paris-->
- <!--Start de Marseille-->
- <children>
- <OrderedGroup>
- <!--Image de Marseille -->
- <children>
- <Transform2D translation="30 -160">
- <children>
- <Shape>
- <geometry><Bitmap/></geometry>
- <appearance>
- <Appearance>
- <texture><ImageTexture DEF="FRXX0059image" url="http://localhost/meteo/sdk/32x32/na.png"/></texture>
- <material><Material2D filled="true"/></material>
- </Appearance>
- </appearance>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Temperature de la ville Marseille-->
- <children>
- <Transform2D translation="30 -185">
- <children>
- <Shape>
- <geometry>
- <Text DEF="FRXX0059temp" string="N/A"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Nom de la ville Marseille-->
- <children>
- <Transform2D translation="15 -145">
- <children>
- <Shape>
- <geometry>
- <Text string="Marseille"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- </OrderedGroup>
- </children>
- <!--Fin de Marseille-->
-
- <!--Start de Brest-->
- <children>
- <OrderedGroup>
- <!--Image de Brest -->
- <children>
- <Transform2D translation="-180 60">
- <children>
- <Shape>
- <geometry><Bitmap/></geometry>
- <appearance>
- <Appearance>
- <!-- exemple de lien HTTP pour les images -->
- <texture>
- <!-- <ImageTexture DEF="BrestImage" url="'http://lien_vers_image'"/> -->
- <ImageTexture DEF="FRXX0019image" url="http://localhost/meteo/sdk/32x32/na.png"/></texture>
- <material><Material2D filled="true"/></material>
- </Appearance>
- </appearance>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Temperature de la ville Brest-->
- <children>
- <Transform2D translation="-185 35">
- <children>
- <Shape>
- <geometry>
- <Text DEF="FRXX0019temp" string="N/A"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Nom de la ville Brest-->
- <children>
- <Transform2D translation="-190 75">
- <children>
- <Shape>
- <geometry>
- <Text string="Brest"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- </OrderedGroup>
- </children>
- <!--Fin de Brest-->
-
- <!--Start de Lyon-->
- <children>
- <OrderedGroup>
- <!--Image de Lyon -->
- <children>
- <Transform2D translation="30 -75">
- <children>
- <Shape>
- <geometry><Bitmap/></geometry>
- <appearance>
- <Appearance>
- <texture><ImageTexture DEF="FRXX0055image" url="http://localhost/meteo/sdk/32x32/na.png"/></texture>
- <material><Material2D filled="true"/></material>
- </Appearance>
- </appearance>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Temperature de la ville Lyon-->
- <children>
- <Transform2D translation="25 -100">
- <children>
- <Shape>
- <geometry>
- <Text DEF="FRXX0055temp" string="N/A"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Nom de la ville Lyon-->
- <children>
- <Transform2D translation="20 -60">
- <children>
- <Shape>
- <geometry>
- <Text string="Lyon"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- </OrderedGroup>
- </children>
- <!--Fin de Lyon-->
-
- <!--Start de Bordeaux-->
- <children>
- <OrderedGroup>
- <!--Image de Bordeaux -->
- <children>
- <Transform2D translation="-95 -95">
- <children>
- <Shape>
- <geometry><Bitmap/></geometry>
- <appearance>
- <Appearance>
- <texture><ImageTexture DEF="FRXX0016image" url="http://localhost/meteo/sdk/32x32/na.png"/></texture>
- <material><Material2D filled="true"/></material>
- </Appearance>
- </appearance>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Temperature de la ville Bordeaux-->
- <children>
- <Transform2D translation="-100 -120">
- <children>
- <Shape>
- <geometry>
- <Text DEF="FRXX0016temp" string="N/A"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- <!-- Nom de la ville Bordeaux-->
- <children>
- <Transform2D translation="-110 -80">
- <children>
- <Shape>
- <geometry>
- <Text string="Bordeaux"/>
- </geometry>
- </Shape>
- </children>
- </Transform2D>
- </children>
- </OrderedGroup>
- </children>
- <!--Fin de Bordeaux-->
- <!--Start d'entete-->
- <children>
- <OrderedGroup>
- <!-- Texte d'entete-->
- <children>
- <Transform2D translation="-200 180">
- <children>
- <Shape>
- <geometry>
- <Text DEF="entete" string="Data Not Available"/>
- </geometry>
- <appearance>
-
- <Appearance>
- <material>
- <Material2D emissiveColor="0 0 0" filled="true">
-
- </Material2D>
- </material>
- </Appearance>
- </appearance>
-
- </Shape>
- </children>
- </Transform2D>
- </children>
- </OrderedGroup>
- </children>
- <!--Fin d'en tete-->
-
-
-
- </OrderedGroup>
- </Scene>
- </Replace>
- <!-- <ObjectDescriptorUpdate> -->
- <!-- Definition des Images -->
- <!-- <OD> -->
- <!-- Carte de France -->
- <!--
- <ObjectDescriptor objectDescriptorID="ImageJPEG">
- <Descr>
- <esDescr>
- <ES_Descriptor ES_ID="Carte">
- <decConfigDescr>
- <DecoderConfigDescriptor objectTypeIndication="JPEG" streamType="Visual"/>
- </decConfigDescr>
- <StreamSource url="http://localhost/france.jpg"/>
- </ES_Descriptor>
- </esDescr>
- </Descr>
- </ObjectDescriptor>
- -->
- <!-- Image Soleil
- <ObjectDescriptor objectDescriptorID="ImagePNG1">
- <Descr>
- <esDescr>
- <ES_Descriptor ES_ID="Soleil">
- <decConfigDescr>
- <DecoderConfigDescriptor objectTypeIndication="PNG" streamType="Visual"/>
- </decConfigDescr>
- <StreamSource url="http://localhost/meteo/sdk/32x32/32.png"/>
- </ES_Descriptor>
- </esDescr>
- </Descr>
- </ObjectDescriptor> -->
- <!-- Image Pluie
- <ObjectDescriptor objectDescriptorID="ImagePNG2">
- <Descr>
- <esDescr>
- <ES_Descriptor ES_ID="Pluie">
- <decConfigDescr>
- <DecoderConfigDescriptor objectTypeIndication="PNG" streamType="Visual"/>
- </decConfigDescr>
- <slConfigDescr>
- <SLConfigDescriptor><predefined value="2"/></SLConfigDescriptor>
- </slConfigDescr>
- <StreamSource url="http://localhost/meteo/sdk/32x32/6.png"/>
- </ES_Descriptor>
- </esDescr>
- </Descr>
- </ObjectDescriptor> -->
- <!-- Image Soleil Nuage
- <ObjectDescriptor objectDescriptorID="ImagePNG3">
- <Descr>
- <esDescr>
- <ES_Descriptor ES_ID="SoleilNuage">
- <decConfigDescr>
- <DecoderConfigDescriptor objectTypeIndication="PNG" streamType="Visual"/>
- </decConfigDescr>
- <StreamSource url="http://localhost/meteo/sdk/32x32/26.png"/>
- </ES_Descriptor>
- </esDescr>
- </Descr>
- </ObjectDescriptor> -->
- <!-- Image Neige
- <ObjectDescriptor objectDescriptorID="ImagePNG4">
- <Descr>
- <esDescr>
- <ES_Descriptor ES_ID="Neige">
- <decConfigDescr>
- <DecoderConfigDescriptor objectTypeIndication="PNG" streamType="Visual"/>
- </decConfigDescr>
- <StreamSource url=""/>
- </ES_Descriptor>
- </esDescr>
- </Descr>
- </ObjectDescriptor> -->
- <!-- </OD> -->
- <!-- Fin des Images -->
- <!-- </ObjectDescriptorUpdate> -->
- </Body>
-</XMT-A>
-
+++ /dev/null
-#include "sdp_generator.h"
-#include "debug.h"
-
-int sdp_generator(PNC_CallbackData *data, char *ip_dest, char *sdp_fmt)
-{
- GF_SceneEngine *codec;
- GF_ESD *esd = NULL;
- u32 size,size64;
- char *buffer;
- FILE *fp;
- int ret;
- char temp[5000];
- u16 port;
- u32 socket_type;
-
- gf_sk_get_local_info(data->chan->rtp, &port, &socket_type);
-
- fp = gf_fopen("broadcaster.sdp", "w+");
- if(fp == NULL) {
- fprintf(stderr, "Cannot open SDP file broadcaster.sdp\n");
- exit(1);
- }
-
- ret = gf_fwrite("v=0\n", 1, 4, fp);
- sprintf(temp, "o=GpacBroadcaster 3326096807 1117107880000 IN IP%d %s\n", gf_net_is_ipv6(ip_dest) ? 6 : 4, ip_dest);
- ret = gf_fwrite(temp, 1, strlen(temp), fp);
-
- ret = gf_fwrite("s=MPEG4Broadcaster\n", 1, 19, fp);
-
- sprintf(temp, "c=IN IP%d %s\n", gf_net_is_ipv6(ip_dest) ? 6 : 4, ip_dest);
- ret = gf_fwrite(temp, 1, strlen(temp), fp);
-
- ret = gf_fwrite("t=0 0\n", 1, 6, fp);
-
- codec = (GF_SceneEngine *) data->codec;
- if (codec) {
- char buf64[5000];
- buffer = NULL;
- size = 0;
- gf_odf_desc_write((GF_Descriptor *) codec->ctx->root_od, &buffer, &size);
- esd = gf_list_get(codec->ctx->root_od->ESDescriptors, 0);
-
- size64 = gf_base64_encode((unsigned char *) buffer, size, (unsigned char *) buf64, 2000);
- buf64[size64] = 0;
- free(buffer);
-
- sprintf(temp, "a=mpeg4-iod:\"data:application/mpeg4-iod;base64,%s\"\n", buf64);
- ret = gf_fwrite(temp, 1, strlen(temp), fp);
- }
-
- sprintf(temp, "m=application %d RTP/AVP 96\n", port);
- ret = gf_fwrite(temp, 1, strlen(temp), fp);
-
- ret = gf_fwrite("a=rtpmap:96 mpeg4-generic/1000\n", 1, 31, fp);
-
- if (esd) {
- sprintf(temp, "a=mpeg4-esid:%d\n", esd->ESID);
- ret = gf_fwrite(temp, 1, strlen(temp), fp);
- }
-
- sprintf(temp, "%s\n", sdp_fmt);
- ret = gf_fwrite(temp, 1, strlen(temp), fp);
- fflush(fp);
- gf_fclose(fp);
- dprintf(DEBUG_sdp_generator, "SDP file generated in broadcaster.sdp\n");
- return GF_OK;
-}
+++ /dev/null
-#include <gpac/base_coding.h>
-#include <gpac/constants.h>
-#include <gpac/scene_manager.h>
-#include <gpac/bifs.h>
-#include <gpac/scene_engine.h>
-#include <gpac/network.h>
-#include <gpac/internal/ietf_dev.h>
-#include "RTP_serv_generator.h"
-
-/* structure definitions */
-struct __tag_bifs_engine
-{
- GF_SceneGraph *sg;
- GF_SceneManager *ctx;
- GF_SceneLoader load;
- void *calling_object;
- GF_StreamContext *sc;
-
- GF_BifsEncoder *bifsenc;
- u32 stream_ts_res;
- /* TODO: maybe the currentAUCount should be a GF_List of u32
- to capture the number of AU per input BIFS stream */
- u32 currentAUCount;
-
- char encoded_bifs_config[20];
- u32 encoded_bifs_config_size;
-};
-
-int sdp_generator(PNC_CallbackData *data, char *ip_dest, char *sdp_fmt);
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="dmbrs" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
-\r
-CFG=dmbrs - Win32 Release\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "dmbrs.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "dmbrs.mak" CFG="dmbrs - Win32 Release"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "dmbrs - Win32 Release" (based on "Win32 (x86) Console Application")\r
-!MESSAGE "dmbrs - Win32 Debug" (based on "Win32 (x86) Console Application")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-RSC=rc.exe\r
-\r
-!IF "$(CFG)" == "dmbrs - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Release"\r
-# PROP BASE Intermediate_Dir "Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD BASE RSC /l 0x40c /d "NDEBUG"\r
-# ADD RSC /l 0x40c /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 zlib.lib winmm.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/dmbrs.exe" /libpath:"../../../extra_lib/lib/w32_rel"\r
-\r
-!ELSEIF "$(CFG)" == "dmbrs - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "Debug"\r
-# PROP BASE Intermediate_Dir "Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD BASE RSC /l 0x40c /d "_DEBUG"\r
-# ADD RSC /l 0x40c /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 zlib.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/dmbrs.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "dmbrs - Win32 Release"\r
-# Name "dmbrs - Win32 Debug"\r
-# Begin Source File\r
-\r
-SOURCE=.\main.c\r
-# End Source File\r
-# End Target\r
-# End Project\r
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / DMB application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-#include <gpac/mpegts.h>
-
-void save_ts(char *filename, unsigned char *data)
-{
- FILE *ts_out = gf_fopen(filename,"a+b");
- gf_fwrite(data, 1, 188, ts_out);
- gf_fclose(ts_out);
-}
-void save_rs_0(char *filename, unsigned char *data)
-{
- FILE *rs_out = gf_fopen(filename,"a+b");
- gf_fwrite(data, 1, 204, rs_out);
- gf_fclose(rs_out);
-}
-
-void RS_Interleaver(GF_BitStream *bs, char *out_name)
-{
- u8 *tmp;
- u8 ts0[204], ts1[204], ts2[204], ts3[204], ts4[204], ts5[204], ts6[204], ts7[204], ts8[204], ts9[204], ts10[204], ts11[204];
- u8 *ts[12] = { ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7, ts8, ts9, ts10, ts11 };
- u8 rs[204];
- u32 i;
- u64 bs_data;
- u32 k;
-
- memset(ts[0], 0xFF, 204);
- ts[0][0] = 0x47;
- memset(ts[1], 0xFF, 204);
- ts[1][0] = 0x47;
- memset(ts[2], 0xFF, 204);
- ts[2][0] = 0x47;
- memset(ts[3], 0xFF, 204);
- ts[3][0] = 0x47;
- memset(ts[4], 0xFF, 204);
- ts[4][0] = 0x47;
- memset(ts[5], 0xFF, 204);
- ts[5][0] = 0x47;
- memset(ts[6], 0xFF, 204);
- ts[6][0] = 0x47;
- memset(ts[7], 0xFF, 204);
- ts[7][0] = 0x47;
- memset(ts[8], 0xFF, 204);
- ts[8][0] = 0x47;
- memset(ts[9], 0xFF, 204);
- ts[9][0] = 0x47;
- memset(ts[10], 0xFF, 204);
- ts[10][0] = 0x47;
-
- k = 11;
- bs_data = gf_bs_available(bs);
- while (bs_data > 188 || k > 0) {
-
- gf_bs_read_data(bs, ts[11], 188);
- if (bs_data == 0) {
- memset(ts[11], 0xFF, 204);
- ts[11][0] = 0x47;
- k--;
- }
- bs_data = gf_bs_available(bs);
-
- for (i=0; i<(17*12); i+=12) { // 1 paquet RS
-
- rs[i] = ts[11][i];
- if (rs[0] != 0x47) {
- printf ("error ts sync byte");
- }
- rs[i+1] = ts[10][i+1];
- rs[i+2] = ts[9][i+2];
- rs[i+3] = ts[8][i+3];
- rs[i+4] = ts[7][i+4];
- rs[i+5] = ts[6][i+5];
- rs[i+6] = ts[5][i+6];
- rs[i+7] = ts[4][i+7];
- rs[i+8] = ts[3][i+8];
- rs[i+9] = ts[2][i+9];
- rs[i+10] = ts[1][i+10];
- rs[i+11] = ts[0][i+11];
- }
-
- if (rs[0] != 0x47) {
- printf("error in output TS\n");
- } else {
- save_rs_0(out_name, rs);
- }
-
- tmp = ts[0];
- ts[0] = ts[1];
- ts[1] = ts[2];
- ts[2] = ts[3];
- ts[3] = ts[4];
- ts[4] = ts[5];
- ts[5] = ts[6];
- ts[6] = ts[7];
- ts[7] = ts[8];
- ts[8] = ts[9];
- ts[9] = ts[10];
- ts[10] = ts[11];
- ts[11] = tmp;
- }
-}
-
-void RS_Deinterleaver(GF_BitStream *bs, char *out_name)
-{
- u8 rs0[204], rs1[204], rs2[204], rs3[204], rs4[204], rs5[204], rs6[204], rs7[204], rs8[204], rs9[204], rs10[204], rs11[204];
- u8 *rs[12] = { rs0, rs1, rs2, rs3, rs4, rs5, rs6, rs7, rs8, rs9, rs10, rs11 };
- u8 *tmp;
- u8 buf[204];
- u32 i;
- u64 bs_data;
- u32 k = 0;
-
- memset(rs[0], 0, 204);
- memset(rs[1], 0, 204);
- memset(rs[2], 0, 204);
- memset(rs[3], 0, 204);
- memset(rs[4], 0, 204);
- memset(rs[5], 0, 204);
- memset(rs[6], 0, 204);
- memset(rs[7], 0, 204);
- memset(rs[8], 0, 204);
- memset(rs[9], 0, 204);
- memset(rs[10], 0, 204);
- memset(rs[11], 0, 204);
-
- bs_data = gf_bs_available(bs);
- while (bs_data > 204) {
- u64 pos;
- k++;
-// printf("TS Packet Number: %d\r", k);
-
- pos = gf_bs_get_position(bs);
- gf_bs_read_data(bs, buf, 204);
- bs_data = gf_bs_available(bs);
-
- while ((buf[0] != 0x47) && (bs_data > 0)) {
- printf("error in input TS %d\n", k);
- //return;
- pos++;
- gf_bs_seek(bs, pos);
- gf_bs_read_data(bs, buf, 204);
- bs_data = gf_bs_available(bs);
- }
-
- for (i=0; i<(17*12); i+=12) { // 1 paquet
- rs[0][i] = buf[i];
- rs[1][i+1] = buf[i+1];
- rs[2][i+2] = buf[i+2];
- rs[3][i+3] = buf[i+3];
- rs[4][i+4] = buf[i+4];
- rs[5][i+5] = buf[i+5];
- rs[6][i+6] = buf[i+6];
- rs[7][i+7] = buf[i+7];
- rs[8][i+8] = buf[i+8];
- rs[9][i+9] = buf[i+9];
- rs[10][i+10] = buf[i+10];
- rs[11][i+11] = buf[i+11];
- }
- if (k >= 12) {
- if (rs[11][0] != 0x47) {
- printf("error in output TS\n");
- } else {
- save_ts(out_name, rs[11]);
- }
- }
- tmp = rs[11];
- rs[11] = rs[10];
- rs[10] = rs[9];
- rs[9] = rs[8];
- rs[8] = rs[7];
- rs[7] = rs[6];
- rs[6] = rs[5];
- rs[5] = rs[4];
- rs[4] = rs[3];
- rs[3] = rs[2];
- rs[2] = rs[1];
- rs[1] = rs[0];
- rs[0] = tmp;
- }
-}
-
-void main(int argc, char **argv)
-{
- FILE *in;
- GF_BitStream *bs;
-
- /* generation d'un TS aléatoire */
- /*
- if ((in=gf_fopen(argv[1], "wb")) == NULL) {
- printf( "Impossible d'ouvrir %s en lecture.\n", argv[1]);
- }
- {
- char buffer[188];
- u32 j, i, nb_packets = 300;
- for (i = 0; i < nb_packets; i++) {
- buffer[0] = 0x47;
- for (j = 1; j <188; j++) {
- buffer[j] = rand();//j;
- }
- gf_fwrite(buffer, 1, 188, in);
- }
- }
- gf_fclose(in);
- if ((in=gf_fopen(argv[1], "rb")) == NULL) {
- printf( "Impossible d'ouvrir %s en lecture.\n", argv[1]);
- }
-
- bs = gf_bs_from_file(in, GF_BITSTREAM_READ);
- if (bs == NULL) return;
-
- RS_Interleaver(bs, argv[2]);
- gf_fclose(in);
- gf_bs_del(bs);
- */
-
-
- if ((in=gf_fopen(argv[1], "rb")) == NULL) {
- printf( "Impossible d'ouvrir %s en lecture.\n", argv[1]);
- }
-
- bs = gf_bs_from_file(in, GF_BITSTREAM_READ);
- if (bs == NULL) return;
-
- RS_Deinterleaver(bs, argv[2]);
- gf_fclose(in);
- gf_bs_del(bs);
-
-}
\ No newline at end of file
+++ /dev/null
-include ../../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/testapps/fmp4demux
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= main.o
-
-LINKFLAGS=-L../../../bin/gcc
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=fmp4demux$(EXE)
-else
-EXT=
-PROG=fmp4demux
-endif
-LINKFLAGS+=-lgpac
-
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-#!/bin/sh
-gcc -o fmp4demux main.c ../../../src/utils/os_config_init.c ../../../src/utils/os_divers.c ../../../src/utils/os_file.c ../../../src/utils/os_thread.c ../../../src/utils/alloc.c ../../../src/utils/bitstream.c ../../../src/utils/configfile.c ../../../src/odf/desc_private.c ../../../src/odf/descriptors.c ../../../src/utils/error.c ../../../src/utils/list.c ../../../src/odf/odf_code.c ../../../src/odf/odf_codec.c ../../../src/odf/odf_command.c ../../../src/odf/odf_parse.c ../../../src/odf/slc.c ../../../src/utils/url.c ../../../src/media_tools/webvtt.c ../../../src/isomedia/avc_ext.c ../../../src/isomedia/box_code_3gpp.c ../../../src/isomedia/box_code_adobe.c ../../../src/isomedia/box_code_apple.c ../../../src/isomedia/box_code_base.c ../../../src/isomedia/box_code_drm.c ../../../src/isomedia/box_code_meta.c ../../../src/isomedia/box_funcs.c ../../../src/isomedia/data_map.c ../../../src/isomedia/drm_sample.c ../../../src/isomedia/isom_intern.c ../../../src/isomedia/isom_read.c ../../../src/isomedia/isom_store.c ../../../src/isomedia/isom_write.c ../../../src/isomedia/media.c ../../../src/isomedia/media_odf.c ../../../src/isomedia/meta.c ../../../src/isomedia/movie_fragments.c ../../../src/isomedia/sample_descs.c ../../../src/isomedia/stbl_read.c ../../../src/isomedia/stbl_write.c ../../../src/isomedia/track.c ../../../src/isomedia/tx3g.c -L../../../bin/gcc -lpthread -ldl -I../../../include -DGPAC_MINIMAL_ODF -DGPAC_DISABLE_AV_PARSERS -DGPAC_DISABLE_ISOM_DUMP -DGPAC_DISABLE_ZLIB
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual Studio 2010\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmp4demux", "fmp4demux.vcxproj", "{BEBEB264-EEA8-4FCF-9467-2E7988DD923B}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Win32 = Debug|Win32\r
- Release|Win32 = Release|Win32\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {BEBEB264-EEA8-4FCF-9467-2E7988DD923B}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {BEBEB264-EEA8-4FCF-9467-2E7988DD923B}.Debug|Win32.Build.0 = Debug|Win32\r
- {BEBEB264-EEA8-4FCF-9467-2E7988DD923B}.Release|Win32.ActiveCfg = Release|Win32\r
- {BEBEB264-EEA8-4FCF-9467-2E7988DD923B}.Release|Win32.Build.0 = Release|Win32\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="main.c" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\..\build\msvc14\libgpac_dll.vcxproj">\r
- <Project>{d3540754-e0cf-4604-ac11-82de9bd4d814}</Project>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{BEBEB264-EEA8-4FCF-9467-2E7988DD923B}</ProjectGuid>\r
- <ProjectName>fmp4demux</ProjectName>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>11.0.60610.1</_ProjectFileVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir>obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental>true</LinkIncremental>\r
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules />\r
- <CodeAnalysisRuleAssemblies />\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir>obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental>false</LinkIncremental>\r
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules />\r
- <CodeAnalysisRuleAssemblies />\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Midl>\r
- <TypeLibraryName>.\Debug/fmp4demux.tlb</TypeLibraryName>\r
- <HeaderFileName />\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZLIB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>\r
- </PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>$(OutDir);../../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>.\Debug/fmp4demux.bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Midl>\r
- <TypeLibraryName>.\Release/fmp4demux.tlb</TypeLibraryName>\r
- <HeaderFileName />\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>MaxSpeed</Optimization>\r
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZLIB;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>.\Release/fmp4demux.pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
- <ObjectFileName>.\Release/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../../extra_lib/lib/w32_rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ProgramDatabaseFile>.\Release/fmp4demux.pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>.\Release/fmp4demux.bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <ClCompile Include="main.c" />
- </ItemGroup>
-</Project>
\ No newline at end of file
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Cyril Concolato
- * Copyright (c) Telecom ParisTech 2013-
- * All rights reserved
- *
- * This file is part of GPAC / sample MP4 demultiplexing application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-//#define GPAC_HAVE_CONFIG_H
-
-#include <gpac/tools.h>
-#include <gpac/isomedia.h>
-#include <gpac/thread.h>
-
-#define BUFFER_BLOCK_SIZE 1000
-#define MAX_BUFFER_SIZE 200000
-
-typedef enum {
- ERROR,
- RUNNING,
- EOS
-} state_t;
-
-typedef struct iso_progressive_reader {
-
- /* data buffer to be read by the parser */
- u8 *data;
- /* size of the data buffer */
- u32 data_size;
- /* number of valid bytes in the buffer */
- u32 valid_data_size;
- /* URL used to pass a buffer to the parser */
- char data_url[256];
-
- /* The ISO file structure created for the parsing of data */
- GF_ISOFile *movie;
-
- /* Mutex to protect the reading from concurrent adding of media data */
- GF_Mutex *mutex;
-
- /* state */
- volatile state_t state;
-
- /* id of the track in the ISO to be read */
- u32 track_id;
-
-} ISOProgressiveReader;
-
-
-static u32 iso_progressive_read_thread(void *param)
-{
- ISOProgressiveReader *reader = (ISOProgressiveReader *)param;
- u32 track_number;
- GF_ISOSample *iso_sample;
- u32 samples_processed;
- u32 sample_index;
- u32 sample_count;
-
- samples_processed = 0;
- sample_count = 0;
- track_number = 0;
- /* samples are numbered starting from 1 */
- sample_index = 1;
-
- while (reader->state != ERROR) {
-
- /* we can only parse if there is a movie */
- if (reader->movie) {
-
- /* block the data input until we are done in the parsing */
- gf_mx_p(reader->mutex);
-
- /* get the track number we want */
- if (track_number == 0) {
- track_number = gf_isom_get_track_by_id(reader->movie, reader->track_id);
- }
-
- /* only if we have the track number can we try to get the sample data */
- if (track_number != 0) {
- u32 new_sample_count;
- u32 di; /*descriptor index*/
-
- /* let's see how many samples we have since the last parsed */
- new_sample_count = gf_isom_get_sample_count(reader->movie, track_number);
- if (new_sample_count > sample_count) {
- /* New samples have been added to the file */
- fprintf(stdout, "Found %d new samples (total: %d)\n", new_sample_count - sample_count, new_sample_count);
- if (sample_count == 0) {
- sample_count = new_sample_count;
- }
- }
- if (sample_count == 0) {
- /*let the reader push new data */
- gf_mx_v(reader->mutex);
- //gf_sleep(1000);
- } else {
- /* let's analyze the samples we have parsed so far one by one */
- iso_sample = gf_isom_get_sample(reader->movie, track_number, sample_index, &di);
- if (iso_sample) {
- /* if you want the sample description data, you can call:
- GF_Descriptor *desc = gf_isom_get_decoder_config(reader->movie, reader->track_handle, di);
- */
-
- samples_processed++;
- /*here we dump some sample info: samp->data, samp->dataLength, samp->isRAP, samp->DTS, samp->CTS_Offset */
- fprintf(stdout, "Found sample #%5d (#%5d) of length %8d, RAP: %d, DTS: "LLD", CTS: "LLD"\n", sample_index, samples_processed, iso_sample->dataLength, iso_sample->IsRAP, iso_sample->DTS, iso_sample->DTS+iso_sample->CTS_Offset);
- sample_index++;
-
- /*release the sample data, once you're done with it*/
- gf_isom_sample_del(&iso_sample);
-
- /* once we have read all the samples, we can release some data and force a reparse of the input buffer */
- if (sample_index > sample_count) {
- u64 new_buffer_start;
- u64 missing_bytes;
-
- if (reader->state == EOS) {
- reader->state = ERROR;
- }
-
-
- fprintf(stdout, "\nReleasing unnecessary buffers\n");
- /* release internal structures associated with the samples read so far */
- gf_isom_reset_tables(reader->movie, GF_TRUE);
-
- /* release the associated input data as well */
- gf_isom_reset_data_offset(reader->movie, &new_buffer_start);
- if (new_buffer_start) {
- u32 offset = (u32)new_buffer_start;
- memmove(reader->data, reader->data+offset, reader->data_size-offset);
- reader->valid_data_size -= offset;
- }
- sprintf(reader->data_url, "gmem://%d@%p", reader->valid_data_size, reader->data);
- gf_isom_refresh_fragmented(reader->movie, &missing_bytes, reader->data_url);
-
- /* update the sample count and sample index */
- sample_count = new_sample_count - sample_count;
- assert(sample_count == 0);
- sample_index = 1;
- }
- } else {
- GF_Err e = gf_isom_last_error(reader->movie);
- fprintf(stdout, "Could not get sample %s\n", gf_error_to_string(e));
- }
- /* and finally, let the data reader push more data */
- gf_mx_v(reader->mutex);
- }
- }
- } else {
- //gf_sleep(1);
- }
- }
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- /* The ISO progressive reader */
- ISOProgressiveReader reader;
- /* Error indicator */
- GF_Err e;
- /* input file to be read in the data buffer */
- FILE *input;
- /* number of bytes read from the file at each read operation */
- u32 read_bytes;
- /* number of bytes read from the file (total) */
- u64 total_read_bytes;
- /* size of the input file */
- u64 file_size;
- /* number of bytes required to finish the current ISO Box reading (not used here)*/
- u64 missing_bytes;
- /* Thread used to run the ISO parsing in */
- GF_Thread *reading_thread;
- /* Return value for the program */
- int ret = 0;
-
- /* Usage */
- if (argc != 2) {
- fprintf(stdout, "Usage: %s filename\n", argv[0]);
- return 1;
- }
-
- /* Initializing GPAC framework */
- /* Enables GPAC memory tracking in debug mode only */
-#if defined(DEBUG) || defined(_DEBUG)
- gf_sys_init(GF_MemTrackerSimple);
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_WARNING);
- gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
-#else
- gf_sys_init(GF_MemTrackerNone);
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_WARNING);
-#endif
-
- /* This is an input file to read data from. Could be replaced by any other method to retrieve the data (e.g. JavaScript, socket, ...)*/
- input = gf_fopen(argv[1], "rb");
- if (!input) {
- fprintf(stdout, "Could not open file %s for reading.\n", argv[1]);
- gf_sys_close();
- return 1;
- }
-
- gf_fseek(input, 0, SEEK_END);
- file_size = gf_ftell(input);
- gf_fseek(input, 0, SEEK_SET);
-
- /* Initializing the progressive reader */
- memset(&reader, 0, sizeof(ISOProgressiveReader));
- reading_thread = gf_th_new("ISO reading thread");
- reader.mutex = gf_mx_new("ISO Segment");
- reader.state = RUNNING;
- /* we want to parse the first track */
- reader.track_id = 1;
- /* start the async parsing */
- gf_th_run(reading_thread, iso_progressive_read_thread, &reader);
-
- /* start the data reading */
- reader.data_size = BUFFER_BLOCK_SIZE;
- reader.data = (u8 *)gf_malloc(reader.data_size);
- reader.valid_data_size = 0;
- total_read_bytes = 0;
- while (1) {
- /* block the parser until we are done manipulating the data buffer */
- gf_mx_p(reader.mutex);
-
- if (reader.valid_data_size + BUFFER_BLOCK_SIZE > MAX_BUFFER_SIZE) {
- /* regulate the reader to limit the max buffer size and let some time to the parser to release buffer data */
- fprintf(stdout, "Buffer full (%d/%d)- waiting to read next data \r", reader.valid_data_size, reader.data_size);
- gf_mx_v(reader.mutex);
- //gf_sleep(10);
- } else {
- /* make sure we have enough space in the buffer to read the next bloc of data */
- if (reader.valid_data_size + BUFFER_BLOCK_SIZE > reader.data_size) {
- reader.data = (u8 *)gf_realloc(reader.data, reader.data_size + BUFFER_BLOCK_SIZE);
- reader.data_size += BUFFER_BLOCK_SIZE;
- }
-
- /* read the next bloc of data and update the data buffer url */
- read_bytes = fread(reader.data+reader.valid_data_size, 1, BUFFER_BLOCK_SIZE, input);
- total_read_bytes += read_bytes;
- fprintf(stdout, "Read "LLD" bytes of "LLD" bytes from input file %s (buffer status: %5d/%5d)\r", total_read_bytes, file_size, argv[1], reader.valid_data_size, reader.data_size);
- if (read_bytes) {
- reader.valid_data_size += read_bytes;
- sprintf(reader.data_url, "gmem://%d@%p", reader.valid_data_size, reader.data);
- } else {
- /* end of file we can quit */
- gf_mx_v(reader.mutex);
- break;
- }
-
- /* if the file is not yet opened (no movie), open it in progressive mode (to update its data later on) */
- if (!reader.movie) {
- /* let's initialize the parser */
- e = gf_isom_open_progressive(reader.data_url, 0, 0, &reader.movie, &missing_bytes);
- if (reader.movie) {
- gf_isom_set_single_moof_mode(reader.movie, GF_TRUE);
- }
- /* we can let parser try to work now */
- gf_mx_v(reader.mutex);
-
- if ((e == GF_OK || e == GF_ISOM_INCOMPLETE_FILE) && reader.movie) {
- /* nothing to do, this is normal */
- } else {
- fprintf(stdout, "Error opening fragmented mp4 in progressive mode: %s (missing "LLD" bytes)\n", gf_error_to_string(e), missing_bytes);
- ret = 1;
- goto exit;
- }
- } else {
- /* let inform the parser that the buffer has been updated with new data */
- e = gf_isom_refresh_fragmented(reader.movie, &missing_bytes, reader.data_url);
-
- /* we can let parser try to work now */
- gf_mx_v(reader.mutex);
-
- if (e != GF_OK && e != GF_ISOM_INCOMPLETE_FILE) {
- fprintf(stdout, "Error refreshing fragmented mp4: %s (missing "LLD" bytes)\n", gf_error_to_string(e), missing_bytes);
- ret = 1;
- goto exit;
- }
- }
-
- //gf_sleep(1);
- }
- }
-
-exit:
- /* stop the parser */
- reader.state = ret ? ERROR : EOS;
- gf_th_stop(reading_thread);
-
- /* clean structures */
- gf_th_del(reading_thread);
- gf_mx_del(reader.mutex);
- gf_free(reader.data);
- gf_isom_close(reader.movie);
- gf_fclose(input);
- gf_sys_close();
-
- return ret;
-}
+++ /dev/null
-include ../../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/testapps/hevcbench
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include" $(SDL_CFLAGS) $(OGL_INCLS) $(OHEVC_CFLAGS)
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= main.o
-
-LINKFLAGS=-L../../../bin/gcc
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=hevcbench$(EXE)
-else
-EXT=
-PROG=hevcbench
-endif
-LINKFLAGS+=-lgpac $(SDL_LIBS) $(OGL_LIBS) $(OHEVC_LDFLAGS)
-
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2012
- * All rights reserved
- *
- * This file is part of GPAC - sample DASH library usage
- *
- */
-
-#ifndef __DEF_BENCH_H__
-#define __DEF_BENCH_H__
-
-#include <gpac/isomedia.h>
-#include <openHevcWrapper.h>
-
-#ifdef WIN32
-
-#include <windows.h>
-#endif
-
-
-#define SDL_MAIN_HANDLED
-#include <SDL.h>
-#include <gpac/maths.h>
-
-#define GL_GLEXT_PROTOTYPES
-
-#if defined (CONFIG_DARWIN_GL)
-#include <OpenGL/gl.h>
-#else
-#include <GL/gl.h>
-#endif
-
-#include <gpac/color.h>
-
-
-
-
-#define GL_CHECK_ERR {s32 res = glGetError(); if (res) GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("GL Error %d file %s line %d\n", res, __FILE__, __LINE__)); }
-
-/*macros for GL proto and fun declaration*/
-#ifdef _WIN32_WCE
-#define GLAPICAST *
-#elif defined(WIN32)
-#include <windows.h>
-#define GLAPICAST APIENTRY *
-#else
-#define GLAPICAST *
-#endif
-
-#define GLDECL(ret, funname, args) \
-typedef ret (GLAPICAST proc_ ## funname)args; \
-extern proc_ ## funname funname; \
-
-#define GLDECL_STATIC(funname) proc_ ## funname funname = NULL
-
-#if defined GPAC_USE_TINYGL
-//no extensions with TinyGL
-#elif defined (GPAC_USE_GLES1X)
-//no extensions with OpenGL ES
-#elif defined(WIN32) || defined (GPAC_CONFIG_WIN32)
-#define LOAD_GL_FUNCS
-#define GET_GLFUN(funname) funname = (proc_ ## funname) wglGetProcAddress(#funname)
-#elif defined(CONFIG_DARWIN_GL)
-extern void (*glutGetProcAddress(const GLubyte *procname))( void );
-#define GET_GLFUN(funname) funname = (proc_ ## funname) glutGetProcAddress(#funname)
-#else
-#define LOAD_GL_FUNCS
-extern void (*glXGetProcAddress(const GLubyte *procname))( void );
-#define GET_GLFUN(funname) funname = (proc_ ## funname) glXGetProcAddress(#funname)
-#endif
-
-
-
-#define DEL_SHADER(_a) if (_a) { glDeleteShader(_a); _a = 0; }
-#define DEL_PROGRAM(_a) if (_a) { glDeleteProgram(_a); _a = 0; }
-
-
-#ifdef WIN32
-GLDECL(GLuint, glCreateProgram, (void) )
-GLDECL(void, glDeleteProgram, (GLuint ) )
-GLDECL(void, glLinkProgram, (GLuint program) )
-GLDECL(void, glUseProgram, (GLuint program) )
-GLDECL(GLuint, glCreateShader, (GLenum shaderType) )
-GLDECL(void, glDeleteShader, (GLuint shader) )
-GLDECL(void, glShaderSource, (GLuint shader, GLsizei count, const char **string, const GLint *length) )
-GLDECL(void, glCompileShader, (GLuint shader) )
-GLDECL(void, glAttachShader, (GLuint program, GLuint shader) )
-GLDECL(void, glDetachShader, (GLuint program, GLuint shader) )
-GLDECL(void, glGetShaderiv, (GLuint shader, GLenum type, GLint *res) )
-GLDECL(void, glGetInfoLogARB, (GLuint shader, GLint size, GLsizei *rsize, const char *logs) )
-GLDECL(GLint, glGetUniformLocation, (GLuint prog, const char *name) )
-GLDECL(void, glUniform1f, (GLint location, GLfloat v0) )
-GLDECL(void, glUniform1i, (GLint location, GLint v0) )
-GLDECL(void, glActiveTexture, (GLenum texture) )
-GLDECL(void, glClientActiveTexture, (GLenum texture) )
-GLDECL(void, glGenBuffers, (GLsizei , GLuint *) )
-GLDECL(void, glDeleteBuffers, (GLsizei , GLuint *) )
-GLDECL(void, glBindBuffer, (GLenum, GLuint ) )
-GLDECL(void, glBufferData, (GLenum, int, void *, GLenum) )
-GLDECL(void, glBufferSubData, (GLenum, int, int, void *) )
-GLDECL(void *, glMapBuffer, (GLenum, GLenum) )
-GLDECL(void *, glUnmapBuffer, (GLenum) )
-#endif
-
-#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
-
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#define GL_STREAM_DRAW_ARB 0x88E0
-#define GL_WRITE_ONLY_ARB 0x88B9
-#define GL_DYNAMIC_DRAW_ARB 0x88E8
-
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-
-
-#endif
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{F728CC84-A7D1-43D2-8A28-05CE9F2FE0D0}</ProjectGuid>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\devtools\include;$(IncludePath)</IncludePath>\r
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\devtools\lib\x64;$(LibraryPath)</LibraryPath>\r
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\devtools\include;$(IncludePath)</IncludePath>\r
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\devtools\lib\x64;$(LibraryPath)</LibraryPath>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Midl>\r
- <TypeLibraryName>\r
- </TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>C:\works\software\signals\modules\extra_lib\include\SDL2\;../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>.\obj\mp42ts_deb/$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\obj\mp42ts_deb/</AssemblerListingLocation>\r
- <ObjectFileName>.\obj\mp42ts_deb/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\obj\mp42ts_deb/</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>C:\works\software\signals\modules\extra_lib\lib/$(Platform)/$(Configuration);../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <Midl>\r
- <TypeLibraryName>\r
- </TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>C:\works\software\signals\modules\extra_lib\include\SDL2\;../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>.\obj\mp42ts_deb/$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\obj\mp42ts_deb/</AssemblerListingLocation>\r
- <ObjectFileName>.\obj\mp42ts_deb/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\obj\mp42ts_deb/</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>C:\works\software\signals\modules\extra_lib\lib/$(Platform)/$(Configuration);../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Midl>\r
- <TypeLibraryName>\r
- </TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>MaxSpeed</Optimization>\r
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>C:\works\software\signals\modules\extra_lib\include\SDL2\;../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>.\obj\mp42ts_rel/$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\obj\mp42ts_rel/</AssemblerListingLocation>\r
- <ObjectFileName>.\obj\mp42ts_rel/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\obj\mp42ts_rel/</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>C:\works\software\signals\modules\extra_lib\lib/$(Platform)/$(Configuration);../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <Midl>\r
- <TypeLibraryName>\r
- </TypeLibraryName>\r
- <HeaderFileName>\r
- </HeaderFileName>\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Full</Optimization>\r
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>.\obj\mp42ts_rel/$(ProjectName).pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\obj\mp42ts_rel/</AssemblerListingLocation>\r
- <ObjectFileName>.\obj\mp42ts_rel/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\obj\mp42ts_rel/</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <IntrinsicFunctions>true</IntrinsicFunctions>\r
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClCompile Include="main.c" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\..\build\msvc10\libgpac_dll.vcxproj">\r
- <Project>{d3540754-e0cf-4604-ac11-82de9bd4d814}</Project>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2012
- * All rights reserved
- *
- * This file is part of GPAC - sample DASH library usage
- *
- */
-
-#include "defbench.h"
-
-
-
-#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__)
-# pragma comment(lib, "libLibOpenHevcWrapper")
-#pragma comment(lib, "SDL2")
-//#pragma comment(lib, "SDL2main")
-#pragma comment(lib, "opengl32")
-#endif
-
-#if defined( _LP64 ) && defined(CONFIG_DARWIN_GL)
-#define GF_SHADERID u64
-#else
-#define GF_SHADERID u32
-#endif
-
-
-//0: memcpy - 1: memmove - 2: u32 * cast and for loop copy of u32* - 3: memset 0 - 4: not touching the mapped buffer: 5: full memcpy, rely on stride in pixelstorei
-#define COPY_TYPE 0
-//set to 1 to disable final gltexImage in PBO mode
-#define NO_TEX 0
-
-
-SDL_Window *window = NULL;
-SDL_GLContext *glctx= NULL;
-SDL_Renderer *render= NULL;
-GLint txid[3];
-u8 *pY = NULL;
-u8 *pU = NULL;
-u8 *pV = NULL;
-u32 width = 0;
-u32 height = 0;
-u32 display_width = 0;
-u32 display_height = 0;
-u32 scale_factor = 1;
-u32 bpp=8;
-u32 Bpp=1;
-u32 yuv_fmt=0;
-GLint memory_format=GL_UNSIGNED_BYTE;
-GLint pixel_format=GL_LUMINANCE;
-GLint texture_type=GL_TEXTURE_2D;
-u32 gl_nb_frames = 1;
-u64 gl_upload_time = 0;
-u64 gl_draw_time = 0;
-u64 gl_upload_time_frame = 0;
-u64 gl_draw_time_frame = 0;
-Bool pbo_mode = GF_TRUE;
-Bool first_tx_load = GF_FALSE;
-Bool use_vsync=0;
-
-GLint glsl_program;
-GF_SHADERID vertex_shader;
-GF_SHADERID fragment_shader;
-
-GLint pbo_Y=0;
-GLint pbo_U=0;
-GLint pbo_V=0;
-
-#ifdef WIN32
-GLDECL_STATIC(glActiveTexture);
-GLDECL_STATIC(glClientActiveTexture);
-GLDECL_STATIC(glCreateProgram);
-GLDECL_STATIC(glDeleteProgram);
-GLDECL_STATIC(glLinkProgram);
-GLDECL_STATIC(glUseProgram);
-GLDECL_STATIC(glCreateShader);
-GLDECL_STATIC(glDeleteShader);
-GLDECL_STATIC(glShaderSource);
-GLDECL_STATIC(glCompileShader);
-GLDECL_STATIC(glAttachShader);
-GLDECL_STATIC(glDetachShader);
-GLDECL_STATIC(glGetShaderiv);
-GLDECL_STATIC(glGetInfoLogARB);
-GLDECL_STATIC(glGetUniformLocation);
-GLDECL_STATIC(glUniform1f);
-GLDECL_STATIC(glUniform1i);
-GLDECL_STATIC(glGenBuffers);
-GLDECL_STATIC(glDeleteBuffers);
-GLDECL_STATIC(glBindBuffer);
-GLDECL_STATIC(glBufferData);
-GLDECL_STATIC(glBufferSubData);
-GLDECL_STATIC(glMapBuffer);
-GLDECL_STATIC(glUnmapBuffer);
-#endif
-
-
-static char *glsl_yuv_shader = "#version 120\n"\
- "uniform sampler2D y_plane;\
- uniform sampler2D u_plane;\
- uniform sampler2D v_plane;\
- const vec3 offset = vec3(-0.0625, -0.5, -0.5);\
- const vec3 R_mul = vec3(1.164, 0.000, 1.596);\
- const vec3 G_mul = vec3(1.164, -0.391, -0.813);\
- const vec3 B_mul = vec3(1.164, 2.018, 0.000);\
- void main(void) \
- {\
- vec2 texc;\
- vec3 yuv, rgb;\
- texc = gl_TexCoord[0].st;\
- texc.y = 1.0 - texc.y;\
- yuv.x = texture2D(y_plane, texc).r; \
- yuv.y = texture2D(u_plane, texc).r; \
- yuv.z = texture2D(v_plane, texc).r; \
- yuv += offset; \
- rgb.r = dot(yuv, R_mul); \
- rgb.g = dot(yuv, G_mul); \
- rgb.b = dot(yuv, B_mul); \
- gl_FragColor = vec4(rgb, 1.0);\
- }";
-
-static char *default_glsl_vertex = "\
- varying vec3 gfNormal;\
- varying vec3 gfView;\
- void main(void)\
- {\
- gfView = vec3(gl_ModelViewMatrix * gl_Vertex);\
- gfNormal = normalize(gl_NormalMatrix * gl_Normal);\
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\
- gl_TexCoord[0] = gl_MultiTexCoord0;\
- }";
-
-
-
-Bool sdl_compile_shader(GF_SHADERID shader_id, const char *name, const char *source)
-{
- GLint blen = 0;
- GLsizei slen = 0;
- u32 len;
- if (!source || !shader_id) return 0;
- len = (u32) strlen(source);
- glShaderSource(shader_id, 1, &source, &len);
- glCompileShader(shader_id);
-
- glGetShaderiv(shader_id, GL_INFO_LOG_LENGTH , &blen);
- if (blen > 1) {
- char* compiler_log = (char*) gf_malloc(blen);
-#ifdef CONFIG_DARWIN_GL
- glGetInfoLogARB((GLhandleARB) shader_id, blen, &slen, compiler_log);
-#else
- glGetInfoLogARB(shader_id, blen, &slen, compiler_log);
-#endif
- GF_LOG(GF_LOG_ERROR, GF_LOG_COMPOSE, ("[GLSL] Failed to compile shader %s: %s\n", name, compiler_log));
- gf_free (compiler_log);
- return 0;
- }
- return 1;
-}
-
-u32 y_size=0;
-u32 u_size=0;
-u32 v_size=0;
-
-void sdl_init(u32 _width, u32 _height, u32 _bpp, u32 stride, Bool use_pbo)
-{
- u32 i, flags;
- Float hw, hh;
- GLint loc;
- GF_Matrix mx;
-
- display_width = width = _width;
- display_height = height = _height;
- bpp = _bpp;
-
- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
- SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
- SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 0);
- SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
-
- flags = SDL_WINDOW_OPENGL;
-
- if (scale_factor>1) {
- display_width /= scale_factor;
- display_height /= scale_factor;
- }
-
- if (use_vsync) flags |= SDL_RENDERER_PRESENTVSYNC;
- window = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, display_width, display_height, flags);
- glctx = SDL_GL_CreateContext(window);
- SDL_GL_MakeCurrent(window, glctx);
-
- render = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
-
-#if (COPY_TYPE==5)
- y_size = stride*height;
-#else
- y_size = width*height;
-#endif
- if (bpp>8) {
- y_size *= 2;
- Bpp = 2;
- }
- pY = gf_malloc(y_size*sizeof(u8));
- memset(pY, 0x80, y_size*sizeof(u8));
- if (yuv_fmt==2) u_size = v_size = y_size;
- else if (yuv_fmt==1) u_size = v_size = y_size/2;
- else u_size = v_size = y_size/4;
-
- pU = gf_malloc(u_size*sizeof(u8));
- memset(pU, 0, u_size*sizeof(u8));
- pV = gf_malloc(v_size*sizeof(u8));
- memset(pV, 0, v_size*sizeof(u8));
-
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- glViewport(0, 0, display_width, display_height);
-
- gf_mx_init(mx);
- hw = ((Float)display_width)/2;
- hh = ((Float)display_height)/2;
- gf_mx_ortho(&mx, -hw, hw, -hh, hh, 50, -50);
- glMatrixMode(GL_PROJECTION);
- glLoadMatrixf(mx.m);
-
-
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- glClear(GL_DEPTH_BUFFER_BIT);
- glDisable(GL_NORMALIZE);
- glDisable(GL_DEPTH_TEST);
- glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
- glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_LIGHTING);
- glDisable(GL_BLEND);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_CULL_FACE);
-
-#ifdef WIN32
-
- GET_GLFUN(glActiveTexture);
- GET_GLFUN(glClientActiveTexture);
- GET_GLFUN(glCreateProgram);
- GET_GLFUN(glDeleteProgram);
- GET_GLFUN(glLinkProgram);
- GET_GLFUN(glUseProgram);
- GET_GLFUN(glCreateShader);
- GET_GLFUN(glDeleteShader);
- GET_GLFUN(glShaderSource);
- GET_GLFUN(glCompileShader);
- GET_GLFUN(glAttachShader);
- GET_GLFUN(glDetachShader);
- GET_GLFUN(glGetShaderiv);
- GET_GLFUN(glGetInfoLogARB);
- GET_GLFUN(glGetUniformLocation);
- GET_GLFUN(glUniform1f);
- GET_GLFUN(glUniform1i);
- GET_GLFUN(glGenBuffers);
- GET_GLFUN(glDeleteBuffers);
- GET_GLFUN(glBindBuffer);
- GET_GLFUN(glBufferData);
- GET_GLFUN(glBufferSubData);
- GET_GLFUN(glMapBuffer);
- GET_GLFUN(glUnmapBuffer);
-#endif
-
- glsl_program = glCreateProgram();
- vertex_shader = glCreateShader(GL_VERTEX_SHADER);
- sdl_compile_shader(vertex_shader, "vertex", default_glsl_vertex);
-
- fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
- sdl_compile_shader(fragment_shader, "fragment", glsl_yuv_shader);
-
- glAttachShader(glsl_program, vertex_shader);
- glAttachShader(glsl_program, fragment_shader);
- glLinkProgram(glsl_program);
-
- glGenTextures(3, txid);
- for (i=0; i<3; i++) {
-
- glEnable(texture_type);
- glBindTexture(texture_type, txid[i] );
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if (bpp>8) {
- glPixelTransferi(GL_RED_SCALE, 64);
- memory_format=GL_UNSIGNED_SHORT;
- }
- glTexParameteri(texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP);
- glTexParameteri(texture_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(texture_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-
- if (bpp>8) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
- } else {
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- }
- glDisable(texture_type);
- }
-
- //sets uniforms: y, u, v textures point to texture slots 0, 1 and 2
- glUseProgram(glsl_program);
- for (i=0; i<3; i++) {
- const char *txname = (i==0) ? "y_plane" : (i==1) ? "u_plane" : "v_plane";
- loc = glGetUniformLocation(glsl_program, txname);
- if (loc == -1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_COMPOSE, ("[Compositor] Failed to locate texture %s in YUV shader\n", txname));
- continue;
- }
- glUniform1i(loc, i);
- }
-/*
- loc = glGetUniformLocation(glsl_program, "width");
- if (loc>= 0) {
- Float w = (Float) width;
- glUniform1f(loc, w);
- }
- loc = glGetUniformLocation(glsl_program, "height");
- if (loc>= 0) {
- Float h = (Float) height;
- glUniform1f(loc, h);
- }
-*/
- glUseProgram(0);
-
-
- if (glMapBuffer==NULL) use_pbo = GF_FALSE;
-
-
- pbo_mode = use_pbo;
- first_tx_load = use_pbo ? GF_FALSE : GF_TRUE;
- if (use_pbo) {
- glGenBuffers(1, &pbo_Y);
- glGenBuffers(1, &pbo_U);
- glGenBuffers(1, &pbo_V);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_Y);
- glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, y_size, NULL, GL_DYNAMIC_DRAW_ARB);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_U);
- glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, u_size, NULL, GL_DYNAMIC_DRAW_ARB);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_V);
- glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, v_size, NULL, GL_DYNAMIC_DRAW_ARB);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
- }
-}
-
-void sdl_close()
-{
- DEL_SHADER(vertex_shader);
- DEL_SHADER(fragment_shader);
- DEL_PROGRAM(glsl_program );
-
- if (pbo_mode && pbo_Y) {
- glDeleteBuffers(1, &pbo_Y);
- glDeleteBuffers(1, &pbo_U);
- glDeleteBuffers(1, &pbo_V);
- }
-
- if (pY) gf_free(pY);
- if (pU) gf_free(pU);
- if (pV) gf_free(pV);
-
- if (glctx) SDL_GL_DeleteContext(glctx);
- if (render) SDL_DestroyRenderer(render);
- if (window) SDL_DestroyWindow(window);
-}
-
-void sdl_draw_quad()
-{
- Float w = ((Float)width)/2;
- Float h = ((Float)height)/2;
-
- glBegin(GL_QUADS);
-
- glVertex3f(w, h, 0);
- glTexCoord2f(1, 0);
-
- glVertex3f(w, -h, 0);
- glTexCoord2f(0, 0);
-
- glVertex3f(-w, -h, 0);
- glTexCoord2f(0, 1);
-
- glVertex3f(-w, h, 0);
- glTexCoord2f(1, 1);
-
- glEnd();
-}
-
-
-void sdl_draw_frame(u8 *pY, u8 *pU, u8 *pV, u32 w, u32 h, u32 bit_depth, u32 stride)
-{
- u32 needs_stride = 0;
- u64 draw_start, end;
- u32 uv_w, uv_h, uv_stride;
-
- if (yuv_fmt==2) {
- uv_w = w;
- uv_h = h;
- uv_stride = stride;
- }
- else if (yuv_fmt==1) {
- uv_w = w;
- uv_h = h/2;
- uv_stride = stride;
- }
- else {
- uv_w = w/2;
- uv_h = h/2;
- uv_stride = stride/2;
- }
-
- if (stride != w) {
- if (bit_depth==10) {
- if (stride != 2*w) {
- needs_stride = stride / 2;
- }
- } else {
- needs_stride = stride;
- }
- }
-
- glEnable(texture_type);
-
- draw_start = gf_sys_clock_high_res();
-
-
- if (first_tx_load) {
- glBindTexture(texture_type, txid[0] );
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride);
- glTexImage2D(texture_type, 0, GL_LUMINANCE, w, h, 0, pixel_format, memory_format, pY);
-
- glBindTexture(texture_type, txid[1] );
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, uv_stride);
- glTexImage2D(texture_type, 0, GL_LUMINANCE, uv_w, uv_h, 0, pixel_format, memory_format, pU);
-
- glBindTexture(texture_type, txid[2] );
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, uv_stride);
- glTexImage2D(texture_type, 0, GL_LUMINANCE, uv_w, uv_h, 0, pixel_format, memory_format, pV);
-
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- first_tx_load = GF_FALSE;
- } else if (pbo_mode) {
- u32 i, linesize, count, p_stride;
- u8 *ptr;
-#if (COPY_TYPE==2)
- u32 *s, *d;
- u32 j, c2;
-#endif
-
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_Y);
- ptr =(u8 *)glMapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB);
-#if (COPY_TYPE==5)
- memcpy(ptr, pY, size);
-#elif (COPY_TYPE==3)
- memset(ptr, 0x80, size);
-#elif (COPY_TYPE==4)
-#else
- linesize = width*Bpp;
- p_stride = stride;
- count = h;
-#if (COPY_TYPE==2)
- c2 = linesize/4;
- s = (u32 *)pY;
- d = (u32 *)ptr;
-#endif
- for (i=0; i<count; i++) {
-#if (COPY_TYPE==0) || (COPY_TYPE==1)
-#if (COPY_TYPE==0)
- memcpy(ptr, pY, linesize);
-#else
- memmove(ptr, pY, linesize);
-#endif
- pY+= p_stride;
- ptr += linesize;
-#else
- for (j=0; j<linesize/4; j++) {
- *d++ = *s++;;
- }
- s+= (p_stride-linesize)/4;
-#endif
- }
-#endif
- glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_U);
- ptr =(u8 *)glMapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB);
-#if (COPY_TYPE==5)
- memcpy(ptr, pU, uv_w * uv_h);
-#elif (COPY_TYPE==3)
- memset(ptr, 0x80, uv_w * uv_h);
-#elif (COPY_TYPE==4)
-#else
- linesize = uv_w * Bpp;
- p_stride = uv_stride;
- count = uv_h;
-#if (COPY_TYPE==2)
- c2 /= 2;
- s = (u32 *)pU;
- d = (u32 *)ptr;
-#endif
- for (i=0; i<count; i++) {
-#if (COPY_TYPE==0) || (COPY_TYPE==1)
-#if (COPY_TYPE==0)
- memcpy(ptr, pU, linesize);
-#else
- memmove(ptr, pU, linesize);
-#endif
- pU+= p_stride;
- ptr += linesize;
-#else
- for (j=0; j<linesize/4; j++) {
- *d++ = *s++;;
- }
- s+= (p_stride-linesize)/4;
-#endif
- }
-#endif
- glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_V);
- ptr =(u8 *)glMapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB);
-#if (COPY_TYPE==5)
- memcpy(ptr, pV, uv_w * uv_h);
-#elif (COPY_TYPE==3)
- memset(ptr, 0x80, uv_w * uv_h);
-#elif (COPY_TYPE==4)
-#else
-#if (COPY_TYPE==2)
- s = (u32 *)pV;
- d = (u32 *)ptr;
-#endif
- for (i=0; i<count; i++) {
-#if (COPY_TYPE==0) || (COPY_TYPE==1)
-#if (COPY_TYPE==0)
- memcpy(ptr, pV, linesize);
-#else
- memmove(ptr, pV, linesize);
-#endif
- pV+= p_stride;
- ptr += linesize;
-#else
- for (j=0; j<linesize/4; j++) {
- *d++ = *s++;;
- }
- s+= (p_stride-linesize)/4;
-#endif
- }
-#endif
- glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB);
-
-#if (COPY_TYPE!=5)
-// needs_stride=0;
-#endif
-
-
-#if (NO_TEX==0)
- glBindTexture(texture_type, txid[0] );
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_Y);
-#if (COPY_TYPE!=5)
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride);
-#endif
- glTexImage2D(texture_type, 0, GL_LUMINANCE, w, h, 0, pixel_format, memory_format, NULL);
- //glTexSubImage2D crashes with PBO and 2-bytes luminance on my FirePro W5000 ...
-// glTexSubImage2D(texture_type, 0, 0, 0, w, h, pixel_format, memory_format, pY);
-
- glBindTexture(texture_type, txid[1] );
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_U);
-#if (COPY_TYPE!=5)
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride/2);
-#endif
- glTexImage2D(texture_type, 0, GL_LUMINANCE, uv_w, uv_h, 0, pixel_format, memory_format, NULL);
-// glTexSubImage2D(texture_type, 0, 0, 0, uv_w, uv_h, pixel_format, memory_format, pU);
-
- glBindTexture(texture_type, txid[2] );
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_V);
-#if (COPY_TYPE!=5)
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride/2);
-#endif
- glTexImage2D(texture_type, 0, GL_LUMINANCE, uv_w, uv_h, 0, pixel_format, memory_format, NULL);
-// glTexSubImage2D(texture_type, 0, 0, 0, uv_w, uv_h, pixel_format, memory_format, pV);
-#endif
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- } else {
- glBindTexture(texture_type, txid[0] );
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride);
- glTexSubImage2D(texture_type, 0, 0, 0, w, h, pixel_format, memory_format, pY);
- glBindTexture(texture_type, 0);
-
- glBindTexture(texture_type, txid[1] );
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride/2);
- glTexSubImage2D(texture_type, 0, 0, 0, uv_w, uv_h, pixel_format, memory_format, pU);
- glBindTexture(texture_type, 0);
-
- glBindTexture(texture_type, txid[2] );
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride/2);
- glTexSubImage2D(texture_type, 0, 0, 0, uv_w, uv_h, pixel_format, memory_format, pV);
- glBindTexture(texture_type, 0);
-
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- }
- end = gf_sys_clock_high_res() - draw_start;
-
- if (!first_tx_load) {
- gl_nb_frames ++;
- gl_upload_time += end;
- }
- gl_upload_time_frame = end;
-
- glUseProgram(glsl_program);
-
- glActiveTexture(GL_TEXTURE2);
- glBindTexture(texture_type, txid[2]);
-
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(texture_type, txid[1]);
-
- glActiveTexture(GL_TEXTURE0 );
- glBindTexture(texture_type, txid[0]);
-
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glClientActiveTexture(GL_TEXTURE0);
-
- sdl_draw_quad();
-
- glDisable(texture_type);
- glUseProgram(0);
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(texture_type, 0);
-
- SDL_GL_SwapWindow(window);
-
- gl_draw_time_frame = gf_sys_clock_high_res() - draw_start;
- gl_draw_time += gl_draw_time_frame;
- return;
-}
-
-
-void sdl_bench()
-{
- Double rate;
- u32 i, count;
- u64 start = gf_sys_clock_high_res();
-
- fprintf(stderr, "Benching YUV %s blitting\n", (yuv_fmt==2) ? "444" : (yuv_fmt==1) ? "422" : "420");
-
- count = 2000;
- for (i=0; i<count; i++) {
- /*
- u8 val = i%255;
- memset(pY, val, sizeof(char) * y_size);
- memset(pU, val, sizeof(char) * u_size);
- memset(pV, val, sizeof(char) * v_size);
- */
- sdl_draw_frame(pY, pU, pV, width, height, bpp, width);
- }
-
- start = gf_sys_clock_high_res() - start;
- rate = y_size+u_size+v_size;
- rate *= count*1000;
- rate /= start; //in ms
- rate /= 1000; //==*1000 (in s) / 1000 * 1000 in MB /s
- fprintf(stdout, "gltext pushed %d frames in %d ms - FPS %g - data rate %g MB/s\n", count, (u32) (start/1000), 1000000.0*count/start, rate);
-}
-
-void PrintUsage()
-{
- fprintf(stderr, "USAGE: [OPTS] file.mp4\n"
- "\n"
- "Options:\n"
- "-bench-yuv: only bench YUV upload rate\n"
- "-bench-yuv10: only bench YUV10 upload rate\n"
- "-yuv-fmt=N: sets YUV format for yuv bench modes. N = 420, 422 or 444 only\n"
- "-sys-mem: uses copy from decoder mem to system mem before upload (removes stride)\n"
- "-use-pbo: uses PixelBufferObject for texture transfer\n"
- "-output-8b: forces CPU conversion to 8 bit before display (only available when -sys-mem is used)\n"
- "-no-display: disables video output\n"
- "-nb-threads=N: sets number of frame to N (default N=nb virtual cores)\n"
- "-logs=logfile: outputs numbers in CSV format to logfile\n"
- "-mode=[frame|wpp|frame+wpp] : sets threading type (default is frame)\n"
- );
-}
-
-
-
-int main(int argc, char **argv)
-{
- u32 sdl_bench_yuv = 0;
- Bool no_display = GF_FALSE;
- u64 start, now;
- u32 check_prompt, nb_frames_at_start;
- Bool sdl_is_init=GF_FALSE, run;
- Bool paused = GF_FALSE;
- u64 pause_time = 0;
- u64 max_time_spent = 0;
- GF_ISOFile *isom;
- u32 i, count, track = 0, layer_id = 0;
- GF_ESD *esd;
- u32 nb_threads = 0;
- u32 mode = 1;
- Bool use_raw_memory = GF_TRUE;
- OpenHevc_Handle ohevc;
- Bool use_pbo = GF_FALSE;
- GF_MemTrackerType enable_mem_tracker = GF_MemTrackerNone;
- Bool output_8bit = GF_FALSE;
- GF_SystemRTInfo rti;
- const char *src = NULL;
- FILE *csv_logs = NULL;
-
- if (argc<2) {
- PrintUsage();
- return 0;
- }
-
- for (i=0; i<(u32)argc; i++) {
- char *arg = argv[i];
- if (arg[0]!='-') {
- src = arg;
- continue;
- }
- if (!strcmp(arg, "-bench-yuv")) sdl_bench_yuv=1;
- else if (!strcmp(arg, "-bench-yuv10")) sdl_bench_yuv=2;
- else if (!strcmp(arg, "-sys-mem")) use_raw_memory = 0;
- else if (!strcmp(arg, "-vsync")) use_vsync = 1;
- else if (!strcmp(arg, "-use-pbo")) use_pbo = 1;
- else if (!strcmp(arg, "-no-display")) no_display = 1;
- else if (!strcmp(arg, "-output-8b")) output_8bit = GF_TRUE;
- else if (!strcmp(arg, "-mem-track")) enable_mem_tracker = GF_MemTrackerSimple;
- else if (!strncmp(arg, "-scale=", 7)) scale_factor = atoi(arg+7);
- else if (!strncmp(arg, "-layer=", 7)) layer_id = atoi(arg+7);
- else if (!strncmp(arg, "-yuv-fmt=", 9)) {
- if (!strcmp(arg+9, "444")) yuv_fmt=2;
- else if (!strcmp(arg+9, "422")) yuv_fmt=1;
- else yuv_fmt=0;
- }
- else if (!strncmp(arg, "-nb-threads=", 12)) nb_threads = atoi(arg+12);
- else if (!strncmp(arg, "-mode=", 6)) {
- if (!strcmp(arg+6, "wpp")) mode = 2;
- else if (!strcmp(arg+6, "frame+wpp")) mode = 4;
- else mode = 1;
- }
- else if (!strncmp(arg, "-logs=", 6)) {
- csv_logs = fopen(arg+6, "wt");
- }
- else if (!strcmp(arg, "-h")) {
- PrintUsage();
- return 0;
- }
- }
-
-
-
- /*****************/
- /* gpac init */
- /*****************/
-#ifdef GPAC_MEMORY_TRACKING
- gf_sys_init(enable_mem_tracker);
-#else
- gf_sys_init(GF_MemTrackerNone);
-#endif
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_WARNING);
-
- if (sdl_bench_yuv) {
- sdl_init(3840, 2160, (sdl_bench_yuv==2) ? 10 : 8, 3840, use_pbo);
- sdl_bench();
- sdl_close();
- gf_sys_close();
- return 0;
- }
- if (!src) {
- PrintUsage();
- gf_sys_close();
- return 0;
- }
-
-
- isom = gf_isom_open(src, GF_ISOM_OPEN_READ, NULL);
- if (!isom) {
- sdl_close();
- gf_sys_close();
- return 0;
- }
-
- for (i=0; i<gf_isom_get_track_count(isom); i++) {
- if (gf_isom_get_hevc_lhvc_type(isom, i+1, 1)>=GF_ISOM_HEVCTYPE_HEVC_ONLY) {
- track = i+1;
- break;
- }
- }
-
- if (!track) {
- gf_isom_close(isom);
- sdl_close();
- gf_sys_close();
- return 0;
- }
-
- gf_sys_get_rti(10, &rti, 0);
- if (!nb_threads) nb_threads = rti.nb_cores;
-
- nb_frames_at_start = 0;
- count = gf_isom_get_sample_count(isom, track);
- start = gf_sys_clock_high_res();
-
- esd = gf_isom_get_esd(isom, track, 1);
- ohevc = libOpenHevcInit(nb_threads, mode);
- if (esd->decoderConfig && esd->decoderConfig->decoderSpecificInfo && esd->decoderConfig->decoderSpecificInfo->data) {
- libOpenHevcCopyExtraData(ohevc, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength);
- }
-
- libOpenHevcSetActiveDecoders(ohevc, layer_id);
- libOpenHevcSetViewLayers(ohevc, layer_id);
-
- libOpenHevcStartDecoder(ohevc);
- gf_odf_desc_del((GF_Descriptor *)esd);
- gf_isom_set_sample_padding(isom, track, 8);
-
-
- if (csv_logs) {
- fprintf(csv_logs, "Time,FrameDecode,Frame GPU Upload,Frame GPU Draw,CPU %%,RAP type\n");
- }
-
- run=1;
- check_prompt=0;
- for (i=0; i<count && run; i++) {
- u32 di;
- if (!paused) {
- int got_pic;
- u64 time_spent = gf_sys_clock_high_res();
- GF_ISOSample *sample = gf_isom_get_sample(isom, track, i+1, &di);
-
- got_pic = libOpenHevcDecode(ohevc, sample->data, sample->dataLength, sample->DTS+sample->CTS_Offset);
- if (got_pic) {
- if (no_display) {
- OpenHevc_Frame HVCFrame_ptr;
- libOpenHevcGetOutput(ohevc, 1, &HVCFrame_ptr);
- time_spent = gf_sys_clock_high_res() - time_spent;
- } else if (use_raw_memory) {
- OpenHevc_Frame HVCFrame_ptr;
- libOpenHevcGetOutput(ohevc, 1, &HVCFrame_ptr);
- time_spent = gf_sys_clock_high_res() - time_spent;
-
- if (!sdl_is_init && !no_display) {
- u64 sdl_init_time = gf_sys_clock_high_res();
- sdl_init(HVCFrame_ptr.frameInfo.nWidth, HVCFrame_ptr.frameInfo.nHeight, HVCFrame_ptr.frameInfo.nBitDepth, HVCFrame_ptr.frameInfo.nYPitch, use_pbo);
- sdl_is_init=1;
- start += gf_sys_clock_high_res() - sdl_init_time;
- }
-
- sdl_draw_frame((u8 *) HVCFrame_ptr.pvY, (u8 *) HVCFrame_ptr.pvU, (u8 *) HVCFrame_ptr.pvV, HVCFrame_ptr.frameInfo.nWidth, HVCFrame_ptr.frameInfo.nHeight, HVCFrame_ptr.frameInfo.nBitDepth, HVCFrame_ptr.frameInfo.nYPitch);
- } else {
- OpenHevc_Frame_cpy HVCFrame;
- memset(&HVCFrame, 0, sizeof(OpenHevc_Frame_cpy) );
-
- libOpenHevcGetPictureInfoCpy(ohevc, &HVCFrame.frameInfo);
- time_spent = gf_sys_clock_high_res() - time_spent;
-
- if (!sdl_is_init && !no_display) {
- u64 sdl_init_time = gf_sys_clock_high_res();
- u32 stride = HVCFrame.frameInfo.nYPitch;
- bpp = HVCFrame.frameInfo.nBitDepth;
- if ((bpp==10) && output_8bit) {
- bpp = 8;
- stride = HVCFrame.frameInfo.nYPitch/2;
- }
-
- sdl_init(HVCFrame.frameInfo.nWidth, HVCFrame.frameInfo.nHeight, bpp, stride, use_pbo);
- sdl_is_init=1;
- start += gf_sys_clock_high_res() - sdl_init_time;
- }
-
- if ((HVCFrame.frameInfo.nBitDepth==10) && output_8bit) {
- OpenHevc_Frame HVCFrame_ptr;
- GF_VideoSurface dst;
- memset(&dst, 0, sizeof(GF_VideoSurface));
- dst.width = HVCFrame.frameInfo.nWidth;
- dst.height = HVCFrame.frameInfo.nHeight;
- dst.pitch_y = HVCFrame.frameInfo.nWidth;
- dst.video_buffer = pY;
- dst.u_ptr = pU;
- dst.v_ptr = pV;
- dst.pixel_format = GF_PIXEL_YV12;
-
- libOpenHevcGetOutput(ohevc, 1, &HVCFrame_ptr);
-
- gf_color_write_yv12_10_to_yuv(&dst, (u8 *) HVCFrame_ptr.pvY, (u8 *) HVCFrame_ptr.pvU, (u8 *) HVCFrame_ptr.pvV, HVCFrame_ptr.frameInfo.nYPitch, HVCFrame_ptr.frameInfo.nWidth, HVCFrame_ptr.frameInfo.nHeight, NULL, GF_FALSE);
-
- HVCFrame.frameInfo.nBitDepth = 8;
- HVCFrame.frameInfo.nYPitch = HVCFrame.frameInfo.nWidth;
- } else {
- HVCFrame.pvY = (void*) pY;
- HVCFrame.pvU = (void*) pU;
- HVCFrame.pvV = (void*) pV;
-
- libOpenHevcGetOutputCpy(ohevc, 1, &HVCFrame);
- }
-
- sdl_draw_frame(pY, pU, pV, HVCFrame.frameInfo.nWidth, HVCFrame.frameInfo.nHeight, HVCFrame.frameInfo.nBitDepth, HVCFrame.frameInfo.nYPitch);
- }
- }
- //ignore first frame
- if (!max_time_spent) {
- max_time_spent = 1;
- } else if (max_time_spent<time_spent) {
- max_time_spent = time_spent;
- }
-
- gf_sys_get_rti(10, &rti, 0);
- now = gf_sys_clock_high_res();
- fprintf(stderr, "%d %% %d frames in "LLD" us - FPS %03.2f - push "LLD" us - draw "LLD" us - CPU %03d\r", 100*(i+1-nb_frames_at_start)/count, i+1-nb_frames_at_start, (now-start)/1000, 1000000.0 * (i+1-nb_frames_at_start) / (now-start), gl_upload_time / gl_nb_frames/1000 , (gl_draw_time - gl_upload_time) / gl_nb_frames/1000, rti.process_cpu_usage);
-
- if (csv_logs) {
- fprintf(csv_logs, LLD","LLD","LLD","LLD",%d,%d\n", now-start, time_spent, gl_upload_time_frame, gl_draw_time_frame, rti.process_cpu_usage, sample->IsRAP);
- }
-
- gf_isom_sample_del(&sample);
-
-
- } else {
- gf_sleep(10);
- i--;
- }
- check_prompt++;
- if (check_prompt==50) {
- if (gf_prompt_has_input()) {
- switch (gf_prompt_get_char()) {
- case 'q':
- run = 0;
- break;
- case 'm':
- use_raw_memory = !use_raw_memory;
- break;
- case 'p':
- if (paused) {
- paused=0;
- start += gf_sys_clock_high_res()-pause_time;
- } else {
- paused = 1;
- pause_time=gf_sys_clock_high_res();
- }
- break;
- case 'r':
- start = gf_sys_clock_high_res();
- nb_frames_at_start = i+1;
- gl_upload_time = gl_draw_time = 0;
- gl_nb_frames=1;
- break;
-
- }
- }
- check_prompt=0;
- }
- }
- now = gf_sys_clock_high_res();
- fprintf(stderr, "\nDecoded %d frames in %d ms - FPS %g - max frame decode "LLD" us\n", i+1, (u32) ((now-start)/1000), 1000000.0 * (i+1) / (now-start), max_time_spent);
-
- libOpenHevcClose(ohevc);
- gf_isom_close(isom);
-
- if (csv_logs) fclose(csv_logs);
-
- if (!no_display)
- sdl_close();
-
- gf_sys_close();
- return 1;
-}
-
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="largefile" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
-\r
-CFG=largefile - Win32 Debug\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "largefile.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "largefile.mak" CFG="largefile - Win32 Debug"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "largefile - Win32 Release" (based on "Win32 (x86) Console Application")\r
-!MESSAGE "largefile - Win32 Debug" (based on "Win32 (x86) Console Application")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-RSC=rc.exe\r
-\r
-!IF "$(CFG)" == "largefile - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Release"\r
-# PROP BASE Intermediate_Dir "Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD BASE RSC /l 0x40c /d "NDEBUG"\r
-# ADD RSC /l 0x40c /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 winmm.lib /nologo /subsystem:console /machine:I386\r
-\r
-!ELSEIF "$(CFG)" == "largefile - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "Debug"\r
-# PROP BASE Intermediate_Dir "Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD BASE RSC /l 0x40c /d "_DEBUG"\r
-# ADD RSC /l 0x40c /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "largefile - Win32 Release"\r
-# Name "largefile - Win32 Debug"\r
-# Begin Group "Source Files"\r
-\r
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
-# Begin Source File\r
-\r
-SOURCE=.\main.c\r
-# End Source File\r
-# End Group\r
-# Begin Group "Header Files"\r
-\r
-# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
-# End Group\r
-# Begin Group "Resource Files"\r
-\r
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
-# End Group\r
-# End Target\r
-# End Project\r
+++ /dev/null
-Microsoft Developer Studio Workspace File, Format Version 6.00\r
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r
-\r
-###############################################################################\r
-\r
-Project: "largefile"=.\largefile.dsp - Package Owner=<4>\r
-\r
-Package=<5>\r
-{{{\r
-}}}\r
-\r
-Package=<4>\r
-{{{\r
- Begin Project Dependency\r
- Project_Dep_Name libgpac\r
- End Project Dependency\r
-}}}\r
-\r
-###############################################################################\r
-\r
-Project: "libgpac"=..\..\..\build\msvc6\libgpac.dsp - Package Owner=<4>\r
-\r
-Package=<5>\r
-{{{\r
-}}}\r
-\r
-Package=<4>\r
-{{{\r
-}}}\r
-\r
-###############################################################################\r
-\r
-Global:\r
-\r
-Package=<5>\r
-{{{\r
-}}}\r
-\r
-Package=<3>\r
-{{{\r
-}}}\r
-\r
-###############################################################################\r
-\r
+++ /dev/null
-#include <gpac/isomedia.h>
-
-void PrintUsage()
-{
- fprintf(stdout,
- "Usage: largefile [options]\n"
- "Option is one of:\n"
- "-flat test file writing in flat mode (moov at end)\n"
- "-inter test file writing in interleaved mode (moov at begin)\n"
- "-size size specifies target media size in GB. Default is 5.0 GB\n"
- ""
- );
-}
-#define TEST_FILE_NAME "largefile.mp4"
-
-int main(int argc, char **argv)
-{
- GF_ISOFile *movie;
- GF_ESD *esd;
- GF_Err e;
- Double gb_size = 5.0;
- u8 store_mode;
- u32 track, di, i, nb_samp;
- GF_ISOSample *samp;
-
- store_mode = GF_ISOM_OPEN_WRITE;
- for (i=1; i<argc; i++) {
- if (!strcmp(argv[i], "-flat")) store_mode = GF_ISOM_OPEN_WRITE;
- else if (!strcmp(argv[i], "-inter")) store_mode = GF_ISOM_WRITE_EDIT;
- else if (!strcmp(argv[i], "-size") && (i+1<argc)) {
- gb_size = atof(argv[i+1]);
- i++;
- }
- else if (!strcmp(argv[i], "-h")) {
- PrintUsage();
- return 0;
- }
- }
-
- nb_samp = (u32) (gb_size*1024);
- fprintf(stdout, "Creating test file %s - %g GBytes - %d samples - %s mode\n", TEST_FILE_NAME, gb_size, nb_samp, (store_mode == GF_ISOM_OPEN_WRITE) ? "Flat" : "Interleaved");
-
- movie = gf_isom_open(TEST_FILE_NAME, store_mode, NULL);
- if (!movie) {
- fprintf(stdout, "Error creating file: %s\n", gf_error_to_string(gf_isom_last_error(NULL)));
- return 1;
- }
-
- track = gf_isom_new_track(movie, 1, GF_ISOM_MEDIA_VISUAL, 25);
- esd = gf_odf_desc_esd_new(2);
- esd->decoderConfig->streamType = 4;
- gf_isom_new_mpeg4_description(movie, track, esd, NULL, NULL, &di);
-
- samp = gf_isom_sample_new();
- samp->dataLength = 1024*1024;
- samp->data = gf_malloc(sizeof(char)*samp->dataLength);
- memset(samp->data, 0, sizeof(char)*samp->dataLength);
-
- for (i=0; i<nb_samp; i++) {
- if (samp->DTS % 25) samp->IsRAP = 0;
- else samp->IsRAP = 1;
- e = gf_isom_add_sample(movie, track, di, samp);
- samp->DTS += 1;
-
- fprintf(stdout, "Writing sample %d / %d \r", i+1, nb_samp);
- if (e) break;
- }
- gf_isom_sample_del(&samp);
-
- if (e) {
- fprintf(stdout, "\nError writing sample %d\n", i);
- gf_isom_delete(movie);
- return 1;
- }
-
- fprintf(stdout, "\nDone writing samples\n");
- e = gf_isom_close(movie);
- if (e) {
- fprintf(stdout, "Error writing file\n");
- return 1;
- }
- return 0;
-}
-
-
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="LoadCompare" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
-\r
-CFG=LoadCompare - Win32 Debug\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "LoadCompare.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "LoadCompare.mak" CFG="LoadCompare - Win32 Debug"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "LoadCompare - Win32 Release" (based on "Win32 (x86) Console Application")\r
-!MESSAGE "LoadCompare - Win32 Debug" (based on "Win32 (x86) Console Application")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-RSC=rc.exe\r
-\r
-!IF "$(CFG)" == "LoadCompare - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "LoadCompare___Win32_Release"\r
-# PROP BASE Intermediate_Dir "LoadCompare___Win32_Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "obj/loadcompare_rel"\r
-# PROP Intermediate_Dir "obj/loadcompare_rel"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /I "../../../extra_lib/include/zlib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /c\r
-# SUBTRACT CPP /YX\r
-# ADD BASE RSC /l 0x40c /d "NDEBUG"\r
-# ADD RSC /l 0x40c /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 zlib.lib winmm.lib libxml2.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/LoadCompare.exe" /libpath:"../../../extra_lib/lib/w32_rel"\r
-\r
-!ELSEIF "$(CFG)" == "LoadCompare - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "LoadCompare___Win32_Debug"\r
-# PROP BASE Intermediate_Dir "LoadCompare___Win32_Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "obj/loadcompare_deb"\r
-# PROP Intermediate_Dir "obj/loadcompare_deb"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../extra_lib/include/zlib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c\r
-# ADD BASE RSC /l 0x40c /d "_DEBUG"\r
-# ADD RSC /l 0x40c /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 zlib.lib winmm.lib libxml2.lib /nologo /subsystem:console /pdb:"obj/loadcompare_deb//LoadCompare.pdb" /debug /machine:I386 /out:"../../../bin/w32_deb/LoadCompare.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"\r
-# SUBTRACT LINK32 /pdb:none\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "LoadCompare - Win32 Release"\r
-# Name "LoadCompare - Win32 Debug"\r
-# Begin Group "Source Files"\r
-\r
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
-# Begin Source File\r
-\r
-SOURCE=.\loadcompare.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=..\..\..\modules\svg_loader\lsr_parser.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=..\..\..\modules\svg_loader\svg_parser.c\r
-# End Source File\r
-# End Group\r
-# Begin Group "Header Files"\r
-\r
-# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
-# End Group\r
-# Begin Group "Resource Files"\r
-\r
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
-# End Group\r
-# End Target\r
-# End Project\r
+++ /dev/null
-include ../../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/testapps/loadcompare
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-CFLAGS+=$(XML2_CFLAGS)
-
-#common obj
-OBJS= loadcompare.o ../../../modules/svg_loader/svg_parser.o ../../../modules/svg_loader/lsr_parser.o
-
-LINKFLAGS=-L../../../bin/gcc
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=LoadCompare$(EXE)
-#LINKFLAGS+=-lgpac_static -lz $(EXTRALIBS)
-LINKFLAGS+=-lgpac
-else
-EXT=
-PROG=LoadCompare
-#LINKFLAGS+=-lgpac_static $(EXTRALIBS) $(GPAC_SH_FLAGS) -lz
-LINKFLAGS+=-lgpac -lz $(XML2_LIBS)
-endif
-
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Cyril Concolato
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / load&compare application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-#include <gpac/scene_manager.h>
-#include <zlib.h>
-
-enum {
- SVG = 0,
- XMT = 1,
-};
-
-typedef struct {
- char filename[100];
- u32 size;
- u32 gpacxml_loadtime;
- u32 libxml_loadtime;
- u32 gz_size;
- u32 gpacxml_gz_loadtime;
- u32 libxml_gz_loadtime;
- u32 track_size;
- u32 track_loadtime;
- u32 decoded_size;
- u32 decoded_loadtime;
-} LoadData;
-
-typedef struct {
- FILE *out;
- u32 type;
- u32 nbloads;
- u32 verbose;
- Bool regenerate;
- Bool spread_repeat;
- u32 repeat_index;
- GF_List *data;
-} GF_LoadCompare;
-
-GF_Err load_mp4(GF_LoadCompare *lc, GF_ISOFile *mp4, u32 *loadtime)
-{
- GF_Err e = GF_OK;
- GF_SceneLoader load;
- u32 i, starttime, endtime;
- u32 nb;
- if (lc->spread_repeat) nb = 1;
- else nb = lc->nbloads ;
-
- *loadtime = 0;
- for (i = 0; i< nb; i++) {
- GF_SceneGraph *sg;
- memset(&load, 0, sizeof(GF_SceneLoader));
- sg = gf_sg_new();
- load.ctx = gf_sm_new(sg);
-
- load.isom = mp4;
- starttime = gf_sys_clock();
-
- e = gf_sm_load_init(&load);
- if (e) {
- fprintf(stderr, "Error loading MP4 file\n");
- } else {
- e = gf_sm_load_run(&load);
- if (e) {
- fprintf(stderr, "Error loading MP4 file\n");
- } else {
- endtime = gf_sys_clock();
- *loadtime += endtime-starttime;
- }
- gf_sm_load_done(&load);
- }
- gf_sm_del(load.ctx);
- gf_sg_del(sg);
- }
- return e;
-}
-
-void load_progress(void *cbk, u32 done, u32 total) {
- fprintf(stdout, "%d/%d\r", done, total);
-}
-
-GF_Err gpacctx_load_file(GF_LoadCompare *lc, char *item_path, u32 *loadtime)
-{
- GF_Err e = GF_OK;
- GF_SceneLoader load;
- u32 i, starttime, endtime;
-
- u32 nb;
- if (lc->spread_repeat) nb = 1;
- else nb = lc->nbloads ;
-
- *loadtime = 0;
-
- for (i = 0; i<nb; i++) {
- GF_SceneGraph *sg;
- memset(&load, 0, sizeof(GF_SceneLoader));
- sg = gf_sg_new();
- load.ctx = gf_sm_new(sg);
- load.OnProgress = load_progress;
-
- load.fileName = item_path;
- starttime = gf_sys_clock();
-
- e = gf_sm_load_init(&load);
- if (e) {
- fprintf(stderr, "Error loading file %s\n", item_path);
- } else {
- e = gf_sm_load_run(&load);
- if (e) {
- fprintf(stderr, "Error loading file %s\n", item_path);
- } else {
- endtime = gf_sys_clock();
- *loadtime += endtime-starttime;
- }
- gf_sm_load_done(&load);
- }
- gf_sm_del(load.ctx);
- gf_sg_del(sg);
- }
- return e;
-}
-
-GF_Err get_laser_track_size(GF_ISOFile *mp4, u32 *size)
-{
- GF_Err e = GF_OK;
- u32 j;
- u32 track_id, trackNum;
-
- *size = 0;
- track_id = gf_isom_get_track_id(mp4, 1);
- trackNum = gf_isom_get_track_by_id(mp4, track_id);
- for (j=0; j<gf_isom_get_sample_count(mp4, trackNum); j++) {
- GF_ISOSample *samp = gf_isom_get_sample_info(mp4, trackNum, j+1, NULL, NULL);
- *size += samp->dataLength;
- gf_isom_sample_del(&samp);
- }
- return e;
-}
-
-GF_Err encode_laser(GF_LoadCompare *lc, char *item_path, GF_ISOFile *mp4, GF_SMEncodeOptions *opts)
-{
- GF_Err e = GF_OK;
- GF_SceneLoader load;
- GF_SceneManager *ctx;
- GF_SceneGraph *sg;
- GF_StatManager *statsman = NULL;
-
- memset(&load, 0, sizeof(GF_SceneLoader));
- sg = gf_sg_new();
- ctx = gf_sm_new(sg);
- load.ctx = ctx;
- load.fileName = item_path;
-
- e = gf_sm_load_init(&load);
- if (e) {
- fprintf(stderr, "Error loading file %s\n", item_path);
- } else {
- e = gf_sm_load_run(&load);
- if (e) {
- fprintf(stderr, "Error loading file %s\n", item_path);
- } else {
- if (opts->auto_qant) {
- if (lc->verbose) fprintf(stdout, "Analysing Scene for Automatic Quantization\n");
- statsman = gf_sm_stats_new();
- e = gf_sm_stats_for_scene(statsman, ctx);
- if (!e) {
- GF_SceneStatistics *stats = gf_sm_stats_get(statsman);
- if (opts->resolution > (s32)stats->frac_res_2d) {
- if (lc->verbose) fprintf(stdout, " Given resolution %d is (unnecessarily) too high, using %d instead.\n", opts->resolution, stats->frac_res_2d);
- opts->resolution = stats->frac_res_2d;
- } else if (stats->int_res_2d + opts->resolution <= 0) {
- if (lc->verbose) fprintf(stdout, " Given resolution %d is too low, using %d instead.\n", opts->resolution, stats->int_res_2d - 1);
- opts->resolution = 1 - stats->int_res_2d;
- }
- opts->coord_bits = stats->int_res_2d + opts->resolution;
- if (lc->verbose) fprintf(stdout, " Coordinates & Lengths encoded using ");
- if (opts->resolution < 0) {
- if (lc->verbose) fprintf(stdout, "only the %d most significant bits (of %d).\n", opts->coord_bits, stats->int_res_2d);
- } else {
- if (lc->verbose) fprintf(stdout, "a %d.%d representation\n", stats->int_res_2d, opts->resolution);
- }
-
- if (lc->verbose) fprintf(stdout, " Matrix Scale & Skew Coefficients ");
- if (opts->coord_bits < stats->scale_int_res_2d) {
- opts->scale_bits = stats->scale_int_res_2d - opts->coord_bits;
- if (lc->verbose) fprintf(stdout, "encoded using a %d.8 representation\n", stats->scale_int_res_2d);
- } else {
- opts->scale_bits = 0;
- if (lc->verbose) fprintf(stdout, "not encoded.\n");
- }
- }
- gf_sm_stats_del(statsman);
- }
-
- e = gf_sm_encode_to_file(ctx, mp4, opts);
- if (e) {
- fprintf(stderr, "Error while encoding mp4 file\n");
- } else {
- e = gf_isom_set_brand_info(mp4, GF_ISOM_BRAND_MP42, 1);
- if (!e) e = gf_isom_modify_alternate_brand(mp4, GF_ISOM_BRAND_ISOM, 1);
- }
-
- gf_sm_load_done(&load);
- }
- }
- gf_sm_del(ctx);
- gf_sg_del(sg);
-
- return e;
-}
-
-GF_Err create_laser_mp4(GF_LoadCompare *lc, char *item_name, char *item_path, u32 *size)
-{
- char mp4_path[100], *ext;
- GF_Err e = GF_OK;
- GF_ISOFile *mp4;
-
- *size = 0;
-
- strcpy(mp4_path, item_name);
- ext = strrchr(mp4_path, '.');
- strcpy(ext, ".mp4");
- mp4 = gf_isom_open(mp4_path, GF_ISOM_WRITE_EDIT, NULL);
- if (!mp4) {
- if (lc->verbose) fprintf(stdout, "Could not open file %s for writing\n", mp4_path);
- e = GF_IO_ERR;
- } else {
- GF_SMEncodeOptions opts;
- memset(&opts, 0, sizeof(GF_SMEncodeOptions));
- opts.auto_qant = 1;
- opts.resolution = 8;
- e = encode_laser(lc, item_path, mp4, &opts);
- if (e) {
- if (lc->verbose) fprintf(stdout, "Could not encode MP4 file from %s\n", item_path);
- gf_isom_delete(mp4);
- } else {
- gf_isom_close(mp4);
-
- mp4 = gf_isom_open(mp4_path, GF_ISOM_OPEN_READ, NULL);
- if (!mp4) {
- if (lc->verbose) fprintf(stdout, "Could not open file %s for reading\n", mp4_path);
- e = GF_IO_ERR;
- } else {
- e = get_laser_track_size(mp4, size);
- if (e) {
- if (lc->verbose) fprintf(stdout, "Could not get MP4 file size\n");
- }
- gf_isom_close(mp4);
- }
- }
- }
- return e;
-}
-
-
-GF_Err get_mp4_loadtime(GF_LoadCompare *lc, char *item_name, char *item_path, u32 *loadtime)
-{
- char mp4_path[100], *ext;
- GF_Err e = GF_OK;
- GF_ISOFile *mp4;
-
- *loadtime = 0;
-
- strcpy(mp4_path, item_name);
- ext = strrchr(mp4_path, '.');
- strcpy(ext, ".mp4");
- mp4 = gf_isom_open(mp4_path, GF_ISOM_OPEN_READ, NULL);
- if (!mp4) {
- if (lc->verbose) fprintf(stdout, "Could not open file %s for reading\n", mp4_path);
- e = GF_IO_ERR;
- } else {
- e = load_mp4(lc, mp4, loadtime);
- if (e) {
- if (lc->verbose) fprintf(stdout, "Could not get MP4 file load time\n");
- }
- }
- gf_isom_close(mp4);
- return e;
-}
-
-GF_Err decode_svg(GF_LoadCompare *lc, char *item_name, char *item_path, char *svg_out_path)
-{
- GF_SceneManager *ctx;
- GF_SceneLoader load;
- GF_ISOFile *mp4;
- GF_Err e = GF_OK;
- char mp4_path[256];
- char *ext;
-
- strcpy(mp4_path, item_name);
- ext = strrchr(mp4_path, '.');
- strcpy(ext, ".mp4");
- mp4 = gf_isom_open(mp4_path, GF_ISOM_OPEN_READ, NULL);
- if (!mp4) {
- if (lc->verbose) fprintf(stdout, "Could not open file %s\n", mp4_path);
- e = GF_IO_ERR;
- } else {
- GF_SceneGraph *sg;
- sg = gf_sg_new();
- ctx = gf_sm_new(sg);
- memset(&load, 0, sizeof(GF_SceneLoader));
- load.isom = mp4;
- load.ctx = ctx;
- e = gf_sm_load_init(&load);
- if (e) {
- fprintf(stderr, "Error loading MP4 file\n");
- } else {
- e = gf_sm_load_run(&load);
- if (e) {
- fprintf(stderr, "Error loading MP4 file\n");
- } else {
- gf_sm_load_done(&load);
-
- ext = strrchr(svg_out_path, '.');
- ext[0] = 0;
- e = gf_sm_dump(ctx, svg_out_path, GF_SM_DUMP_SVG);
- if (e) {
- fprintf(stderr, "Error dumping SVG from MP4 file\n");
- }
- }
- }
- gf_sm_del(ctx);
- gf_sg_del(sg);
- gf_isom_close(mp4);
- }
- return e;
-}
-
-GF_Err libxml_load_svg(GF_LoadCompare *lc, char *item_path, u32 *loadtime)
-{
- GF_Err e = GF_OK;
- u32 i, starttime, endtime;
-
- u32 nb;
- if (lc->spread_repeat) nb = 1;
- else nb = lc->nbloads ;
-
- *loadtime = 0;
-
- for (i = 0; i<nb; i++) {
- void *p;
- GF_SceneGraph *sg;
- sg = gf_sg_new();
-
- starttime = gf_sys_clock();
-
- p = DANAE_NewSVGParser(item_path, sg);
- DANAE_SVGParser_Parse(p);
- DANAE_SVGParser_Terminate();
-
- endtime = gf_sys_clock();
- if (lc->verbose) fprintf(stdout, "LibXML single parsing: %d\n", endtime-starttime);
- *loadtime += endtime-starttime;
-
- gf_sg_del(sg);
- }
- return e;
-}
-
-GF_Err get_size(GF_LoadCompare *lc, char *item_name, char *item_path, u32 *size)
-{
- GF_Err e = GF_OK;
- FILE *file = NULL;
-
- *size = 0;
-
- file = gf_fopen(item_path, "rt");
- if (!file) {
- if (lc->verbose) fprintf(stdout, "Could not open file %s\n", item_path);
- e = GF_IO_ERR;
- } else {
- fseek(file, 0, SEEK_END);
- *size = (u32)ftell(file);
- gf_fclose(file);
- if (*size == 0) {
- if (lc->verbose) fprintf(stdout, "File %s has a size of 0\n", item_path);
- e = GF_IO_ERR;
- }
- }
- return e;
-}
-
-GF_Err get_decoded_svg_loadtime_and_size(GF_LoadCompare *lc, char *item_name, char *item_path, u32 *loadtime, u32 *size)
-{
- GF_Err e = GF_OK;
- char svg_out_name[256];
- char *ext;
-
- strcpy(svg_out_name, item_name);
- ext = strrchr(svg_out_name, '.');
- strcpy(ext, "_out.svg");
-
- *size = 0;
- *loadtime = 0;
-
- e = decode_svg(lc, item_name, item_path, svg_out_name);
- if (!e) {
- e = get_size(lc, svg_out_name, svg_out_name, size);
- if (e) {
- return e;
- }
- e = gpacctx_load_file(lc, svg_out_name, loadtime);
- }
- return e;
-}
-
-GF_Err create_gz_file(GF_LoadCompare *lc, char *item_name, char *item_path, u32 *size)
-{
- char gz_path[256];
- GF_Err e = GF_OK;
- FILE *file = NULL;
- void *gz = NULL;
- u32 read;
-
- *size = 0;
-
- strcpy(gz_path, item_name);
- strcat(gz_path, "z");
- gz = gzopen(gz_path, "wb");
- file = gf_fopen(item_path, "rt");
-
- if (!gz || !file) {
- if (lc->verbose) fprintf(stdout, "Could not open file %s or %s\n", item_path, gz_path);
- e = GF_IO_ERR;
- } else {
- char buffer[100];
- while ((read = fread(buffer, 1, 100, file))) gzwrite(gz, buffer, read);
- gf_fclose(file);
- gzclose(gz);
- file = gf_fopen(gz_path, "rb");
- fseek(file, 0, SEEK_END);
- *size = (u32)ftell(file);
- gf_fclose(file);
- if (*size == 0) {
- if (lc->verbose) fprintf(stdout, "File %s has a size of 0\n", gz_path);
- e = GF_IO_ERR;
- }
- }
- return e;
-}
-
-GF_Err get_gz_loadtime(GF_LoadCompare *lc, char *item_name, char *item_path, u32 *loadtime, Bool useLibXML)
-{
- char gz_path[256];
- GF_Err e = GF_OK;
- *loadtime = 0;
-
- strcpy(gz_path, item_name);
- strcat(gz_path, "z");
-
- if (useLibXML) {
- e = libxml_load_svg(lc, gz_path, loadtime);
- } else {
- e = gpacctx_load_file(lc, gz_path, loadtime);
- }
- return e;
-}
-
-void print_load_data(GF_LoadCompare *lc, LoadData *ld)
-{
- if (lc->verbose) fprintf(stdout, "Processing %s\n", ld->filename);
- fprintf(lc->out, "%s\t", ld->filename);
-
- if (lc->verbose) fprintf(stdout, "File Size %d\n", ld->size);
- fprintf(lc->out, "%d\t", ld->size);
-
- if (lc->verbose) fprintf(stdout, "GPAC XML Load Time %d\n", ld->gpacxml_loadtime);
- fprintf(lc->out, "%d\t", ld->gpacxml_loadtime);
-
- if (lc->verbose) fprintf(stdout, "LibXML Load Time %d \n", ld->libxml_loadtime);
- fprintf(lc->out, "%d\t", ld->libxml_loadtime);
-
- if (lc->verbose) fprintf(stdout, "GZ Size %d\n", ld->gz_size);
- fprintf(lc->out, "%d\t", ld->gz_size);
-
- if (lc->verbose) fprintf(stdout, "GZ Load Time %d\n", ld->gpacxml_gz_loadtime);
- fprintf(lc->out, "%d\t", ld->gpacxml_gz_loadtime);
-
- if (lc->verbose) fprintf(stdout, "LibXML GZ Load Time %d\n", ld->libxml_gz_loadtime);
- fprintf(lc->out, "%d\t", ld->libxml_gz_loadtime);
-
- if (lc->verbose) fprintf(stdout, "MP4 Track Size %d\n", ld->track_size);
- fprintf(lc->out, "%d\t", ld->track_size);
-
- if (lc->verbose) fprintf(stdout, "MP4 Track Load Time %d\n", ld->track_loadtime);
- fprintf(lc->out, "%d\t", ld->track_loadtime);
-
- if (lc->verbose) fprintf(stdout, "Decoded Size %d\n", ld->decoded_size);
- fprintf(lc->out, "%d\t", ld->decoded_size);
-
- if (lc->verbose) fprintf(stdout, "Decoded Load Time %d \n", ld->decoded_loadtime);
- fprintf(lc->out, "%d\t", ld->decoded_loadtime);
-
- if (lc->verbose) fprintf(stdout, "Done %s\n", ld->filename);
- fprintf(lc->out, "\n");
- fflush(lc->out);
-}
-
-Bool loadcompare_one(void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info)
-{
- GF_Err e;
- GF_LoadCompare *lc = cbck;
- u32 loadtime;
- LoadData *ld;
-
- if (lc->repeat_index == 0) {
- GF_SAFEALLOC(ld, sizeof(LoadData));
- gf_list_add(lc->data, ld);
- strcpy(ld->filename, item_name);
-
- e = get_size(lc, item_name, item_path, &ld->size);
- if (e) return 1;
-
- e = create_gz_file(lc, item_name, item_path, &ld->gz_size);
- if (e) return 1;
-
- e = create_laser_mp4(lc, item_name, item_path, &ld->track_size);
- if (e) return 1;
-
- } else {
- LoadData *tmp;
- u32 pos = 0;
- ld = NULL;
- while (tmp = gf_list_enum(lc->data, &pos)) {
- if (!strcmp(tmp->filename, item_name)) {
- ld = tmp;
- break;
- }
- }
- if (ld == NULL) return 1;
- }
-
-
- if (lc->type == SVG) {
- /* GPAC XML loader */
- e = gpacctx_load_file(lc, item_path, &loadtime);
- if (e) return 1;
- ld->gpacxml_loadtime += loadtime;
-
- e = get_gz_loadtime(lc, item_name, item_path, &loadtime, 0);
- if (e) return 1;
- ld->gpacxml_gz_loadtime += loadtime;
-
- /* LibXML and LibXML GZ loadings */
- e = libxml_load_svg(lc, item_path, &loadtime);
- if (e) return 1;
- ld->libxml_loadtime += loadtime;
-
- e = get_gz_loadtime(lc, item_name, item_path, &loadtime, 1);
- if (e) return 1;
- ld->libxml_gz_loadtime += loadtime;
-
- /* MP4 Loading */
- e = get_mp4_loadtime(lc, item_name, item_path, &loadtime);
- if (e) return 1;
- ld->track_loadtime += loadtime;
-
- /* e = get_decoded_svg_loadtime_and_size(lc, item_name, item_path, &loadtime, &ld->decoded_size);
- if (e) return 1;
- ld->decoded_loadtime += loadtime;*/
-
- } else if (lc->type == XMT) {
- e = gpacctx_load_file(lc, item_path, &loadtime);
- if (e) return 1;
- ld->gpacxml_loadtime += loadtime;
- }
-
- if (!lc->spread_repeat) {
- print_load_data(lc, ld);
- gf_free(ld);
- }
- return 0;
-}
-
-void usage()
-{
- fprintf(stdout, "Compare LASeR and SVG encoding size and loading time\n");
- fprintf(stdout, "usage: (-out output_result) (-single input.svg | -dir dir) (-nloads X) (-verbose X)\n");
- fprintf(stdout, "defaults are: stdout, dir=. and X = 1");
-}
-
-int main(int argc, char **argv)
-{
- u32 i;
- GF_LoadCompare lc;
- Bool single = 0;
- char *out = NULL;
- char in[256] = ".";
-
- fprintf(stdout, "LASeR and SVG Comparison tool\n");
-
- memset(&lc, 0, sizeof(GF_LoadCompare));
- lc.nbloads = 1;
- lc.out = stdout;
-
- for (i = 1; i < (u32) argc ; i++) {
- char *arg = argv[i];
- if (!stricmp(arg, "-out")) {
- out = argv[i+1];
- i++;
- } else if (!stricmp(arg, "-single")) {
- single = 1;
- strcpy(in, argv[i+1]);
- i++;
- } else if (!stricmp(arg, "-dir")) {
- strcpy(in, argv[i+1]);
- i++;
- } else if (!stricmp(arg, "-nloads")) {
- lc.nbloads = (u32)atoi(argv[i+1]);
- i++;
- } else if (!stricmp(arg, "-regenerate")) {
- lc.regenerate = 1;
- } else if (!stricmp(arg, "-xmt")) {
- lc.type = XMT;
- } else if (!stricmp(arg, "-svg")) {
- lc.type = SVG;
- } else if (!stricmp(arg, "-spread_repeat")) {
- lc.spread_repeat = 1;
- } else if (!stricmp(arg, "-verbose")) {
- lc.verbose = (u32)atoi(argv[i+1]);
- i++;
- } else {
- usage();
- return -1;
- }
- }
-
- gf_sys_init(GF_MemTrackerNone);
- if (out) lc.out = gf_fopen(out, "wt");
- if (!lc.out) {
- fprintf(stderr, "Cannot open output file %s\n", out);
- return -1;
- }
-
- if (lc.type == SVG) {
- fprintf(lc.out,"File Name\tSVG Size\tSVG Load Time\tLibXML Load Time\tSVGZ Size\tSVGZ Load Time\tLibXML GZ Load Time\tMP4 Size\tMP4 Load Time\tDecoded SVG Size\tDecoded SVG Load Time\n");
- } else if (lc.type == XMT) {
- fprintf(lc.out,"File Name\tXMT Size\tXMT Load Time\tBT Size\tBT Load Time\n");
- }
-
- lc.data = gf_list_new();
-
- if (single) {
- LoadData *ld;
- char *tmp = strrchr(in, GF_PATH_SEPARATOR);
- loadcompare_one(&lc, tmp+1, in);
- ld = gf_list_get(lc.data, 0);
- print_load_data(&lc, ld);
- gf_free(ld);
- } else {
- if (lc.spread_repeat) {
- for (lc.repeat_index = 0; lc.repeat_index < lc.nbloads; lc.repeat_index ++) {
- if (lc.verbose) fprintf(stdout, "Loop %d\n", lc.repeat_index);
- if (lc.type == SVG) {
- gf_enum_directory(in, 0, loadcompare_one, &lc, "svg");
- } else if (lc.type == XMT) {
- gf_enum_directory(in, 0, loadcompare_one, &lc, "xmt");
- }
- }
- for (i=0; i<gf_list_count(lc.data); i++) {
- LoadData *ld = gf_list_get(lc.data, i);
- print_load_data(&lc, ld);
- gf_free(ld);
- }
- } else {
- if (lc.type == SVG) {
- gf_enum_directory(in, 0, loadcompare_one, &lc, "svg");
- } else if (lc.type == XMT) {
- gf_enum_directory(in, 0, loadcompare_one, &lc, "xmt");
- }
- }
- }
- gf_list_del(lc.data);
-
- if (lc.out) gf_fclose(lc.out);
- gf_sys_close();
- return 0;
-}
-
+++ /dev/null
-include ../../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/test_apps/mpedemux
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#file format is read-only
-ifeq ($(GPACREADONLY),yes)
-CFLAGS+= -DGPAC_READ_ONLY
-endif
-
-ifeq ($(DISABLE_SVG),yes)
-CFLAGS+=-DGPAC_DISABLE_SVG
-endif
-
-#common obj
-OBJS= main.o
-
-LINKFLAGS=-L../../../bin/gcc
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=mpedemux$(EXE)
-LINKFLAGS+=-lgpac_static -lz $(EXTRALIBS)
-#LINKFLAGS+=-lgpac
-else
-EXT=
-PROG=mpedemux
-LINKFLAGS+=-lgpac_static $(EXTRALIBS) $(GPAC_SH_FLAGS) -lz
-#LINKFLAGS+=-lgpac -lz
-endif
-
-
-SRCS := $(OBJS:.o=.c)
-
-all: LIBGPAC $(PROG)
-
-LIBGPAC:
- $(MAKE) -C ../../../src
-
-$(PROG): $(OBJS)
- $(CC) -o ../../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2007-2012
- * All rights reserved
- *
- * This file is part of GPAC / mpedemux application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-#include <gpac/mpegts.h>
-
-typedef struct
-{
- FILE *ts_file;
- GF_M2TS_Demuxer *ts_demux;
-} MPEDemux;
-
-
-static void mpedemux_on_event(GF_M2TS_Demuxer *ts, u32 evt_type, void *param)
-{
- MPEDemux *mpedemux= (MPEDemux *) ts->user;
- switch (evt_type) {
- case GF_M2TS_EVT_PAT_FOUND:
- /* called when the first PAT is fully parsed */
- break;
- case GF_M2TS_EVT_SDT_FOUND:
- /* called when the first SDT is fully parsed */
- break;
- case GF_M2TS_EVT_PMT_FOUND:
- /* called when a first PMT is fully parsed */
- break;
- case GF_M2TS_EVT_INT_FOUND:
- /* called when a first INT is fully parsed */
- /* TODO: create socket for each target in the IP platform */
- break;
- case GF_M2TS_EVT_PAT_UPDATE:
- case GF_M2TS_EVT_PMT_UPDATE:
- case GF_M2TS_EVT_SDT_UPDATE:
- /* called when a new version of the table is parsed */
- break;
- case GF_M2TS_EVT_PES_PCK:
- /* called when a PES packet is parsed */
- break;
- case GF_M2TS_EVT_SL_PCK:
- /* called when an MPEG-4 SL-packet is parsed */
- break;
- case GF_M2TS_EVT_IP_DATAGRAM:
- /* called when an IP packet is parsed
- TODO: send this packet on the right socket */
- break;
- }
-}
-
-static void usage()
-{
- fprintf(stdout, "mpedemux input.ts\n");
-}
-
-int main(int argc, char **argv)
-{
- u8 data[188];
- u32 size;
- MPEDemux *mpedemux;
-
- if (argc < 2) {
- usage();
- return GF_OK;
- }
-
- GF_SAFEALLOC(mpedemux, MPEDemux);
- mpedemux->ts_demux = gf_m2ts_demux_new();
- mpedemux->ts_demux->on_event = mpedemux_on_event;
- mpedemux->ts_demux->user = mpedemux;
-
- mpedemux->ts_file = gf_fopen(argv[1], "rb");
-
- while (1) {
- /*read chunks by chunks*/
- size = fread(data, 1, 188, mpedemux->ts_file);
- if (!size) break;
- /*process chunk*/
- gf_m2ts_process_data(mpedemux->ts_demux, data, size);
- }
-
- gf_m2ts_demux_del(mpedemux->ts_demux);
- gf_free(mpedemux);
- return GF_OK;
-}
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="mpedemux" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
-\r
-CFG=mpedemux - Win32 Debug\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "mpedemux.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "mpedemux.mak" CFG="mpedemux - Win32 Debug"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "mpedemux - Win32 Release" (based on "Win32 (x86) Console Application")\r
-!MESSAGE "mpedemux - Win32 Debug" (based on "Win32 (x86) Console Application")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-RSC=rc.exe\r
-\r
-!IF "$(CFG)" == "mpedemux - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Release"\r
-# PROP BASE Intermediate_Dir "Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD BASE RSC /l 0x40c /d "NDEBUG"\r
-# ADD RSC /l 0x40c /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 zlib.lib winmm.lib ws2_32.lib js32.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/mpedemux.exe" /libpath:"../../../extra_lib/lib/w32_rel"\r
-\r
-!ELSEIF "$(CFG)" == "mpedemux - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "Debug"\r
-# PROP BASE Intermediate_Dir "Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c\r
-# ADD BASE RSC /l 0x40c /d "_DEBUG"\r
-# ADD RSC /l 0x40c /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 zlib.lib winmm.lib ws2_32.lib js32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/mpedemux.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "mpedemux - Win32 Release"\r
-# Name "mpedemux - Win32 Debug"\r
-# Begin Source File\r
-\r
-SOURCE=.\main.c\r
-# End Source File\r
-# End Target\r
-# End Project\r
+++ /dev/null
-#include <gpac/mpegts.h>
-
-u32 dump_pid = 130;
-FILE *dest = NULL;
-Bool has_seen_pat = 0;
-
-void on_m2ts_event(GF_M2TS_Demuxer *ts, u32 evt_type, void *par)
-{
- GF_M2TS_PES_PCK *pck;
- switch (evt_type) {
- case GF_M2TS_EVT_PAT_FOUND:
- fprintf(stdout, "Service connected (PAT found)\n");
- break;
- case GF_M2TS_EVT_PAT_REPEAT:
- has_seen_pat = 1;
- break;
- case GF_M2TS_EVT_PAT_UPDATE:
- fprintf(stdout, "Service connected (PAT found)\n");
- break;
- case GF_M2TS_EVT_PMT_FOUND:
- fprintf(stdout, "Program list found - %d streams\n", gf_list_count( ((GF_M2TS_Program*)par)->streams) );
- break;
- case GF_M2TS_EVT_PMT_UPDATE:
- fprintf(stdout, "Program list updated - %d streams\n", gf_list_count( ((GF_M2TS_Program*)par)->streams) );
- break;
- case GF_M2TS_EVT_SDT_FOUND:
- fprintf(stdout, "Program Description found - %d desc\n", gf_list_count(ts->SDTs) );
- break;
- case GF_M2TS_EVT_SDT_UPDATE:
- fprintf(stdout, "Program Description updated - %d desc\n", gf_list_count(ts->SDTs) );
- break;
- case GF_M2TS_EVT_PES_PCK:
- pck = par;
- if (dest && (dump_pid == pck->stream->pid)) {
- gf_fwrite(pck->data, pck->data_len, 1, dest);
- }
-
- //fprintf(stdout, "PES(%d): DTS "LLD" PTS" LLD" RAP %d size %d\n", pck->stream->pid, pck->DTS, pck->PTS, pck->rap, pck->data_len);
- break;
- }
-}
-
-int main(int argc, char **argv)
-{
- char data[188];
- u32 size, fsize, fdone;
- GF_M2TS_Demuxer *ts;
-
- FILE *src = gf_fopen(argv[1], "rb");
- ts = gf_m2ts_demux_new();
- ts->on_event = on_m2ts_event;
-
- fseek(src, 0, SEEK_END);
- fsize = ftell(src);
- fseek(src, 0, SEEK_SET);
- fdone = 0;
-
- while (!feof(src)) {
- size = fread(data, 1, 188, src);
- if (size<188) break;
-
- gf_m2ts_process_data(ts, data, size);
- if (has_seen_pat) break;
- }
-
- dest = gf_fopen("pes.mp3", "wb");
- gf_m2ts_reset_parsers(ts);
- gf_fseek(src, 0, SEEK_SET);
- fdone = 0;
- while (!feof(src)) {
- size = fread(data, 1, 188, src);
- if (size<188) break;
-
- gf_m2ts_process_data(ts, data, size);
-
- fdone += size;
- gf_set_progress("MPEG-2 TS Parsing", fdone, fsize);
- }
- gf_set_progress("MPEG-2 TS Parsing", fsize, fsize);
-
- gf_fclose(src);
- gf_m2ts_demux_del(ts);
- if (dest) gf_fclose(dest);
- return 0;
-}
-
-
-
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="mpeg2ts" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
-\r
-CFG=mpeg2ts - Win32 Debug\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "mpeg2ts.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "mpeg2ts.mak" CFG="mpeg2ts - Win32 Debug"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "mpeg2ts - Win32 Release" (based on "Win32 (x86) Console Application")\r
-!MESSAGE "mpeg2ts - Win32 Debug" (based on "Win32 (x86) Console Application")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-RSC=rc.exe\r
-\r
-!IF "$(CFG)" == "mpeg2ts - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Release"\r
-# PROP BASE Intermediate_Dir "Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD BASE RSC /l 0x40c /d "NDEBUG"\r
-# ADD RSC /l 0x40c /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-\r
-!ELSEIF "$(CFG)" == "mpeg2ts - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "Debug"\r
-# PROP BASE Intermediate_Dir "Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD BASE RSC /l 0x40c /d "_DEBUG"\r
-# ADD RSC /l 0x40c /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 zlib.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "mpeg2ts - Win32 Release"\r
-# Name "mpeg2ts - Win32 Debug"\r
-# Begin Group "Source Files"\r
-\r
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
-# Begin Source File\r
-\r
-SOURCE=.\main.c\r
-# End Source File\r
-# End Group\r
-# Begin Group "Header Files"\r
-\r
-# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
-# End Group\r
-# Begin Group "Resource Files"\r
-\r
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
-# End Group\r
-# End Target\r
-# End Project\r
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Romain Bouqueau
- * Copyright (c) Romain Bouqueau 2015
- * All rights reserved
- *
- * This file is part of GPAC - sample GPAC player API usage
- *
- */
-
-#include <stdio.h>
-#include <gpac/terminal.h>
-#include <gpac/options.h> //for GF_OPT_* and GF_STATE_*
-
-volatile Bool connected = GF_FALSE;
-
-static Bool play_pause_seek_gettime(GF_Terminal *term, const char *fn)
-{
- u32 time;
- const u32 target_time_in_ms = 10000;
-
- //play
- connected = GF_FALSE;
- gf_term_connect_from_time(term, fn, 0, GF_FALSE);
- while (!connected) gf_sleep(1);
-
- //seek to target_time_in_ms
- gf_term_play_from_time(term, target_time_in_ms, GF_FALSE);
- gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_STEP_PAUSE);
- time = gf_term_get_time_in_ms(term);
- assert(time == target_time_in_ms);
-
- //seek to 0
- connected = GF_FALSE;
- gf_term_play_from_time(term, 0, GF_FALSE);
- while (!connected) gf_sleep(1);
- time = gf_term_get_time_in_ms(term);
- assert(time == 0);
-
- return GF_TRUE;
-}
-
-Bool GPAC_EventProc(void *ptr, GF_Event *evt)
-{
- switch (evt->type) {
- case GF_EVENT_CONNECT:
- connected = GF_TRUE;
- break;
- default:
- break;
- }
-
- return GF_FALSE;
-}
-
-static Bool player_foreach(int argc, char **argv)
-{
- int i;
- GF_User user;
- GF_Terminal *term;
- GF_Config *cfg_file;
- cfg_file = gf_cfg_init("GPAC.cfg", NULL);
- user.modules = gf_modules_new(NULL, cfg_file);
- user.config = cfg_file;
- user.EventProc = GPAC_EventProc;
- term = gf_term_new(&user);
- if (!term)
- return GF_FALSE;
-
- for (i=1; i<argc; ++i) {
- Bool res = play_pause_seek_gettime(term, argv[i]);
- if (res == GF_FALSE) {
- fprintf(stderr, "Failure with input %d: \"%s\"\n", i, argv[i]);
- return GF_FALSE;
- }
- }
-
- gf_term_disconnect(term);
- gf_term_del(term);
- gf_modules_del(user.modules);
- gf_cfg_del(cfg_file);
-
- return GF_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- int ret = 0;
-
- if (argc < 2) {
- fprintf(stderr, "USAGE: %s file1 [file2 ... filen]\n", argv[0]);
- ret = 1;
- goto exit;
- }
-
-#ifdef GPAC_MEMORY_TRACKING
- gf_sys_init(GF_MemTrackerSimple);
-#else
- gf_sys_init(GF_MemTrackerNone);
-#endif
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_WARNING);
-
- if (!player_foreach(argc, argv)) {
- ret = 1;
- goto exit;
- }
-
-exit:
- gf_sys_close();
- return ret;
-}
+++ /dev/null
-include ../../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/testapps/segmp4demux
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= main.o
-
-LINKFLAGS=-L../../../bin/gcc
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=segmp4demux$(EXE)
-else
-EXT=
-PROG=segmp4demux
-endif
-LINKFLAGS+=-lgpac
-
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-#!/bin/sh
-gcc -o fmp4demux main.c ../../../src/utils/os_config_init.c ../../../src/utils/os_divers.c ../../../src/utils/os_file.c ../../../src/utils/os_thread.c ../../../src/utils/alloc.c ../../../src/utils/bitstream.c ../../../src/utils/configfile.c ../../../src/odf/desc_private.c ../../../src/odf/descriptors.c ../../../src/utils/error.c ../../../src/utils/list.c ../../../src/odf/odf_code.c ../../../src/odf/odf_codec.c ../../../src/odf/odf_command.c ../../../src/odf/odf_parse.c ../../../src/odf/slc.c ../../../src/utils/url.c ../../../src/media_tools/webvtt.c ../../../src/isomedia/avc_ext.c ../../../src/isomedia/box_code_3gpp.c ../../../src/isomedia/box_code_adobe.c ../../../src/isomedia/box_code_apple.c ../../../src/isomedia/box_code_base.c ../../../src/isomedia/box_code_drm.c ../../../src/isomedia/box_code_meta.c ../../../src/isomedia/box_funcs.c ../../../src/isomedia/data_map.c ../../../src/isomedia/drm_sample.c ../../../src/isomedia/isom_intern.c ../../../src/isomedia/isom_read.c ../../../src/isomedia/isom_store.c ../../../src/isomedia/isom_write.c ../../../src/isomedia/media.c ../../../src/isomedia/media_odf.c ../../../src/isomedia/meta.c ../../../src/isomedia/movie_fragments.c ../../../src/isomedia/sample_descs.c ../../../src/isomedia/stbl_read.c ../../../src/isomedia/stbl_write.c ../../../src/isomedia/track.c ../../../src/isomedia/tx3g.c -L../../../bin/gcc -lpthread -ldl -I../../../include -DGPAC_MINIMAL_ODF -DGPAC_DISABLE_AV_PARSERS -DGPAC_DISABLE_ISOM_DUMP -DGPAC_DISABLE_ZLIB
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Romain Bouqueau - Cyril Concolato
- * Copyright (c) Romain Bouqueau 2013-
- * Copyright (c) Telecom ParisTech 2013-
- * All rights reserved
- *
- * This file is part of GPAC / sample MP4 demultiplexing application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/tools.h>
-#include <gpac/isomedia.h>
-
-static void process_samples_from_track(GF_ISOFile *movie, u32 track_id, u32 *sample_index)
-{
- u32 track_number;
- u32 sample_count;
- /* Error indicator */
- GF_Err e;
- /* Number of bytes required to finish the current ISO Box reading */
- u64 missing_bytes;
-
- track_number = gf_isom_get_track_by_id(movie, track_id);
- if (track_number == 0) {
- fprintf(stdout, "Could not find track ID=%u. Ignore segment.\n", track_id);
- return;
- }
-
- sample_count = gf_isom_get_sample_count(movie, track_number);
- while (*sample_index <= sample_count) {
- GF_ISOSample *iso_sample;
- u32 sample_description_index;
-
- iso_sample = gf_isom_get_sample(movie, track_number, *sample_index, &sample_description_index);
- if (iso_sample) {
- fprintf(stdout, "Found sample #%5d/%5d of length %8d, RAP: %d, DTS: "LLD", CTS: "LLD"\n", *sample_index, sample_count, iso_sample->dataLength, iso_sample->IsRAP, iso_sample->DTS, iso_sample->DTS+iso_sample->CTS_Offset);
- (*sample_index)++;
-
- /* Release the sample data, once you're done with it*/
- gf_isom_sample_del(&iso_sample);
- } else {
- e = gf_isom_last_error(movie);
- if (e == GF_ISOM_INCOMPLETE_FILE) {
- missing_bytes = gf_isom_get_missing_bytes(movie, track_number);
- fprintf(stdout, "Missing "LLU" bytes on input file\n", missing_bytes);
- gf_sleep(1000);
- }
- }
- }
-}
-
-int main(int argc, char **argv)
-{
- /* The ISO progressive reader */
- GF_ISOFile *movie;
- /* Error indicator */
- GF_Err e;
- /* Number of bytes required to finish the current ISO Box reading */
- u64 missing_bytes;
- /* Return value for the program */
- int ret = 0;
- /* Maximum index of the segments*/
- u32 seg_max = argc-2;
- /* Number of the segment being processed*/
- u32 seg_curr = 0;
- u32 track_id = 1;
- u32 sample_index = 1;
-
- /* Usage */
- if (argc < 2) {
- fprintf(stdout, "Usage: %s filename0 [filename1 filename2 ...]\n", argv[0]);
- return 1;
- }
-
-#if defined(DEBUG) || defined(_DEBUG)
- /* Enables GPAC memory tracking in debug mode only */
- gf_sys_init(GF_MemTrackerSimple);
- gf_log_set_tool_level(GF_LOG_CONTAINER, GF_LOG_INFO);
- gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
-#endif
-
- /* First or init segment */
- fprintf(stdout, "Process segment %5d/%5d: %s\n", seg_curr, seg_max, argv[seg_curr+1]);
- e = gf_isom_open_progressive(argv[seg_curr+1], 0, 0, &movie, &missing_bytes);
- if ((e != GF_OK && e != GF_ISOM_INCOMPLETE_FILE) || movie == NULL) {
- fprintf(stdout, "Could not open file %s for reading (%s).\n", argv[seg_curr+1], gf_error_to_string(e));
- return 1;
- }
- process_samples_from_track(movie, track_id, &sample_index);
- seg_curr++;
-
- /* Process segments */
- while (seg_curr <= seg_max) {
- fprintf(stdout, "Process segment %5d/%5d: %s\n", seg_curr, seg_max, argv[seg_curr+1]);
-
- /* Open the segment */
- e = gf_isom_open_segment(movie, argv[seg_curr+1], 0, 0, GF_FALSE);
- if (e != GF_OK) {
- fprintf(stdout, "Could not open segment %s for reading (%s).\n", argv[seg_curr+1], gf_error_to_string(e));
- ret = 1;
- goto exit;
- }
-
- /* Process the segment */
- process_samples_from_track(movie, track_id, &sample_index);
-
- /* Release the segment */
- gf_isom_release_segment(movie, 1);
-
- seg_curr++;
- }
-
-exit:
- fprintf(stdout, "Total nb Samples: %d\n", gf_isom_get_sample_count(movie, gf_isom_get_track_by_id(movie, track_id) ) );
- gf_isom_release_segment(movie, 1);
- gf_isom_close(movie);
-#if defined(DEBUG) || defined(_DEBUG)
- /* Closes GPAC memory tracking in debug mode only */
- gf_sys_close();
-#endif
-
- return ret;
-}
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual Studio 2010\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segmp4demux", "segmp4demux.vcxproj", "{978A2D9F-E44F-4073-8032-333563BCC160}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Win32 = Debug|Win32\r
- Release|Win32 = Release|Win32\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.Build.0 = Debug|Win32\r
- {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.ActiveCfg = Release|Win32\r
- {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.Build.0 = Release|Win32\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\..\src\isomedia\avc_ext.c">\r
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_3gpp.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_adobe.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_apple.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_base.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_drm.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_code_meta.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\box_funcs.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\data_map.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\drm_sample.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\isom_intern.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\isom_read.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\isom_store.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\isom_write.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\media.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\media_odf.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\meta.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\movie_fragments.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\sample_descs.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\stbl_read.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\stbl_write.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\track.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\ttml.c" />\r
- <ClCompile Include="..\..\..\src\isomedia\tx3g.c" />\r
- <ClCompile Include="..\..\..\src\media_tools\webvtt.c" />\r
- <ClCompile Include="..\..\..\src\odf\descriptors.c" />\r
- <ClCompile Include="..\..\..\src\odf\desc_private.c" />\r
- <ClCompile Include="..\..\..\src\odf\odf_code.c" />\r
- <ClCompile Include="..\..\..\src\odf\odf_codec.c" />\r
- <ClCompile Include="..\..\..\src\odf\odf_command.c" />\r
- <ClCompile Include="..\..\..\src\odf\odf_parse.c" />\r
- <ClCompile Include="..\..\..\src\odf\slc.c" />\r
- <ClCompile Include="..\..\..\src\utils\alloc.c" />\r
- <ClCompile Include="..\..\..\src\utils\bitstream.c" />\r
- <ClCompile Include="..\..\..\src\utils\configfile.c" />\r
- <ClCompile Include="..\..\..\src\utils\error.c" />\r
- <ClCompile Include="..\..\..\src\utils\list.c" />\r
- <ClCompile Include="..\..\..\src\utils\os_divers.c" />\r
- <ClCompile Include="..\..\..\src\utils\os_file.c" />\r
- <ClCompile Include="..\..\..\src\utils\os_thread.c" />\r
- <ClCompile Include="..\..\..\src\utils\url.c" />\r
- <ClCompile Include="main.c" />\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{365CEAE9-305B-43C9-B531-904E500F0809}</ProjectGuid>\r
- <ProjectName>segmp4demux</ProjectName>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <PlatformToolset>v110</PlatformToolset>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <PlatformToolset>v100</PlatformToolset>\r
- <UseOfMfc>false</UseOfMfc>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>11.0.60610.1</_ProjectFileVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir>obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental>true</LinkIncremental>\r
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules />\r
- <CodeAnalysisRuleAssemblies />\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- <IntDir>obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>\r
- <LinkIncremental>false</LinkIncremental>\r
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules />\r
- <CodeAnalysisRuleAssemblies />\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Midl>\r
- <TypeLibraryName>.\Debug/segmp4demux.tlb</TypeLibraryName>\r
- <HeaderFileName />\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZLIB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeaderOutputFile>\r
- </PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
- <ObjectFileName>$(IntDir)</ObjectFileName>\r
- <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>\r
- <BrowseInformation>true</BrowseInformation>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <UndefinePreprocessorDefinitions>\r
- </UndefinePreprocessorDefinitions>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>$(OutDir);../../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>.\Debug/segmp4demux.bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Midl>\r
- <TypeLibraryName>.\Release/segmp4demux.tlb</TypeLibraryName>\r
- <HeaderFileName />\r
- </Midl>\r
- <ClCompile>\r
- <Optimization>MaxSpeed</Optimization>\r
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
- <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_CORE_TOOLS;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <PrecompiledHeaderOutputFile>.\Release/segmp4demux.pch</PrecompiledHeaderOutputFile>\r
- <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
- <ObjectFileName>.\Release/</ObjectFileName>\r
- <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
- <WarningLevel>Level3</WarningLevel>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- </ClCompile>\r
- <ResourceCompile>\r
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <Culture>0x040c</Culture>\r
- </ResourceCompile>\r
- <Link>\r
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <AdditionalLibraryDirectories>../../../extra_lib/lib/w32_rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <ProgramDatabaseFile>.\Release/segmp4demux.pdb</ProgramDatabaseFile>\r
- <SubSystem>Console</SubSystem>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- <Bscmake>\r
- <SuppressStartupBanner>true</SuppressStartupBanner>\r
- <OutputFile>.\Release/segmp4demux.bsc</OutputFile>\r
- </Bscmake>\r
- </ItemDefinitionGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <ClCompile Include="..\..\..\src\isomedia\avc_ext.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_3gpp.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_adobe.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_apple.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_base.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_drm.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_code_meta.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\box_funcs.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\data_map.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\drm_sample.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\isom_intern.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\isom_read.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\isom_store.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\isom_write.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\media.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\media_odf.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\meta.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\movie_fragments.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\sample_descs.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\stbl_read.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\stbl_write.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\track.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\tx3g.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\bitstream.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\error.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\list.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\desc_private.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\descriptors.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\odf_code.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\odf_codec.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\odf_command.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\odf_parse.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\media_tools\webvtt.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="main.c" />
- <ClCompile Include="..\..\..\src\utils\url.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\odf\slc.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\alloc.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\configfile.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\os_divers.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\os_thread.c">
- <Filter>others</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\isomedia\ttml.c">
- <Filter>isoff</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\utils\os_file.c">
- <Filter>others</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <Filter Include="isoff">
- <UniqueIdentifier>{c9a8f639-328c-4505-be50-4859357c2c00}</UniqueIdentifier>
- </Filter>
- <Filter Include="others">
- <UniqueIdentifier>{e5ca7285-ca00-49d8-ac81-dff3d494be9a}</UniqueIdentifier>
- </Filter>
- </ItemGroup>
-</Project>
\ No newline at end of file
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Cyril COncolato
- * Copyright (c) Telecom ParisTech 2006-2012
- * All rights reserved
- *
- * This file is part of GPAC / svg2bifs application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/scene_manager.h>
-#include <gpac/xml.h>
-#include <gpac/internal/scenegraph_dev.h>
-#include <gpac/nodes_svg.h>
-#include <gpac/nodes_mpeg4.h>
-
-typedef struct {
- GF_SAXParser *sax_parser;
-
- GF_SceneGraph *svg_sg;
- GF_Node *svg_parent;
- SVGAllAttributes all_atts;
- SVGPropertiesPointers svg_props;
-
- GF_SceneGraph *bifs_sg;
- GF_Node *bifs_parent;
- GF_Node *bifs_text_node;
-
- Bool force_transform;
-
-} SVG2BIFS_Converter;
-
-
-typedef struct {
- /* Stage of the resolving:
- 0: resolving attributes which depends on the target: from, to, by, values, type
- 1: resolving begin times
- 2: resolving end times */
- u32 resolve_stage;
- /* Animation element being deferred */
- SVG_Element *animation_elt;
- /* anim parent*/
- SVG_Element *anim_parent;
- /* target animated element*/
- SVG_Element *target;
- /* id of the target element when unresolved*/
- char *target_id;
-
- /* attributes which cannot be parsed until the type of the target attribute is known */
- char *type; /* only for animateTransform */
- char *to;
- char *from;
- char *by;
- char *values;
-} SVG_DeferredAnimation;
-
-
-static GF_Node *create_appearance(SVGPropertiesPointers *svg_props, GF_SceneGraph *sg)
-{
- M_Appearance *app;
- M_Material2D *mat;
- M_XLineProperties *xlp;
-/* M_RadialGradient *rg;
- M_LinearGradient *lg;
-*/
- app = (M_Appearance *)gf_node_new(sg, TAG_MPEG4_Appearance);
-
- app->material = gf_node_new(sg, TAG_MPEG4_Material2D);
- mat = (M_Material2D *)app->material;
- gf_node_register((GF_Node*)mat, (GF_Node*)app);
-
- if (svg_props->fill->type == SVG_PAINT_NONE) {
- mat->filled = 0;
- } else {
- mat->filled = 1;
- if (svg_props->fill->type == SVG_PAINT_COLOR) {
- if (svg_props->fill->color.type == SVG_COLOR_RGBCOLOR) {
- mat->emissiveColor.red = svg_props->fill->color.red;
- mat->emissiveColor.green = svg_props->fill->color.green;
- mat->emissiveColor.blue = svg_props->fill->color.blue;
- } else if (svg_props->fill->color.type == SVG_COLOR_CURRENTCOLOR) {
- mat->emissiveColor.red = svg_props->color->color.red;
- mat->emissiveColor.green = svg_props->color->color.green;
- mat->emissiveColor.blue = svg_props->color->color.blue;
- } else {
- /* WARNING */
- mat->emissiveColor.red = 0;
- mat->emissiveColor.green = 0;
- mat->emissiveColor.blue = 0;
- }
- } else { // SVG_PAINT_URI
- /* TODO: gradient or solidcolor */
- }
- }
-
- mat->transparency = FIX_ONE - svg_props->fill_opacity->value;
-
- if (svg_props->stroke->type != SVG_PAINT_NONE &&
- svg_props->stroke_width->value != 0) {
- mat->lineProps = gf_node_new(sg, TAG_MPEG4_XLineProperties);
- xlp = (M_XLineProperties *)mat->lineProps;
- gf_node_register((GF_Node*)xlp, (GF_Node*)mat);
-
- xlp->width = svg_props->stroke_width->value;
-
- if (svg_props->stroke->type == SVG_PAINT_COLOR) {
- if (svg_props->stroke->color.type == SVG_COLOR_RGBCOLOR) {
- xlp->lineColor.red = svg_props->stroke->color.red;
- xlp->lineColor.green = svg_props->stroke->color.green;
- xlp->lineColor.blue = svg_props->stroke->color.blue;
- } else if (svg_props->stroke->color.type == SVG_COLOR_CURRENTCOLOR) {
- xlp->lineColor.red = svg_props->color->color.red;
- xlp->lineColor.green = svg_props->color->color.green;
- xlp->lineColor.blue = svg_props->color->color.blue;
- } else {
- /* WARNING */
- xlp->lineColor.red = 0;
- xlp->lineColor.green = 0;
- xlp->lineColor.blue = 0;
- }
- } else { // SVG_PAINT_URI
- /* TODO: xlp->texture = ... */
- }
- xlp->transparency = FIX_ONE - svg_props->stroke_opacity->value;
- xlp->lineCap = *svg_props->stroke_linecap;
- xlp->lineJoin = *svg_props->stroke_linejoin;
- if (svg_props->stroke_dasharray->type == SVG_STROKEDASHARRAY_ARRAY) {
- u32 i;
- xlp->lineStyle = 6;
- gf_sg_vrml_mf_alloc(&xlp->dashes, GF_SG_VRML_MFFLOAT, svg_props->stroke_dasharray->array.count);
- for (i = 0; i < svg_props->stroke_dasharray->array.count; i++) {
- xlp->dashes.vals[i] = svg_props->stroke_dasharray->array.vals[i] / svg_props->stroke_width->value;
- }
- }
- xlp->miterLimit = svg_props->stroke_miterlimit->value;
- }
-
- return (GF_Node*)app;
-}
-
-
-
-static GF_Node *add_transform_matrix(SVG2BIFS_Converter *converter, GF_Node *node)
-{
- M_TransformMatrix2D *tr = (M_TransformMatrix2D*)gf_node_new(converter->bifs_sg, TAG_MPEG4_TransformMatrix2D);
- gf_node_register((GF_Node *)tr, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, (GF_Node *)tr);
- if (converter->all_atts.transform) {
- SVG_Transform *svg_tr = converter->all_atts.transform;
- tr->mxx = svg_tr->mat.m[0];
- tr->mxy = svg_tr->mat.m[1];
- tr->tx = svg_tr->mat.m[2];
- tr->myx = svg_tr->mat.m[3];
- tr->myy = svg_tr->mat.m[4];
- tr->ty = svg_tr->mat.m[5];
- }
- return (GF_Node *)tr;
-
-}
-
-static GF_Node *add_transform2d(SVG2BIFS_Converter *converter, GF_Node *node)
-{
- M_Transform2D *tr = (M_Transform2D*)gf_node_new(converter->bifs_sg, TAG_MPEG4_Transform2D);
- gf_node_register((GF_Node *)tr, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, (GF_Node *)tr);
- return (GF_Node *)tr;
-}
-
-static void svg_parse_animation(GF_SceneGraph *sg, SVG_DeferredAnimation *anim)
-{
- GF_FieldInfo info;
- u32 tag;
- u8 anim_value_type = 0;
-
- if (anim->resolve_stage==0) {
- /* Stage 0: parsing the animation attribute values
- for that we need to resolve the target first */
- if (!anim->target)
- anim->target = (SVG_Element *) gf_sg_find_node_by_name(sg, anim->target_id + 1);
-
- if (!anim->target) {
- /* the target is still not known stay in stage 0 */
- return;
- } else {
- XMLRI *iri;
- gf_node_get_attribute_by_tag((GF_Node *)anim->animation_elt, TAG_XLINK_ATT_href, 1, 0, &info);
- iri = (XMLRI *)info.far_ptr;
- iri->type = XMLRI_ELEMENTID;
- iri->target = anim->target;
- gf_node_register_iri(sg, iri);
- }
-
- tag = gf_node_get_tag((GF_Node *)anim->animation_elt);
- /* get the attribute name attribute if specified */
- if (anim->type && (tag== TAG_SVG_animateTransform) ) {
- gf_node_get_attribute_by_tag((GF_Node *)anim->animation_elt, TAG_SVG_ATT_transform_type, 1, 0, &info);
- gf_svg_parse_attribute((GF_Node *)anim->animation_elt, &info, anim->type, 0);
- switch(*(SVG_TransformType *) info.far_ptr) {
- case SVG_TRANSFORM_TRANSLATE:
- anim_value_type = SVG_Transform_Translate_datatype;
- break;
- case SVG_TRANSFORM_SCALE:
- anim_value_type = SVG_Transform_Scale_datatype;
- break;
- case SVG_TRANSFORM_ROTATE:
- anim_value_type = SVG_Transform_Rotate_datatype;
- break;
- case SVG_TRANSFORM_SKEWX:
- anim_value_type = SVG_Transform_SkewX_datatype;
- break;
- case SVG_TRANSFORM_SKEWY:
- anim_value_type = SVG_Transform_SkewY_datatype;
- break;
- case SVG_TRANSFORM_MATRIX:
- anim_value_type = SVG_Transform_datatype;
- break;
- default:
- fprintf(stdout, "unknown datatype for animate transform");
- return;
- }
- }
- else if (gf_node_get_attribute_by_tag((GF_Node *)anim->animation_elt, TAG_SVG_ATT_attributeName, 0, 0, &info) == GF_OK) {
- gf_node_get_attribute_by_name((GF_Node *)anim->target, ((SMIL_AttributeName *)info.far_ptr)->name, 0, 1, 1, &info);
- anim_value_type = info.fieldType;
- } else {
- if (tag == TAG_SVG_animateMotion) {
- anim_value_type = SVG_Motion_datatype;
- } else if (tag == TAG_SVG_discard) {
- /* there is no value to parse in discard, we can jump to the next stage */
- anim->resolve_stage = 1;
- svg_parse_animation(sg, anim);
- return;
- } else {
- fprintf(stdout, "Missing attributeName attribute on %s", gf_node_get_name((GF_Node *)anim->animation_elt));
- return;
- }
- }
-
- if (anim->to) {
- gf_node_get_attribute_by_tag((GF_Node *)anim->animation_elt, TAG_SVG_ATT_to, 1, 0, &info);
- gf_svg_parse_attribute((GF_Node *)anim->animation_elt, &info, anim->to, anim_value_type);
- }
- if (anim->from) {
- gf_node_get_attribute_by_tag((GF_Node *)anim->animation_elt, TAG_SVG_ATT_from, 1, 0, &info);
- gf_svg_parse_attribute((GF_Node *)anim->animation_elt, &info, anim->from, anim_value_type);
- }
- if (anim->by) {
- gf_node_get_attribute_by_tag((GF_Node *)anim->animation_elt, TAG_SVG_ATT_by, 1, 0, &info);
- gf_svg_parse_attribute((GF_Node *)anim->animation_elt, &info, anim->by, anim_value_type);
- }
- if (anim->values) {
- gf_node_get_attribute_by_tag((GF_Node *)anim->animation_elt, TAG_SVG_ATT_values, 1, 0, &info);
- gf_svg_parse_attribute((GF_Node *)anim->animation_elt, &info, anim->values, anim_value_type);
- }
- anim->resolve_stage = 1;
- }
-}
-
-
-static void svg2bifs_node_start(void *sax_cbck, const char *name, const char *name_space, const GF_XMLAttribute *attributes, u32 nb_attributes)
-{
- u32 i;
- SVG2BIFS_Converter *converter = (SVG2BIFS_Converter *)sax_cbck;
- SVGPropertiesPointers *backup_props;
- char *id_string = NULL;
- u32 tag;
- SVG_Element *elt;
- SVG_DeferredAnimation *anim = NULL;
-
- tag = gf_xml_get_element_tag(name, 0);
- elt = (SVG_Element*)gf_node_new(converter->svg_sg, tag);
- if (!gf_sg_get_root_node(converter->svg_sg)) {
- gf_node_register((GF_Node *)elt, NULL);
- gf_sg_set_root_node(converter->svg_sg, (GF_Node *)elt);
- } else {
- gf_node_register((GF_Node *)elt, converter->svg_parent);
- //gf_node_list_add_child(&((GF_ParentNode*)converter->svg_parent)->children, (GF_Node *)elt);
- }
-
-// fprintf(stdout, "Converting %s\n", gf_node_get_class_name((GF_Node *)elt));
-// if (converter->bifs_parent) fprintf(stdout, "%s\n", gf_node_get_class_name(converter->bifs_parent));
-
- if (gf_svg_is_animation_tag(tag)) {
- GF_SAFEALLOC(anim, SVG_DeferredAnimation);
- /*default anim target is parent node*/
- anim->animation_elt = elt;
- if (converter->svg_parent) {
- anim->target = anim->anim_parent = (SVG_Element*) converter->svg_parent;
- }
- }
-
- for (i=0; i<nb_attributes; i++) {
- GF_XMLAttribute *att = (GF_XMLAttribute *)&attributes[i];
- if (!att->value || !strlen(att->value)) continue;
-
- if (!stricmp(att->name, "style")) {
- gf_svg_parse_style((GF_Node *)elt, att->value);
- } else if (!stricmp(att->name, "id") || !stricmp(att->name, "xml:id")) {
- gf_svg_parse_element_id((GF_Node *)elt, att->value, 0);
- id_string = att->value;
- } else if (anim && !stricmp(att->name, "to")) {
- anim->to = gf_strdup(att->value);
- } else if (anim && !stricmp(att->name, "from")) {
- anim->from = gf_strdup(att->value);
- } else if (anim && !stricmp(att->name, "by")) {
- anim->by = gf_strdup(att->value);
- } else if (anim && !stricmp(att->name, "values")) {
- anim->values = gf_strdup(att->value);
- } else if (anim && (tag == TAG_SVG_animateTransform) && !stricmp(att->name, "type")) {
- anim->type = gf_strdup(att->value);
- } else {
- GF_FieldInfo info;
- if (gf_node_get_field_by_name((GF_Node *)elt, att->name, &info)==GF_OK) {
- gf_svg_parse_attribute((GF_Node *)elt, &info, att->value, 0);
- } else {
- fprintf(stdout, "Skipping attribute %s\n", att->name);
- }
- }
- }
-
- if (anim) {
- svg_parse_animation(converter->svg_sg, anim);
- }
-
- memset(&converter->all_atts, 0, sizeof(SVGAllAttributes));
- gf_svg_flatten_attributes(elt, &converter->all_atts);
-
- backup_props = gf_malloc(sizeof(SVGPropertiesPointers));
- memcpy(backup_props, &converter->svg_props, sizeof(SVGPropertiesPointers));
- gf_node_set_private((GF_Node *)elt, backup_props);
-
- gf_svg_apply_inheritance(&converter->all_atts, &converter->svg_props);
-
- fprintf(stdout, "START\t%s\t%s\t%s", converter->svg_parent ? gf_node_get_class_name(converter->svg_parent) : "none", converter->bifs_parent ? gf_node_get_class_name(converter->bifs_parent) : "none", name);
- converter->svg_parent = (GF_Node *)elt;
- if (!gf_sg_get_root_node(converter->bifs_sg)) {
- if (tag == TAG_SVG_svg) {
- GF_Node *node, *child;
-
- converter->bifs_sg->usePixelMetrics = 1;
- if (converter->all_atts.width && converter->all_atts.width->type == SVG_NUMBER_VALUE) {
- converter->bifs_sg->width = FIX2INT(converter->all_atts.width->value);
- } else {
- converter->bifs_sg->width = 320;
- }
- if (converter->all_atts.height && converter->all_atts.height->type == SVG_NUMBER_VALUE) {
- converter->bifs_sg->height = FIX2INT(converter->all_atts.height->value);
- } else {
- converter->bifs_sg->height = 200;
- }
-
- node = gf_node_new(converter->bifs_sg, TAG_MPEG4_OrderedGroup);
- gf_node_register(node, NULL);
- gf_sg_set_root_node(converter->bifs_sg, node);
-
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_QuantizationParameter);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- {
- M_QuantizationParameter *qp = (M_QuantizationParameter *)child;
- qp->useEfficientCoding = 1;
- }
-
- /* SVG to BIFS coordinate transformation */
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Viewport);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- {
- M_Viewport *vp = (M_Viewport*)child;
- if (converter->all_atts.viewBox) {
- vp->size.x = converter->all_atts.viewBox->width;
- vp->size.y = converter->all_atts.viewBox->height;
- vp->position.x = converter->all_atts.viewBox->x+converter->all_atts.viewBox->width/2;
- vp->position.y = -(converter->all_atts.viewBox->y+converter->all_atts.viewBox->height/2);
- } else {
- vp->size.x = INT2FIX(converter->bifs_sg->width);
- vp->size.y = INT2FIX(converter->bifs_sg->height);
- vp->position.x = INT2FIX(converter->bifs_sg->width)/2;
- vp->position.y = -INT2FIX(converter->bifs_sg->height)/2;
- }
- }
-
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Background2D);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- {
- M_Background2D *b = (M_Background2D *)child;
- b->backColor.red = FIX_ONE;
- b->backColor.green = FIX_ONE;
- b->backColor.blue = FIX_ONE;
- }
-
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Transform2D);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- {
- M_Transform2D *tr = (M_Transform2D *)node;
- tr->scale.y = -FIX_ONE;
- }
- converter->bifs_parent = node;
- }
- } else {
- GF_Node *node, *child;
-
- node = converter->bifs_parent;
-
- switch(tag) {
- case TAG_SVG_g:
- {
- if (converter->all_atts.transform) {
- node = add_transform_matrix(converter, node);
- converter->bifs_parent = node;
- } else {
- M_Group *g = (M_Group*)gf_node_new(converter->bifs_sg, TAG_MPEG4_Group);
- gf_node_register((GF_Node *)g, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, (GF_Node *)g);
- node = (GF_Node *)g;
- converter->bifs_parent = node;
- }
- }
- break;
- case TAG_SVG_rect:
- {
- Bool is_parent_set = 0;
- if (converter->all_atts.transform) {
- node = add_transform_matrix(converter, node);
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- if (converter->force_transform) {
- node = add_transform2d(converter, node);
- if (!is_parent_set) {
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- }
- if (converter->all_atts.x || converter->all_atts.y) {
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Transform2D);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- if (!is_parent_set) {
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- {
- M_Transform2D *tr = (M_Transform2D *)node;
- if (converter->all_atts.x) tr->translation.x = converter->all_atts.x->value + (converter->all_atts.width?converter->all_atts.width->value/2:0);
- if (converter->all_atts.y) tr->translation.y = converter->all_atts.y->value + (converter->all_atts.height?converter->all_atts.height->value/2:0);
- }
- }
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Shape);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- if (!is_parent_set) converter->bifs_parent = node;
- {
- M_Shape *shape = (M_Shape *)node;
- shape->geometry = gf_node_new(converter->bifs_sg, TAG_MPEG4_Rectangle);
- gf_node_register(shape->geometry, (GF_Node *)shape);
- {
- M_Rectangle *rect = (M_Rectangle *)shape->geometry;
- if (converter->all_atts.width) rect->size.x = converter->all_atts.width->value;
- if (converter->all_atts.height) rect->size.y = converter->all_atts.height->value;
- }
-
- shape->appearance = create_appearance(&converter->svg_props, converter->bifs_sg);
- gf_node_register(shape->appearance, (GF_Node *)shape);
- }
- }
- break;
- case TAG_SVG_path:
- {
- Bool is_parent_set = 0;
- if (converter->all_atts.transform) {
- node = add_transform_matrix(converter, node);
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- if (converter->force_transform) {
- node = add_transform2d(converter, node);
- if (!is_parent_set) {
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- }
- if (converter->all_atts.x || converter->all_atts.y) {
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Transform2D);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- if (!is_parent_set) {
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- {
- M_Transform2D *tr = (M_Transform2D *)node;
- if (converter->all_atts.x) tr->translation.x = converter->all_atts.x->value;
- if (converter->all_atts.y) tr->translation.y = converter->all_atts.y->value;
- }
- }
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Shape);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- if (!is_parent_set) converter->bifs_parent = node;
- {
- M_Shape *shape = (M_Shape *)node;
- shape->geometry = gf_node_new(converter->bifs_sg, TAG_MPEG4_XCurve2D);
- gf_node_register(shape->geometry, (GF_Node *)shape);
- if (converter->all_atts.d) {
- M_Coordinate2D *c2d;
- M_XCurve2D *xc = (M_XCurve2D *)shape->geometry;
- u32 j, c, k;
-
- xc->point = gf_node_new(converter->bifs_sg, TAG_MPEG4_Coordinate2D);
- c2d = (M_Coordinate2D *)xc->point;
- gf_node_register(xc->point, (GF_Node *)xc);
-
- gf_sg_vrml_mf_alloc(&c2d->point, GF_SG_VRML_MFVEC2F, converter->all_atts.d->n_points);
- gf_sg_vrml_mf_alloc(&xc->type, GF_SG_VRML_MFINT32, converter->all_atts.d->n_points);
-
- c = 0;
- k = 0;
- j = 0;
- c2d->point.vals[k] = converter->all_atts.d->points[0];
- k++;
- xc->type.vals[0] = 0;
- for (i = 1; i < converter->all_atts.d->n_points; ) {
- switch(converter->all_atts.d->tags[i]) {
- case GF_PATH_CURVE_ON:
- c2d->point.vals[k] = converter->all_atts.d->points[i];
- k++;
-
- if (i-1 == converter->all_atts.d->contours[c]) {
- xc->type.vals[j] = 0;
- c++;
- } else {
- xc->type.vals[j] = 1;
- }
- i++;
- break;
- case GF_PATH_CURVE_CUBIC:
- c2d->point.vals[k] = converter->all_atts.d->points[i];
- c2d->point.vals[k+1] = converter->all_atts.d->points[i+1];
- c2d->point.vals[k+2] = converter->all_atts.d->points[i+2];
- k+=3;
-
- xc->type.vals[j] = 2;
- if (converter->all_atts.d->tags[i+2]==GF_PATH_CLOSE) {
- j++;
- xc->type.vals[j] = 6;
- }
- i+=3;
- break;
- case GF_PATH_CLOSE:
- xc->type.vals[j] = 6;
- i++;
- break;
- case GF_PATH_CURVE_CONIC:
- c2d->point.vals[k] = converter->all_atts.d->points[i];
- c2d->point.vals[k+1] = converter->all_atts.d->points[i+1];
- k+=2;
-
- xc->type.vals[j] = 7;
- if (converter->all_atts.d->tags[i+1]==GF_PATH_CLOSE) {
- j++;
- xc->type.vals[j] = 6;
- }
- i+=2;
- break;
- }
- j++;
- }
- xc->type.count = j;
- c2d->point.count = k;
- }
-
- shape->appearance = create_appearance(&converter->svg_props, converter->bifs_sg);
- gf_node_register(shape->appearance, (GF_Node *)shape);
- }
- }
- break;
- case TAG_SVG_polyline:
- {
- Bool is_parent_set = 0;
- if (converter->all_atts.transform) {
- node = add_transform_matrix(converter, node);
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- if (converter->force_transform) {
- node = add_transform2d(converter, node);
- if (!is_parent_set) {
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- }
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Shape);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- if (!is_parent_set) converter->bifs_parent = node;
- {
- M_Shape *shape = (M_Shape *)node;
- shape->geometry = gf_node_new(converter->bifs_sg, TAG_MPEG4_IndexedFaceSet2D);
- gf_node_register(shape->geometry, (GF_Node *)shape);
- if (converter->all_atts.points) {
- M_Coordinate2D *c2d;
- M_IndexedFaceSet2D *ifs = (M_IndexedFaceSet2D *)shape->geometry;
-
- ifs->coord = gf_node_new(converter->bifs_sg, TAG_MPEG4_Coordinate2D);
- c2d = (M_Coordinate2D *)ifs->coord;
- gf_node_register(ifs->coord, (GF_Node *)ifs);
-
- gf_sg_vrml_mf_alloc(&c2d->point, GF_SG_VRML_MFVEC2F, gf_list_count(*converter->all_atts.points));
- for (i = 0; i < gf_list_count(*converter->all_atts.points); i++) {
- SVG_Point *p = (SVG_Point *)gf_list_get(*converter->all_atts.points, i);
- c2d->point.vals[i].x = p->x;
- c2d->point.vals[i].y = p->y;
- }
- }
-
- shape->appearance = create_appearance(&converter->svg_props, converter->bifs_sg);
- gf_node_register(shape->appearance, (GF_Node *)shape);
- }
- }
- break;
- case TAG_SVG_text:
- {
- Bool is_parent_set = 0;
- if (converter->all_atts.transform) {
- node = add_transform_matrix(converter, node);
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- if (converter->force_transform) {
- node = add_transform2d(converter, node);
- if (!is_parent_set) {
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- }
-
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Transform2D);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- {
- M_Transform2D *tr = (M_Transform2D *)child;
- if (converter->all_atts.text_x) tr->translation.x = ((SVG_Coordinate *)gf_list_get(*converter->all_atts.text_x, 0))->value;
- if (converter->all_atts.text_y) tr->translation.y = ((SVG_Coordinate *)gf_list_get(*converter->all_atts.text_y, 0))->value;
- tr->scale.y = -FIX_ONE;
- }
- node = child;
- child = NULL;
- if (!is_parent_set) {
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
-
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Shape);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- if (!is_parent_set) converter->bifs_parent = node;
- {
- M_FontStyle *fs;
- M_Text *text;
- M_Shape *shape = (M_Shape *)node;
- text = (M_Text *)gf_node_new(converter->bifs_sg, TAG_MPEG4_Text);
- shape->geometry = (GF_Node *)text;
- converter->bifs_text_node = shape->geometry;
- gf_node_register(shape->geometry, (GF_Node *)shape);
-
- fs = (M_FontStyle *)gf_node_new(converter->bifs_sg, TAG_MPEG4_XFontStyle);
- gf_node_register((GF_Node *)fs, (GF_Node*)text);
- text->fontStyle = (GF_Node *)fs;
-
- gf_sg_vrml_mf_alloc(&fs->family, GF_SG_VRML_MFSTRING, 1);
- fs->family.vals[0] = gf_strdup(converter->svg_props.font_family->value);
- fs->size = converter->svg_props.font_size->value;
-
- shape->appearance = create_appearance(&converter->svg_props, converter->bifs_sg);
- gf_node_register(shape->appearance, (GF_Node *)shape);
- }
- }
- break;
- case TAG_SVG_ellipse:
- case TAG_SVG_circle:
- {
- Bool is_parent_set = 0;
- if (converter->all_atts.transform) {
- node = add_transform_matrix(converter, node);
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- if (converter->force_transform) {
- node = add_transform2d(converter, node);
- if (!is_parent_set) {
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- }
- if (converter->all_atts.cx || converter->all_atts.cy) {
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Transform2D);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- {
- M_Transform2D *tr = (M_Transform2D *)child;
- if (converter->all_atts.cx) tr->translation.x = converter->all_atts.cx->value;
- if (converter->all_atts.cy) tr->translation.y = converter->all_atts.cy->value;
- }
- node = child;
- child = NULL;
- if (!is_parent_set) {
- converter->bifs_parent = node;
- is_parent_set = 1;
- }
- }
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Shape);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- if (!is_parent_set) converter->bifs_parent = node;
- {
- M_Shape *shape = (M_Shape *)node;
- if (tag == TAG_SVG_ellipse) {
- M_Ellipse *e = (M_Ellipse *)gf_node_new(converter->bifs_sg, TAG_MPEG4_Ellipse);
- shape->geometry = (GF_Node *)e;
- e->radius.x = converter->all_atts.rx->value;
- e->radius.y = converter->all_atts.ry->value;
- } else {
- M_Circle *c = (M_Circle *)gf_node_new(converter->bifs_sg, TAG_MPEG4_Circle);
- shape->geometry = (GF_Node *)c;
- c->radius = converter->all_atts.r->value;
- }
- gf_node_register(shape->geometry, (GF_Node *)shape);
-
- shape->appearance = create_appearance(&converter->svg_props, converter->bifs_sg);
- gf_node_register(shape->appearance, (GF_Node *)shape);
- }
- }
- break;
-
- case TAG_SVG_defs:
- {
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Switch);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- {
- M_Switch *sw = (M_Switch *)node;
- sw->whichChoice = -1;
- }
- converter->bifs_parent = node;
- }
- break;
- case TAG_SVG_solidColor:
- {
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Shape);
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- converter->bifs_parent = node;
- }
- break;
- case TAG_SVG_animateTransform:
- {
- GF_Node *child_ts;
- if (!gf_node_get_id(node)) {
- gf_node_set_id(node, gf_sg_get_next_available_node_id(converter->bifs_sg), NULL);
- }
-
- child_ts = gf_node_new(converter->bifs_sg, TAG_MPEG4_TimeSensor);
- if (!gf_node_get_id(child_ts)) {
- gf_node_set_id(child_ts, gf_sg_get_next_available_node_id(converter->bifs_sg), NULL);
- }
- gf_node_register(child_ts, node);
- gf_node_list_add_child(&((GF_ParentNode *)node)->children, child_ts);
- {
- M_TimeSensor *ts = (M_TimeSensor *)child_ts;
- if (converter->all_atts.dur) {
- ts->cycleInterval = converter->all_atts.dur->clock_value;
- }
- if (converter->all_atts.repeatCount && converter->all_atts.repeatCount->type == SMIL_REPEATCOUNT_INDEFINITE) {
- ts->loop = 1;
- }
- }
-
- if (converter->all_atts.transform_type) {
- GF_FieldInfo fromField, toField;
-
- switch (*converter->all_atts.transform_type) {
- case SVG_TRANSFORM_ROTATE:
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_PositionInterpolator2D);
- if (!gf_node_get_id(child)) {
- gf_node_set_id(child, gf_sg_get_next_available_node_id(converter->bifs_sg), NULL);
- }
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode *)node)->children, child);
-
- gf_node_get_field_by_name(child_ts, "fraction_changed", &fromField);
- gf_node_get_field_by_name(child, "set_fraction", &toField);
- gf_sg_route_new(converter->bifs_sg, child_ts, fromField.fieldIndex, child, toField.fieldIndex);
-
- gf_node_get_field_by_name(child, "value_changed", &fromField);
- gf_node_get_field_by_name(node, "rotationAngle", &toField);
- gf_sg_route_new(converter->bifs_sg, child, fromField.fieldIndex, node, toField.fieldIndex);
- {
- M_PositionInterpolator2D *pi2d = (M_PositionInterpolator2D *)child;
- if (converter->all_atts.keyTimes) {
- SFFloat *g;
- u32 count;
- count = gf_list_count(*converter->all_atts.keyTimes);
- for (i = 0; i < count; i++) {
- Fixed *f = gf_list_get(*converter->all_atts.keyTimes, i);
- gf_sg_vrml_mf_append(&pi2d->key, GF_SG_VRML_MFFLOAT, &g);
- *g = *f;
- }
- }
- if (converter->all_atts.values) {
- SFVec2f *g;
- u32 count;
- count = gf_list_count(converter->all_atts.values->values);
- for (i = 0; i < count; i++) {
- SVG_Point_Angle *p;
- p = gf_list_get(converter->all_atts.values->values, i);
- gf_sg_vrml_mf_append(&pi2d->keyValue, GF_SG_VRML_MFVEC2F, &g);
- g->x = p->x;
- g->y = p->y;
- }
- }
- }
-
-
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_ScalarInterpolator);
- if (!gf_node_get_id(child)) {
- gf_node_set_id(child, gf_sg_get_next_available_node_id(converter->bifs_sg), NULL);
- }
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode *)node)->children, child);
-
- gf_node_get_field_by_name(child_ts, "fraction_changed", &fromField);
- gf_node_get_field_by_name(child, "set_fraction", &toField);
- gf_sg_route_new(converter->bifs_sg, child_ts, fromField.fieldIndex, child, toField.fieldIndex);
-
- gf_node_get_field_by_name(child, "value_changed", &fromField);
- gf_node_get_field_by_name(node, "center", &toField);
- gf_sg_route_new(converter->bifs_sg, child, fromField.fieldIndex, node, toField.fieldIndex);
-
- {
- M_ScalarInterpolator *si = (M_ScalarInterpolator *)child;
- if (converter->all_atts.keyTimes) {
- SFFloat *g;
- u32 count;
- count = gf_list_count(*converter->all_atts.keyTimes);
- for (i = 0; i < count; i++) {
- Fixed *f = gf_list_get(*converter->all_atts.keyTimes, i);
- gf_sg_vrml_mf_append(&si->key, GF_SG_VRML_MFFLOAT, &g);
- *g = *f;
- }
- }
- if (converter->all_atts.values) {
- SFFloat *g;
- u32 count;
- count = gf_list_count(converter->all_atts.values->values);
- for (i = 0; i < count; i++) {
- SVG_Point_Angle *p;
- p = gf_list_get(converter->all_atts.values->values, i);
- gf_sg_vrml_mf_append(&si->keyValue, GF_SG_VRML_MFFLOAT, &g);
- *g = p->angle;
- }
- }
- }
-
- break;
-
- case SVG_TRANSFORM_SCALE:
- case SVG_TRANSFORM_TRANSLATE:
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_PositionInterpolator2D);
- if (!gf_node_get_id(child)) {
- gf_node_set_id(child, gf_sg_get_next_available_node_id(converter->bifs_sg), NULL);
- }
- gf_node_register(child, node);
- gf_node_list_add_child(&((GF_ParentNode *)node)->children, child);
-
- gf_node_get_field_by_name(child_ts, "fraction_changed", &fromField);
- gf_node_get_field_by_name(child, "set_fraction", &toField);
- gf_sg_route_new(converter->bifs_sg, child_ts, fromField.fieldIndex, child, toField.fieldIndex);
-
- gf_node_get_field_by_name(child, "value_changed", &fromField);
- if (*converter->all_atts.transform_type == SVG_TRANSFORM_SCALE)
- gf_node_get_field_by_name(node, "scale", &toField);
- else
- gf_node_get_field_by_name(node, "translation", &toField);
-
- gf_sg_route_new(converter->bifs_sg, child, fromField.fieldIndex, node, toField.fieldIndex);
- {
- M_PositionInterpolator2D *pi2d = (M_PositionInterpolator2D *)child;
- if (converter->all_atts.keyTimes) {
- SFFloat *g;
- u32 count;
- count = gf_list_count(*converter->all_atts.keyTimes);
- for (i = 0; i < count; i++) {
- Fixed *f = gf_list_get(*converter->all_atts.keyTimes, i);
- gf_sg_vrml_mf_append(&pi2d->key, GF_SG_VRML_MFFLOAT, &g);
- *g = *f;
- }
- }
- if (converter->all_atts.values) {
- SFVec2f *g;
- u32 count;
- count = gf_list_count(converter->all_atts.values->values);
- for (i = 0; i < count; i++) {
- SVG_Point *p;
- p = gf_list_get(converter->all_atts.values->values, i);
- gf_sg_vrml_mf_append(&pi2d->keyValue, GF_SG_VRML_MFVEC2F, &g);
- g->x = p->x;
- g->y = p->y;
- }
- }
- }
- break;
- default:
- fprintf(stdout, "Warning: transformation type not supported \n");
- }
- }
- //converter->bifs_parent = node;
- }
- break;
- default:
- {
- fprintf(stdout, "Warning: element %s not supported \n", gf_node_get_class_name((GF_Node *)elt));
- child = gf_node_new(converter->bifs_sg, TAG_MPEG4_Transform2D);
- gf_node_register(child, node);
- //gf_node_list_add_child(&((GF_ParentNode*)node)->children, child);
- node = child;
- child = NULL;
- converter->bifs_parent = node;
- }
- break;
- }
-
- if (id_string)
- gf_node_set_id(converter->bifs_parent, gf_sg_get_next_available_node_id(converter->bifs_sg), NULL);//gf_node_get_name((GF_Node *)elt));
-
- }
- fprintf(stdout, "\t%s\n", converter->bifs_parent ? gf_node_get_class_name(converter->bifs_parent) : "none");
-}
-
-static void svg2bifs_node_end(void *sax_cbck, const char *name, const char *name_space)
-{
- SVG2BIFS_Converter *converter = (SVG2BIFS_Converter *)sax_cbck;
- GF_Node *parent;
-
- SVGPropertiesPointers *backup_props = gf_node_get_private(converter->svg_parent);
- memcpy(&converter->svg_props, backup_props, sizeof(SVGPropertiesPointers));
-// gf_free(backup_props);
- gf_node_set_private(converter->svg_parent, NULL);
-
- if (!(gf_node_get_tag(converter->svg_parent) == TAG_SVG_animateTransform))
- converter->bifs_parent = gf_node_get_parent(converter->bifs_parent, 0);
- parent = gf_node_get_parent(converter->svg_parent, 0);
- gf_node_unregister(converter->svg_parent, parent);
- if (!parent) gf_sg_set_root_node(converter->svg_sg, NULL);
- converter->svg_parent = parent;
- converter->bifs_text_node = NULL;
-
- fprintf(stdout, "END:\t%s\t%s\n", converter->svg_parent ? gf_node_get_class_name(converter->svg_parent) : "none", converter->bifs_parent ? gf_node_get_class_name(converter->bifs_parent) : "none");
-}
-
-static void svg2bifs_text_content(void *sax_cbck, const char *text_content, Bool is_cdata)
-{
- SVG2BIFS_Converter *converter = (SVG2BIFS_Converter *)sax_cbck;
- if (converter->bifs_text_node) {
- M_Text *text = (M_Text *)converter->bifs_text_node;
- gf_sg_vrml_mf_alloc(&text->string, GF_SG_VRML_MFSTRING, 1);
- text->string.vals[0] = gf_strdup(text_content);
- }
-}
-
-int main(int argc, char **argv)
-{
- SVG2BIFS_Converter *converter;
- GF_SceneDumper *dump;
- char *tmp;
-
- gf_sys_init(GF_MemTrackerNone);
-
- GF_SAFEALLOC(converter, SVG2BIFS_Converter);
-
- converter->sax_parser = gf_xml_sax_new(svg2bifs_node_start, svg2bifs_node_end, svg2bifs_text_content, converter);
- converter->force_transform = 1;
-
- converter->svg_sg = gf_sg_new();
- gf_svg_properties_init_pointers(&converter->svg_props);
-
- converter->bifs_sg = gf_sg_new();
-
- fprintf(stdout, "Parsing SVG File\n");
- gf_xml_sax_parse_file(converter->sax_parser, argv[1], NULL);
-
- fprintf(stdout, "Dumping BIFS scenegraph\n");
- tmp = strchr(argv[1], '.');
- tmp[0] = 0;
- dump = gf_sm_dumper_new(converter->bifs_sg, argv[1], ' ', GF_SM_DUMP_BT);
- tmp[0] = '.';
-
- gf_sm_dump_graph(dump, 1, 0);
- gf_sm_dumper_del(dump);
-
- gf_svg_properties_reset_pointers(&converter->svg_props);
-
- gf_sg_del(converter->svg_sg);
-// gf_sg_del(converter->bifs_sg);
-
- gf_xml_sax_del(converter->sax_parser);
-
- gf_free(converter);
-}
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="svg2bifs" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
-\r
-CFG=svg2bifs - Win32 Debug\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "svg2bifs.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "svg2bifs.mak" CFG="svg2bifs - Win32 Debug"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "svg2bifs - Win32 Release" (based on "Win32 (x86) Console Application")\r
-!MESSAGE "svg2bifs - Win32 Debug" (based on "Win32 (x86) Console Application")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-RSC=rc.exe\r
-\r
-!IF "$(CFG)" == "svg2bifs - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Release"\r
-# PROP BASE Intermediate_Dir "Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD BASE RSC /l 0x40c /d "NDEBUG"\r
-# ADD RSC /l 0x40c /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/svg2bifs.exe" /libpath:"../../../extra_lib/lib/w32_rel"\r
-\r
-!ELSEIF "$(CFG)" == "svg2bifs - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "Debug"\r
-# PROP BASE Intermediate_Dir "Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD BASE RSC /l 0x40c /d "_DEBUG"\r
-# ADD RSC /l 0x40c /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/svg2bifs.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "svg2bifs - Win32 Release"\r
-# Name "svg2bifs - Win32 Debug"\r
-# Begin Source File\r
-\r
-SOURCE=.\main.c\r
-# End Source File\r
-# End Target\r
-# End Project\r
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/ts2hds
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= main.o f4v.o f4m.o
-
-LINKFLAGS=-L../../bin/gcc
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=ts2hds$(EXE)
-else
-EXT=
-PROG=ts2hds
-endif
-LINKFLAGS+=-lgpac
-
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Author: Romain Bouqueau
- * Copyright (c) Romain Bouqueau 2012-
- * All rights reserved
- *
- * Note: this development was kindly sponsorized by Vizion'R (http://vizionr.com)
- *
- * This file is part of GPAC / TS to HDS (ts2hds) application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "ts2hds.h"
-
-#include <gpac/base_coding.h>
-
-//#define ADOBE_INLINED_BOOTSTRAP
-
-struct __tag_adobe_stream
-{
- FILE *f;
- const char *id;
- const char *base_url;
- u32 bitrate;
-};
-
-struct __tag_adobe_multirate
-{
- FILE *f;
- const char *id;
- const char *base_url;
- GF_List *streams;
-};
-
-static GF_Err adobe_gen_stream_manifest(AdobeStream *as)
-{
- fprintf(as->f, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
- fprintf(as->f, "<manifest xmlns=\"http://ns.adobe.com/f4m/1.0\">\n");
- fprintf(as->f, "<id>%s</id>\n", as->id);
- if (as->base_url)
- fprintf(as->f, "<baseURL>%s</baseURL>\n", as->base_url);
- fprintf(as->f, "<bootstrapInfo profile=\"named\" id=\"boot_%s_%d\" url=\"%s_%d.bootstrap\"/>\n", as->id, as->bitrate, as->id, as->bitrate);
- fprintf(as->f, "<media url=\"%s_%u_\" bitrate=\"%u\" bootstrapInfoId=\"boot_%s_%d\"/>\n", as->id, as->bitrate, as->bitrate, as->id, as->bitrate);
- fprintf(as->f, "</manifest>\n");
-
- return GF_OK;
-}
-
-AdobeMultirate *adobe_alloc_multirate_manifest(char *id)
-{
- AdobeMultirate *am = gf_calloc(1, sizeof(AdobeMultirate));
- char filename[GF_MAX_PATH];
-
- //default init
- am->base_url = "http://localhost/hds/tmp";
- am->id = id;
- sprintf(filename, "%s.f4m", am->id);
- am->f = gf_fopen(filename, "wt");
- if (!am->f) {
- fprintf(stderr, "Couldn't create Adobe multirate manifest file: %s\n", filename);
- assert(0);
- gf_free(am);
- return NULL;
- }
- am->streams = gf_list_new();
-
- //create a fake stream
- {
- AdobeStream *as = gf_calloc(1, sizeof(AdobeStream));
- as->id = "HD";
- as->bitrate = 100;
- sprintf(filename, "%s_%s_%d.f4m", am->id, as->id, as->bitrate);
- as->f = gf_fopen(filename, "wt");
- if (!as->f) {
- fprintf(stderr, "Couldn't create Adobe stream manifest file: %s\n", filename);
- assert(0);
- gf_list_del(am->streams);
- gf_free(as);
- gf_free(am);
- return NULL;
- }
- gf_list_add(am->streams, as);
- }
-
- return am;
-}
-
-void adobe_free_multirate_manifest(AdobeMultirate *am)
-{
- u32 i;
-
- if (am->f)
- gf_fclose(am->f);
-
- for (i=0; i<gf_list_count(am->streams); i++) {
- AdobeStream *as = gf_list_get(am->streams, i);
- assert(as);
- if (as->f)
- gf_fclose(as->f);
- //TODO: base_url and id may be stored as gf_strdup in the future
- gf_list_rem(am->streams, i);
- gf_free(as);
- }
- gf_list_del(am->streams);
-
- gf_free(am);
-}
-
-GF_Err adobe_gen_multirate_manifest(AdobeMultirate* am, char *bootstrap, size_t bootstrap_size)
-{
- GF_Err e;
- u32 i;
-#ifdef ADOBE_INLINED_BOOTSTRAP
- char bootstrap64[GF_MAX_PATH];
- u32 bootstrap64_len;
-#endif
-
- fprintf(am->f, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
- fprintf(am->f, "<manifest xmlns=\"http://ns.adobe.com/f4m/2.0\">\n");
- fprintf(am->f, "<id>%s</id>\n", am->id);
- fprintf(am->f, "<baseURL>%s</baseURL>\n", am->base_url);
- fprintf(am->f, "<streamType>live</streamType>\n");
-
- assert(am->streams);
- for (i=0; i<gf_list_count(am->streams); i++) {
- AdobeStream *as = gf_list_get(am->streams, i);
- assert(as);
-#ifdef ADOBE_INLINED_BOOTSTRAP
- fprintf(am->f, "<bootstrapInfo profile=\"named\" id=\"boot_%s_%d\">\n", as->id, as->bitrate);
- bootstrap64_len = gf_base64_encode(bootstrap, bootstrap_size, bootstrap64, GF_MAX_PATH);
- fwrite(bootstrap64, bootstrap64_len, 1, am->f);
- if (bootstrap64_len >= GF_MAX_PATH) {
- fprintf(stderr, "Bootstrap may have been truncated for stream %s_%d.\n", as->id, as->bitrate);
- assert(0);
- }
- fprintf(am->f, "\n</bootstrapInfo>\n");
-#else
- {
- char filename[GF_MAX_PATH];
- FILE *bstfile;
- sprintf(filename, "%s_%d.bootstrap", as->id, as->bitrate);
- bstfile = gf_fopen(filename, "wb");
- gf_fwrite(bootstrap, bootstrap_size, 1, bstfile);
- gf_fclose(bstfile);
- }
-#endif
- e = adobe_gen_stream_manifest(as);
- if (!e) {
- if (!am->base_url && !as->base_url)
- fprintf(stderr, "Warning: no base_url specified\n");
-
- fprintf(am->f, "<media href=\"%s_%s_%d.f4m\" bitrate=\"%d\"/>\n", am->id, as->id, as->bitrate, as->bitrate);
- }
- }
- fprintf(am->f, "</manifest>\n");
-
- return GF_OK;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Author: Romain Bouqueau
- * Copyright (c) Romain Bouqueau 2012-
- * All rights reserved
- *
- * Note: this development was kindly sponsorized by Vizion'R (http://vizionr.com)
- *
- * This file is part of GPAC / TS to HDS (ts2hds) application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "ts2hds.h"
-
-//we need to write Adobe custom boxes
-#include <gpac/internal/isomedia_dev.h>
-
-extern struct box_registry_entry box_registry[];
-extern u32 get_box_reg_idx(u32 boxCode, u32 parent_type);
-extern size_t size_registry();
-
-GF_Err adobize_segment(GF_ISOFile *isom_file, AdobeHDSCtx *ctx)
-{
- GF_Err e;
- GF_BitStream *bs;
-
- GF_AdobeFragRandomAccessBox *afra = (GF_AdobeFragRandomAccessBox*) afra_New();
- GF_AfraEntry *ae = (GF_AfraEntry*) gf_calloc(1, sizeof(GF_AfraEntry));
- GF_AdobeBootstrapInfoBox *abst = (GF_AdobeBootstrapInfoBox*) abst_New();
- GF_AdobeSegmentRunTableBox *asrt = (GF_AdobeSegmentRunTableBox*) asrt_New();
- GF_AdobeSegmentRunEntry *asre = (GF_AdobeSegmentRunEntry*) gf_calloc(1, sizeof(GF_AdobeSegmentRunEntry));
- GF_AdobeFragmentRunTableBox *afrt = (GF_AdobeFragmentRunTableBox*) afrt_New();
- GF_AdobeFragmentRunEntry *afre = (GF_AdobeFragmentRunEntry*) gf_calloc(1, sizeof(GF_AdobeFragmentRunEntry));
-
- u64 init_seg_time = ctx->curr_time;
- u32 seg_duration = (u32)gf_isom_get_duration(isom_file);
-
- //update context
- ctx->curr_time += seg_duration;
-
- //Adobe specific boxes
- //Random Access
- afra->type = GF_4CC('a', 'f', 'r', 'a');
- afra->version = 0;
- afra->flags = 0;
- afra->registry = (const struct box_registry_entry*)((u8*)& box_registry + size_registry() * get_box_reg_idx(afra->type, 0));
- afra->long_ids = 1;
- afra->long_offsets = 1;
- afra->global_entries = 0;
- afra->time_scale = gf_isom_get_timescale(isom_file);
-
- afra->entry_count = 1;
- ae->time = init_seg_time;
- ae->offset = 3999;
- gf_list_add(afra->local_access_entries, ae);
-
- afra->global_entries = 0;
- afra->global_entry_count = 0;
-
- e = gf_list_add(isom_file->TopBoxes, afra);
- if (e) {
- fprintf(stderr, "Impossible to write AFRA box: %s\n", gf_error_to_string(e));
- assert(0);
- return e;
- }
-
- //Bootstrap Info
- abst->type = GF_4CC('a', 'b', 's', 't');
- abst->version = 0;
- abst->flags = 0;
- abst->registry = (const struct box_registry_entry*)((u8*)& box_registry + size_registry() * get_box_reg_idx(abst->type, 0));
- abst->bootstrapinfo_version = 1;
- abst->profile = 0;
- abst->live = 1;
- abst->update = 0;
- abst->time_scale = gf_isom_get_timescale(isom_file);
- abst->current_media_time = init_seg_time+seg_duration;
- abst->smpte_time_code_offset = 0;
-
- abst->movie_identifier = NULL;
- abst->drm_data = NULL;
- abst->meta_data = NULL;
-
- abst->server_entry_count = 0;
- abst->quality_entry_count = 0;
-
- abst->segment_run_table_count = 1;
- {
- //Segment Run
- asrt->type = GF_4CC('a', 's', 'r', 't');
- asrt->version = 0;
- asrt->flags = 0;
- asrt->registry = (const struct box_registry_entry*)((u8*)& box_registry + size_registry() * get_box_reg_idx(asrt->type, 0));
- asrt->segment_run_entry_count = 1;
- {
- asre->first_segment = ctx->segnum;
- asre->fragment_per_segment = 1;
- }
- e = gf_list_add(asrt->segment_run_entry_table, asre);
- if (e) {
- fprintf(stderr, "Impossible to write ASR Entry: %s\n", gf_error_to_string(e));
- assert(0);
- return e;
- }
- }
- e = gf_list_add(abst->segment_run_table_entries, asrt);
- if (e) {
- fprintf(stderr, "Impossible to write ASRT box: %s\n", gf_error_to_string(e));
- assert(0);
- return e;
- }
-
- abst->fragment_run_table_count = 1;
- {
- //Fragment Run
- afrt->type = GF_4CC('a', 'f', 'r', 't');
- afrt->version = 0;
- afrt->flags = 0;
- afrt->registry = (const struct box_registry_entry*)((u8*)& box_registry + size_registry() * get_box_reg_idx(afrt->type, 0));
- afrt->timescale = gf_isom_get_timescale(isom_file);
- afrt->fragment_run_entry_count = 1;
- {
- afre->first_fragment = 1;
- afre->first_fragment_timestamp = 0;
- afre->fragment_duration = seg_duration;
- }
- e = gf_list_add(afrt->fragment_run_entry_table, afre);
- if (e) {
- fprintf(stderr, "Impossible to write AFR Entry: %s\n", gf_error_to_string(e));
- assert(0);
- return e;
- }
- }
- e = gf_list_add(abst->fragment_run_table_entries, afrt);
- if (e) {
- fprintf(stderr, "Impossible to write AFRT box: %s\n", gf_error_to_string(e));
- assert(0);
- return e;
- }
-
- e = gf_list_add(isom_file->TopBoxes, abst);
- if (e) {
- fprintf(stderr, "Impossible to write ABST box: %s\n", gf_error_to_string(e));
- assert(0);
- return e;
- }
-
- abst->size = 12; /*full box*/
- e = abst_Size((GF_Box*)abst);
- if (e) {
- fprintf(stderr, "Impossible to compute ABST box size: %s\n", gf_error_to_string(e));
- assert(0);
- return e;
- }
- ctx->bootstrap_size = (size_t)abst->size;
- ctx->bootstrap = gf_malloc(ctx->bootstrap_size);
- bs = gf_bs_new(ctx->bootstrap, ctx->bootstrap_size, GF_BITSTREAM_WRITE);
- e = abst_Write((GF_Box*)abst, bs);
- if (e) {
- fprintf(stderr, "Impossible to code the ABST box: %s\n", gf_error_to_string(e));
- assert(0);
- gf_bs_del(bs);
- return e;
- }
- gf_bs_del(bs);
-
- //set brands as reversed engineered from f4v files
- /*e = gf_isom_reset_alt_brands(isom_file);
- if (e) {
- fprintf(stderr, "Warning: couldn't reset ISOM brands: %s\n", gf_error_to_string(e));
- assert(0);
- }*/
- gf_isom_set_brand_info(isom_file, GF_4CC('f','4','v',' '), 1);
- gf_isom_modify_alternate_brand(isom_file, GF_4CC('i','s','o','m'), 1);
- gf_isom_modify_alternate_brand(isom_file, GF_4CC('m','p','4','2'), 1);
- gf_isom_modify_alternate_brand(isom_file, GF_4CC('m','4','v',' '), 1);
-
- return GF_OK;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Author: Romain Bouqueau
- * Copyright (c) Romain Bouqueau 2012-
- * All rights reserved
- *
- * Note: this development was kindly sponsorized by Vizion'R (http://vizionr.com)
- *
- * This file is part of GPAC / TS to HDS (ts2hds) application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "ts2hds.h"
-
-//FIXME: test only
-//#include <gpac/internal/isomedia_dev.h>
-//#include <gpac/base_coding.h>
-
-#ifdef WIN32
-#define strnicmp _strnicmp
-#endif
-
-#define CHECK_NEXT_ARG if (i+1==(u32)argc) { fprintf(stderr, "Missing arg - please check usage\n"); exit(1); }
-
-#ifdef GPAC_DISABLE_ISOM
-
-#error "Cannot compile TS2HDS if GPAC is not built with ISO File Format support"
-
-#endif
-
-
-static GFINLINE void usage(const char * progname)
-{
- fprintf(stderr, "USAGE: %s -i input -o output\n"
- "\n"
-#ifdef GPAC_MEMORY_TRACKING
- "\t-mem-track: enables memory tracker\n"
-#endif
- , progname);
-}
-
-
-/*parse TS2HDS arguments*/
-static GFINLINE GF_Err parse_args(int argc, char **argv, char **input, char **output, u64 *curr_time, u32 *segnum)
-{
- Bool input_found=0, output_found=0;
- char *arg = NULL, *error_msg = "no argument found";
- s32 i;
-
- for (i=1; i<argc; i++) {
- arg = argv[i];
- if (!strnicmp(arg, "-h", 2) || strstr(arg, "-help")) {
- usage(argv[0]);
- return GF_EOS;
- } else if (!strnicmp(arg, "-input", 6)) {
- CHECK_NEXT_ARG
- *input = argv[++i];
- input_found = 1;
- } else if (!strnicmp(arg, "-output", 6)) {
- CHECK_NEXT_ARG
- *output = argv[++i];
- output_found = 1;
- } else if (!strnicmp(arg, "-segnum", 6)) {
- CHECK_NEXT_ARG
- *segnum = atoi(argv[++i]);
- } else if (!strnicmp(arg, "-mem-track", 10)) {
-#ifdef GPAC_MEMORY_TRACKING
- gf_sys_close();
- gf_sys_init(GF_MemTrackerSimple);
- gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
-#else
- fprintf(stderr, "WARNING - GPAC not compiled with Memory Tracker - ignoring \"-mem-track\"\n");
-#endif
- } else {
- error_msg = "unknown option \"%s\"";
- goto error;
- }
- }
-
- /*syntax is correct; now testing the presence of mandatory arguments*/
- if (input_found && output_found) {
- return GF_OK;
- } else {
- if (!input_found)
- fprintf(stderr, "Error: input argument not found\n\n");
- if (!output_found)
- fprintf(stderr, "Error: output argument not found\n\n");
- return GF_BAD_PARAM;
- }
-
-error:
- if (!arg) {
- fprintf(stderr, "Error: %s\n\n", error_msg);
- } else {
- fprintf(stderr, "Error: %s \"%s\"\n\n", error_msg, arg);
- }
- return GF_BAD_PARAM;
-}
-
-int main(int argc, char **argv)
-{
- /********************/
- /* declarations */
- /********************/
- char *input, *output, tmpstr[GF_MAX_PATH];
- GF_ISOFile *isom_file_in;
- GF_MediaImporter import;
- AdobeHDSCtx ctx;
- GF_Err e;
- u32 i;
-
- /*****************/
- /* gpac init */
- /*****************/
- gf_sys_init(GF_MemTrackerNone);
- gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_WARNING);
-
- /***********************/
- /* initialisations */
- /***********************/
- input = NULL;
- output = NULL;
- isom_file_in = NULL;
- memset(&import, 0, sizeof(GF_MediaImporter));
- e = GF_OK;
- memset(&ctx, 0, sizeof(ctx));
-
- ctx.curr_time = 0;
- ctx.segnum = 1;
-
- /*********************************************/
- /* parse arguments and build HDS context */
- /*********************************************/
- if (GF_OK != parse_args(argc, argv, &input, &output, &ctx.curr_time, &ctx.segnum)) {
- usage(argv[0]);
- goto exit;
- }
-
- ctx.multirate_manifest = adobe_alloc_multirate_manifest(output);
-
-#if 0 /*'moov' conversion tests*/
- {
- char metamoov64[GF_MAX_PATH];
- u32 metamoov64_len;
- unsigned char metamoov[GF_MAX_PATH];
- u32 metamoov_len=GF_MAX_PATH;
- FILE *f = gf_fopen("metamoov64"/*input*/, "rt");
- gf_fseek(f, 0, SEEK_END);
- metamoov64_len = (u32)gf_ftell(f);
- gf_fseek(f, 0, SEEK_SET);
- fread(metamoov64, metamoov64_len, 1, f);
- metamoov_len = gf_base64_decode(metamoov64, metamoov64_len, metamoov, metamoov_len);
- gf_fclose(f);
- f = gf_fopen("metamoov", "wb");
- fwrite(metamoov, metamoov_len, 1, f);
- gf_fclose(f);
- return 0;
- }
-#endif
-
-#if 0 /*'abst'conversion tests*/
- {
- char bootstrap64[GF_MAX_PATH];
- u32 bootstrap64_len;
- unsigned char bootstrap[GF_MAX_PATH];
- u32 bootstrap_len=GF_MAX_PATH;
- GF_AdobeBootstrapInfoBox *abst = (GF_AdobeBootstrapInfoBox *)abst_New();
- GF_BitStream *bs;
-#if 1 //64
- FILE *f = gf_fopen("bootstrap64"/*input*/, "rt");
- gf_fseek(f, 0, SEEK_END);
- bootstrap64_len = (u32)gf_ftell(f);
- gf_fseek(f, 0, SEEK_SET);
- fread(bootstrap64, bootstrap64_len, 1, f);
- bootstrap_len = gf_base64_decode(bootstrap64, bootstrap64_len, bootstrap, bootstrap_len);
-#else //binary bootstrap
- FILE *f = gf_fopen("bootstrap.bin"/*input*/, "rb");
- gf_fseek(f, 0, SEEK_END);
- bootstrap_len = (u32)gf_ftell(f);
- gf_fseek(f, 0, SEEK_SET);
- fread(bootstrap, bootstrap_len, 1, f);
-#endif
- bs = gf_bs_new(bootstrap+8, bootstrap_len-8, GF_BITSTREAM_READ);
- abst->size = bootstrap[2]*256+bootstrap[3];
- assert(abst->size<GF_MAX_PATH);
- abst_Read((GF_Box*)abst, bs);
- gf_bs_del(bs);
- //then rewrite with just one 'afrt'
- memset(bootstrap, 0, bootstrap_len);
- bs = gf_bs_new(bootstrap, bootstrap_len, GF_BITSTREAM_WRITE);
- abst_Write((GF_Box*)abst, bs);
- bootstrap_len = (u32)gf_bs_get_position(bs);
- gf_bs_del(bs);
- gf_fclose(f);
- f = gf_fopen("bootstrap", "wt");
- bootstrap64_len = gf_base64_encode(bootstrap, bootstrap_len, bootstrap64, GF_MAX_PATH);
- fwrite(bootstrap64, bootstrap64_len, 1, f);
- fprintf(f, "\n\n");
- abst_dump((GF_Box*)abst, f);
- gf_fclose(f);
- abst_del((GF_Box*)abst);
- return 0;
- }
-#endif
-
- /*****************/
- /* main loop */
- /*****************/
- import.trackID = 0;
- import.in_name = input;
- import.flags = GF_IMPORT_PROBE_ONLY;
-
- //create output or open when recovering from a saved state
- sprintf(tmpstr, "%s_import.mp4", input);
- isom_file_in = gf_isom_open(tmpstr, GF_ISOM_WRITE_EDIT, NULL);
- if (!isom_file_in) {
- fprintf(stderr, "Error opening output file %s: %s\n", tmpstr, gf_error_to_string(e));
- assert(0);
- goto exit;
- }
- import.dest = isom_file_in;
-
- //probe input
- e = gf_media_import(&import);
- if (e) {
- fprintf(stderr, "Error while importing input file %s: %s\n", input, gf_error_to_string(e));
- assert(0);
- goto exit;
- }
-
- //import input data
- import.flags = 0;
- for (i=0; i<import.nb_tracks; i++) {
- import.trackID = import.tk_info[i].track_num;
- e = gf_media_import(&import);
- if (e) {
- fprintf(stderr, "Error while importing track number %u, input file %s: %s\n", import.trackID, input, gf_error_to_string(e));
- assert(0);
- goto exit;
- }
- }
-
- //Adobe specific stuff
- e = adobize_segment(isom_file_in, &ctx);
- if (e) {
- fprintf(stderr, "Couldn't turn the ISOM fragmented file into an Adobe f4v segment: %s\n", gf_error_to_string(e));
- assert(0);
- goto exit;
- }
-
- //interleave data and remove imported file
- //FIXME: set multiple fragments:
- sprintf(tmpstr, "%s_HD_100_Seg%u-Frag1", output, ctx.segnum); //FIXME: "HD", "100" and fragnum: pass as arg
- e = gf_media_fragment_file(isom_file_in, tmpstr, 1.0+gf_isom_get_duration(isom_file_in)/gf_isom_get_timescale(isom_file_in), GF_FALSE);
- if (e) {
- fprintf(stderr, "Error while fragmenting file to output %s: %s\n", output, gf_error_to_string(e));
- assert(0);
- goto exit;
- }
- gf_isom_delete(isom_file_in);
- isom_file_in = NULL;
-
- e = adobe_gen_multirate_manifest(ctx.multirate_manifest, ctx.bootstrap, ctx.bootstrap_size);
- if (e) {
- fprintf(stderr, "Couldn't generate Adobe f4m manifest: %s\n", gf_error_to_string(e));
- assert(0);
- goto exit;
- }
-
-exit:
- //delete intermediate mp4 file
- if (isom_file_in)
- gf_isom_delete(isom_file_in);
-
- if (ctx.multirate_manifest)
- adobe_free_multirate_manifest(ctx.multirate_manifest);
-
- if (ctx.bootstrap) {
- gf_free(ctx.bootstrap);
- //ctx.bootstrap = NULL;
- //ctx.bootstrap_size = 0;
- }
-
- gf_sys_close();
-
- return !e ? 0 : 1;
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Author: Romain Bouqueau
- * Copyright (c) Romain Bouqueau 2012-
- * All rights reserved
- *
- * Note: this development was kindly sponsorized by Vizion'R (http://vizionr.com)
- *
- * This file is part of GPAC / TS to HDS (ts2hds) application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/media_tools.h>
-
-//f4m
-typedef struct __tag_adobe_stream AdobeStream;
-typedef struct __tag_adobe_multirate AdobeMultirate;
-AdobeMultirate *adobe_alloc_multirate_manifest(char *id);
-void adobe_free_multirate_manifest(AdobeMultirate *am);
-GF_Err adobe_gen_multirate_manifest(AdobeMultirate* am, char *bootstrap, size_t bootstrap_size);
-
-//context
-typedef struct
-{
- u64 curr_time;
- u32 segnum;
- char *bootstrap;
- size_t bootstrap_size;
- AdobeMultirate *multirate_manifest;
-} AdobeHDSCtx;
-
-//f4v
-GF_Err adobize_segment(GF_ISOFile *isom_file, AdobeHDSCtx *ctx);
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Romain Bouqueau
- * Copyright (c) Romain Bouqueau - GPAC Licensing 2016
- * All rights reserved
- *
- * This file is part of GPAC / sample m2ts streamer over UDP application
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/mpegts.h>
-
-#define MPEGTS_PKT_SIZE 188
-//TODO #define NUM_TS_PKT_PER_UDP 7
-#define QUEUE_SIZE 1024 /*max num pck between two PCRs, otherwise can block*/
-#define TTL 64
-
-typedef struct {
- GF_List *pck;
- GF_Semaphore *sema;
- GF_Socket *sk;
- char *buffer;
- volatile u64 data_read_idx, data_write_idx;
- u64 pcr, first_pcr;
- volatile Bool done;
-} UDPSender;
-
-void on_m2ts_event(GF_M2TS_Demuxer *ts, u32 evt_type, void *par)
-{
- GF_M2TS_PES_PCK *pck;
- UDPSender *sender = ts->user;
- switch (evt_type) {
- case GF_M2TS_EVT_PES_PCR:
- pck = (GF_M2TS_PES_PCK*)par;
- if (sender->first_pcr == (u64)-1) {
- sender->first_pcr = pck->stream->program->last_pcr_value;
- }
- sender->pcr = pck->stream->program->last_pcr_value;
- break;
- }
-}
-
-u32 sender_thread_proc(void *param) {
- char *data = NULL;
- UDPSender *sender = param;
- s32 time_to_wait_in_ms = 0;
- while (!sender->done) {
- gf_sema_wait(sender->sema);
- time_to_wait_in_ms = (s32)((sender->pcr - sender->first_pcr) / 27000 - gf_sys_clock());
- if (time_to_wait_in_ms > 0) {
- gf_sleep(time_to_wait_in_ms);
- } else if (time_to_wait_in_ms < -300) {
- fprintf(stderr, "sender late from %d ms\n", -time_to_wait_in_ms);
- }
- data = sender->buffer + MPEGTS_PKT_SIZE * (sender->data_read_idx % QUEUE_SIZE);
- gf_sk_send(sender->sk, data, MPEGTS_PKT_SIZE); //TODO: *= NUM_TS_PKT_PER_UDP
- sender->data_read_idx++;
- }
-
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- u32 size = 0;
- u64 fsize = 0, fdone = 0;
- FILE *src = NULL;
- GF_M2TS_Demuxer *ts = NULL;
- GF_Thread *th = NULL;
- u16 port = 0;
- UDPSender sender;
-
- if (argc != 4) {
- fprintf(stderr, "Usage : %s ts_file ip_addr port\n", argv[0]);
- fprintf(stderr, "Example: %s file.ts 224.0.0.1 1234\n", argv[0]);
- return 1;
- }
- port = atoi(argv[3]);
- fprintf(stdout, "Detected: %s ts_file %s %s %u\n", argv[0], argv[1], argv[2], (u32)port);
-
- gf_sys_init(GF_FALSE);
- memset(&sender, 0, sizeof(UDPSender));
- sender.first_pcr = (u64)-1;
- src = gf_fopen(argv[1], "rb");
- if (!src) {
- fprintf(stderr, "Couldn't open input file %s\n", argv[1]);
- goto exit;
- }
- th = gf_th_new("UDP sender");
- sender.sema = gf_sema_new(QUEUE_SIZE, 0);
- gf_th_set_priority(th, GF_THREAD_PRIORITY_REALTIME);
- ts = gf_m2ts_demux_new();
- ts->on_event = on_m2ts_event;
- ts->user = &sender;
- sender.sk = gf_sk_new(GF_SOCK_TYPE_UDP);
- if (gf_sk_is_multicast_address(argv[2])) {
- gf_sk_setup_multicast(sender.sk, argv[2], port, TTL, 0, NULL);
- } else {
- gf_sk_bind(sender.sk, NULL, port, argv[2], port, GF_SOCK_REUSE_PORT);
- }
- sender.buffer = gf_malloc(MPEGTS_PKT_SIZE*QUEUE_SIZE);
-
- gf_fseek(src, 0, SEEK_END);
- fsize = gf_ftell(src);
- gf_fseek(src, 0, SEEK_SET);
- gf_th_run(th, sender_thread_proc, &sender);
- while (!feof(src)) {
- if (sender.data_write_idx - sender.data_read_idx < QUEUE_SIZE) {
- char *data = sender.buffer + MPEGTS_PKT_SIZE * (sender.data_write_idx % QUEUE_SIZE);
- size = (u32)gf_fread(data, 1, MPEGTS_PKT_SIZE, src);
- if (size<MPEGTS_PKT_SIZE) break;
- gf_m2ts_process_data(ts, data, size);
- sender.data_write_idx++;
- gf_sema_notify(sender.sema, 1);
-
- fdone += size;
- gf_set_progress("MPEG-2 TS Processing", fdone, fsize);
- } else {
- gf_sleep(10);
- }
- }
- sender.done = GF_TRUE;
- gf_set_progress("MPEG-2 TS Processing", fsize, fsize);
-
-exit:
- if(src) gf_fclose(src);
- gf_m2ts_demux_del(ts);
- gf_th_del(th);
- gf_sema_del(sender.sema);
- gf_sk_del(sender.sk);
- gf_sys_close();
- gf_free(sender.buffer);
- return 0;
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{FA834705-61A1-4AF1-AA6F-A7B41CB809B3}</ProjectGuid>\r
- <Keyword>Win32Proj</Keyword>\r
- <RootNamespace>ts2udp</RootNamespace>\r
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseDebugLibraries>true</UseDebugLibraries>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseDebugLibraries>false</UseDebugLibraries>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <WholeProgramOptimization>true</WholeProgramOptimization>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseDebugLibraries>true</UseDebugLibraries>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <UseDebugLibraries>false</UseDebugLibraries>\r
- <PlatformToolset>v140</PlatformToolset>\r
- <WholeProgramOptimization>true</WholeProgramOptimization>\r
- <CharacterSet>Unicode</CharacterSet>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Label="Shared">\r
- </ImportGroup>\r
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <LinkIncremental>true</LinkIncremental>\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <LinkIncremental>true</LinkIncremental>\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <LinkIncremental>false</LinkIncremental>\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <LinkIncremental>false</LinkIncremental>\r
- <OutDir>../../../bin/$(Platform)\$(Configuration)/</OutDir>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <ClCompile>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <Optimization>Disabled</Optimization>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <SDLCheck>true</SDLCheck>\r
- <AdditionalIncludeDirectories>..\..\..\include</AdditionalIncludeDirectories>\r
- </ClCompile>\r
- <Link>\r
- <SubSystem>Console</SubSystem>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <AdditionalDependencies>libgpac.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <AdditionalLibraryDirectories>../../../bin/$(Platform)\$(Configuration)</AdditionalLibraryDirectories>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <ClCompile>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <Optimization>Disabled</Optimization>\r
- <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <SDLCheck>true</SDLCheck>\r
- <AdditionalIncludeDirectories>..\..\..\include</AdditionalIncludeDirectories>\r
- </ClCompile>\r
- <Link>\r
- <SubSystem>Console</SubSystem>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <AdditionalDependencies>libgpac.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <AdditionalLibraryDirectories>../../../bin/$(Platform)\$(Configuration)</AdditionalLibraryDirectories>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <ClCompile>\r
- <WarningLevel>Level3</WarningLevel>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <Optimization>MaxSpeed</Optimization>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <IntrinsicFunctions>true</IntrinsicFunctions>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <SDLCheck>true</SDLCheck>\r
- <AdditionalIncludeDirectories>..\..\..\include</AdditionalIncludeDirectories>\r
- </ClCompile>\r
- <Link>\r
- <SubSystem>Console</SubSystem>\r
- <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
- <OptimizeReferences>true</OptimizeReferences>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <AdditionalDependencies>libgpac.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <AdditionalLibraryDirectories>../../../bin/$(Platform)\$(Configuration)</AdditionalLibraryDirectories>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <ClCompile>\r
- <WarningLevel>Level3</WarningLevel>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <Optimization>MaxSpeed</Optimization>\r
- <FunctionLevelLinking>true</FunctionLevelLinking>\r
- <IntrinsicFunctions>true</IntrinsicFunctions>\r
- <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <SDLCheck>true</SDLCheck>\r
- <AdditionalIncludeDirectories>..\..\..\include</AdditionalIncludeDirectories>\r
- </ClCompile>\r
- <Link>\r
- <SubSystem>Console</SubSystem>\r
- <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
- <OptimizeReferences>true</OptimizeReferences>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <AdditionalDependencies>libgpac.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <AdditionalLibraryDirectories>../../../bin/$(Platform)\$(Configuration)</AdditionalLibraryDirectories>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClCompile Include="main.c" />\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/applications/udptsseg
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= main.o
-
-LINKFLAGS=-L../../bin/gcc -L../../extra_lib/lib/gcc
-
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=udptsseg$(EXE)
-ifeq ($(MP4BOX_STATIC),yes)
-LINKFLAGS+=-lgpac_static -lz $(EXTRALIBS)
-else
-LINKFLAGS+=-lgpac
-endif
-else
-EXT=
-PROG=udptsseg
-ifeq ($(MP4BOX_STATIC),yes)
-LINKFLAGS+=-lgpac_static -lz $(EXTRALIBS)
-else
-LINKFLAGS+=-lgpac
-endif
-endif
-
-#3 - spidermonkey support
-ifeq ($(CONFIG_JS),no)
-else
-SCENEGRAPH_CFLAGS+=$(JS_FLAGS)
-ifeq ($(CONFIG_JS),local)
-NEED_LOCAL_LIB=yes
-endif
-LINKFLAGS+=$(JS_LIBS)
-endif
-
-
-SRCS := $(OBJS:.o=.c)
-
-all: $(PROG)
-
-$(PROG): $(OBJS)
- $(CC) -o ../../bin/gcc/$@ $(OBJS) $(LINKFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(PROG)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
-* GPAC - Multimedia Framework C SDK
-*
- * Authors: Cyril COncolato, Romain Bouqueau
- * Copyright (c) Telecom ParisTech 2008-2012
-* All rights reserved
-*
-* This file is part of GPAC / udp TS segmenter (udptsseg) application
-*
-* GPAC is free software; you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License as published by
-* the Free Software Foundation; either version 2, or (at your option)
-* any later version.
-*
-* GPAC is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; see the file COPYING. If not, write to
-* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-*/
-#include <gpac/media_tools.h>
-#include <gpac/constants.h>
-#include <gpac/base_coding.h>
-#include <gpac/ietf.h>
-#include <gpac/mpegts.h>
-
-#define UDP_BUFFER_SIZE 64484
-
-/* adapted from http://svn.assembla.com/svn/legend/segmenter/segmenter.c */
-static GF_Err write_manifest(char *manifest, char *segment_dir, u32 segment_duration, char *segment_prefix, char *http_prefix,
- u32 first_segment, u32 last_segment, Bool end) {
- FILE *manifest_fp;
- u32 i;
- char manifest_tmp_name[GF_MAX_PATH];
- char manifest_name[GF_MAX_PATH];
- char *tmp_manifest = manifest_tmp_name;
-
- if (segment_dir) {
- sprintf(manifest_tmp_name, "%stmp.m3u8", segment_dir);
- sprintf(manifest_name, "%s%s", segment_dir, manifest);
- } else {
- sprintf(manifest_tmp_name, "tmp.m3u8");
- sprintf(manifest_name, "%s", manifest);
- }
-
- manifest_fp = gf_fopen(tmp_manifest, "w");
- if (!manifest_fp) {
- fprintf(stderr, "Could not create m3u8 manifest file (%s)\n", tmp_manifest);
- return GF_BAD_PARAM;
- }
-
- fprintf(manifest_fp, "#EXTM3U\n#EXT-X-TARGETDURATION:%u\n#EXT-X-MEDIA-SEQUENCE:%u\n", segment_duration, first_segment);
-
- for (i = first_segment; i <= last_segment; i++) {
- fprintf(manifest_fp, "#EXTINF:%u,\n%s%s_%u.ts\n", segment_duration, http_prefix, segment_prefix, i);
- }
-
- if (end) {
- fprintf(manifest_fp, "#EXT-X-ENDLIST\n");
- }
- gf_fclose(manifest_fp);
-
- if (!rename(tmp_manifest, manifest_name)) {
- return GF_OK;
- } else {
- if (remove(manifest_name)) {
- fprintf(stdout, "Error removing file %s\n", manifest_name);
- return GF_IO_ERR;
- } else if (rename(tmp_manifest, manifest_name)) {
- fprintf(stderr, "Could not rename temporary m3u8 manifest file (%s) into %s\n", tmp_manifest, manifest_name);
- return GF_IO_ERR;
- } else {
- return GF_OK;
- }
- }
-}
-
-void usage()
-{
- fprintf(stderr, "usage: udptsseg -src=UDP -dst-file=FILE -segment-duration=DUR -segment-dir=DIR -segment-manifest=M3U8 -segment-http-prefix=P -segment-number=N\n"
- "-src=UDP udp://address:port providing the input transport stream\n"
- "-dst-file=FILE e.g. out.ts, radical name of all segments\n"
- "-segment-dir=DIR server local directory to store segments (with the trailing path separator)\n"
- "-segment-duration=DUR segment duration in seconds\n"
- "-segment-manifest=M3U8 m3u8 file basename\n"
- "-segment-http-prefix=P client address for accessing server segments\n"
- "-segment-number=N only n segments are used using a cyclic pattern\n"
- "\n");
-}
-
-int main(int argc, char **argv)
-{
- u32 i;
- char *arg = NULL;
- char *ts_in = NULL;
- char *segment_dir = NULL;
- char *segment_manifest = NULL;
- char *segment_http_prefix = NULL;
- u32 run_time = 0;
- char *input_ip = NULL;
- u32 input_port = 0;
- GF_Socket *input_udp_sk = NULL;
- char *input_buffer = NULL;
- u32 input_buffer_size = UDP_BUFFER_SIZE;
- GF_Err e = GF_OK;
- FILE *ts_output_file = NULL;
- char *ts_out = NULL;
- char segment_prefix[GF_MAX_PATH];
- char segment_name[GF_MAX_PATH];
- u32 segment_duration = 0;
- u32 segment_index = 0;
- u32 segment_number = 0;
- char segment_manifest_default[GF_MAX_PATH];
- u32 last_segment_time = 0;
- u32 last_segment_size = 0;
- u32 read = 0;
- u32 towrite = 0;
- u32 leftinbuffer = 0;
-
- fprintf(stdout, "UDP Transport Stream Segmenter\n");
-
- if (argc < 7) {
- usage();
- return 0;
- }
- /*****************/
- /* gpac init */
- /*****************/
- gf_sys_init(GF_MemTrackerNone);
-
- /*****************/
- /* parsing of the arguments */
- /*****************/
- for (i = 1; i < (u32) argc ; i++) {
- arg = argv[i];
- if (!strnicmp(arg, "-src=udp://",11)) {
- char *sep;
- arg+=11;
- sep = strchr(arg+6, ':');
- if (sep) {
- input_port = atoi(sep+1);
- sep[0]=0;
- input_ip = gf_strdup(arg);
- sep[0]=':';
- } else {
- input_ip = gf_strdup(arg);
- }
-
- } else if (!strnicmp(arg, "-time=", 6)) {
- run_time = atoi(arg+6);
- } else if (!strnicmp(arg, "-dst-file=", 10)) {
- ts_out = gf_strdup(arg+10);
- } else if (!strnicmp(arg, "-segment-dir=", 13)) {
- segment_dir = gf_strdup(arg+13);
- } else if (!strnicmp(arg, "-segment-duration=", 18)) {
- segment_duration = atoi(arg+18);
- } else if (!strnicmp(arg, "-segment-manifest=", 18)) {
- segment_manifest = gf_strdup(arg+18);
- } else if (!strnicmp(arg, "-segment-http-prefix=", 21)) {
- segment_http_prefix = gf_strdup(arg+21);
- } else if (!strnicmp(arg, "-segment-number=", 16)) {
- segment_number = atoi(arg+16);
- }
- }
- fprintf(stdout, "Listening to TS input on %s:%d\n", input_ip, input_port);
- fprintf(stdout, "Creating %d sec. segments in directory %s\n", segment_duration, segment_dir);
- fprintf(stdout, "Creating %s manifest with %d segments\n", segment_manifest, segment_number);
-
- /*****************/
- /* creation of the input socket */
- /*****************/
- input_udp_sk = gf_sk_new(GF_SOCK_TYPE_UDP);
- if (gf_sk_is_multicast_address((char *)input_ip)) {
- e = gf_sk_setup_multicast(input_udp_sk, (char *)input_ip, input_port, 32, 0, NULL);
- } else {
- e = gf_sk_bind(input_udp_sk, NULL, input_port, (char *)input_ip, input_port, GF_SOCK_REUSE_PORT);
- }
- if (e) {
- fprintf(stdout, "Error initializing UDP socket for %s:%d : %s\n", input_ip, input_port, gf_error_to_string(e));
- goto exit;
- }
- gf_sk_set_buffer_size(input_udp_sk, 0, UDP_BUFFER_SIZE);
- gf_sk_set_block_mode(input_udp_sk, 1);
-
- /*****************/
- /* Initialisation of the TS and Manifest files */
- /*****************/
-
- if (segment_duration) {
- char *dot;
- strcpy(segment_prefix, ts_out);
- dot = strrchr(segment_prefix, '.');
- dot[0] = 0;
- if (segment_dir) {
- if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
- sprintf(segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index);
- } else {
- sprintf(segment_name, "%s%c%s_%d.ts", segment_dir, GF_PATH_SEPARATOR, segment_prefix, segment_index);
- }
- } else {
- sprintf(segment_name, "%s_%d.ts", segment_prefix, segment_index);
- }
- fprintf(stderr, "Processing %s segment\r", segment_name);
- ts_out = gf_strdup(segment_name);
- if (!segment_manifest) {
- sprintf(segment_manifest_default, "%s.m3u8", segment_prefix);
- segment_manifest = segment_manifest_default;
- }
- //write_manifest(segment_manifest, segment_dir, segment_duration, segment_prefix, segment_http_prefix, segment_index, 0, 0);
- }
- ts_output_file = gf_fopen(ts_out, "wb");
- if (!ts_output_file) {
- fprintf(stderr, "Error opening %s\n", ts_out);
- goto exit;
- }
-
- /*allocate data buffer*/
- input_buffer = (char*)gf_malloc(input_buffer_size);
- assert(input_buffer);
-
- /*****************/
- /* main loop */
- /*****************/
- last_segment_time = gf_sys_clock();
- last_segment_size = 0;
- while (1) {
- /*check for some input from the network*/
- if (input_ip) {
- gf_sk_receive(input_udp_sk, input_buffer+leftinbuffer, input_buffer_size-leftinbuffer, 0, &read);
- leftinbuffer += read;
- if (leftinbuffer) {
- fprintf(stderr, "Processing %s segment ... received %d bytes (buffer: %d, segment: %d)\n", segment_name, read, leftinbuffer, last_segment_size);
- if (input_buffer[0] != 0x47) {
- while ((i < leftinbuffer) && (input_buffer[i] != 0x47)) i++;
- fprintf(stderr, "Warning: data in buffer not starting with the MPEG-2 TS sync byte, skipping %d bytes of %d\n", i, leftinbuffer);
- if (i < leftinbuffer) memmove(input_buffer, input_buffer+i, leftinbuffer-i);
- leftinbuffer -=i;
- }
- if ((leftinbuffer % 188) != 0) {
- fprintf(stderr, "Warning: data in buffer with a size (%d bytes) not multiple of 188 bytes\n", leftinbuffer);
- towrite = leftinbuffer - (leftinbuffer % 188);
- } else {
- towrite = leftinbuffer;
- }
- } else {
- towrite = 0;
- }
- /*write to current file */
- if (ts_output_file != NULL) {
- u32 now = gf_sys_clock();
- if (towrite) {
- gf_fwrite(input_buffer, 1, towrite, ts_output_file);
- if (towrite < leftinbuffer) {
- fprintf(stderr, "Warning: wrote %d bytes, keeping %d bytes\n", towrite, (leftinbuffer-towrite));
- memmove(input_buffer, input_buffer+towrite, leftinbuffer-towrite);
- }
- leftinbuffer -= towrite;
- last_segment_size += towrite;
- }
- if ((now - last_segment_time) > segment_duration*1000) {
- last_segment_time = now;
- gf_fclose(ts_output_file);
- fprintf(stderr, "Closing segment %s (%d bytes)\n", segment_name, last_segment_size);
- last_segment_size = 0;
- segment_index++;
- if (segment_dir) {
- if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
- sprintf(segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index);
- } else {
- sprintf(segment_name, "%s%c%s_%d.ts", segment_dir, GF_PATH_SEPARATOR, segment_prefix, segment_index);
- }
- } else {
- sprintf(segment_name, "%s_%d.ts", segment_prefix, segment_index);
- }
- ts_output_file = gf_fopen(segment_name, "wb");
- if (!ts_output_file) {
- fprintf(stderr, "Error opening segment %s\n", segment_name);
- goto exit;
- }
- /* delete the oldest segment */
- if (segment_number && ((s32) (segment_index - segment_number - 1) >= 0)) {
- char old_segment_name[GF_MAX_PATH];
- if (segment_dir) {
- if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
- sprintf(old_segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index - segment_number - 1);
- } else {
- sprintf(old_segment_name, "%s/%s_%d.ts", segment_dir, segment_prefix, segment_index - segment_number - 1);
- }
- } else {
- sprintf(old_segment_name, "%s_%d.ts", segment_prefix, segment_index - segment_number - 1);
- }
- gf_delete_file(old_segment_name);
- fprintf(stderr, "Deleting segment %s\n", old_segment_name);
- }
- write_manifest(segment_manifest, segment_dir, segment_duration, segment_prefix, segment_http_prefix,
- // (segment_index >= segment_number/2 ? segment_index - segment_number/2 : 0), segment_index >1 ? segment_index-1 : 0, 0);
- ( (segment_index > segment_number ) ? segment_index - segment_number : 0), segment_index >1 ? segment_index-1 : 0, 0);
- }
- }
-
- //}
- }
- /*cpu load regulation*/
- gf_sleep(1);
- }
-exit:
- return 0;
-}
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="udptsseg" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
-\r
-CFG=udptsseg - Win32 Debug\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "udptsseg.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "udptsseg.mak" CFG="udptsseg - Win32 Debug"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "udptsseg - Win32 Release" (based on "Win32 (x86) Console Application")\r
-!MESSAGE "udptsseg - Win32 Debug" (based on "Win32 (x86) Console Application")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-RSC=rc.exe\r
-\r
-!IF "$(CFG)" == "udptsseg - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Release"\r
-# PROP BASE Intermediate_Dir "Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD BASE RSC /l 0x40c /d "NDEBUG"\r
-# ADD RSC /l 0x40c /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/udptsseg.exe" /libpath:"../../../extra_lib/lib/w32_rel"\r
-\r
-!ELSEIF "$(CFG)" == "udptsseg - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "Debug"\r
-# PROP BASE Intermediate_Dir "Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c\r
-# ADD BASE RSC /l 0x40c /d "_DEBUG"\r
-# ADD RSC /l 0x40c /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/udptsseg.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"\r
-# SUBTRACT LINK32 /nodefaultlib\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "udptsseg - Win32 Release"\r
-# Name "udptsseg - Win32 Debug"\r
-# Begin Source File\r
-\r
-SOURCE=.\main.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-# End Source File\r
-# End Target\r
-# End Project\r
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
- ProjectType="Visual C++"\r
- Version="8.00"\r
- Name="udptsseg"\r
- ProjectGUID="{540C6736-A386-4E04-ADC8-E28C6FC7DC91}"\r
- >\r
- <Platforms>\r
- <Platform\r
- Name="Win32"\r
- />\r
- </Platforms>\r
- <ToolFiles>\r
- </ToolFiles>\r
- <Configurations>\r
- <Configuration\r
- Name="Debug|Win32"\r
- OutputDirectory=".\Debug"\r
- IntermediateDirectory=".\Debug"\r
- ConfigurationType="1"\r
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"\r
- UseOfMFC="0"\r
- ATLMinimizesCRunTimeLibraryUsage="false"\r
- CharacterSet="2"\r
- >\r
- <Tool\r
- Name="VCPreBuildEventTool"\r
- />\r
- <Tool\r
- Name="VCCustomBuildTool"\r
- />\r
- <Tool\r
- Name="VCXMLDataGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCWebServiceProxyGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCMIDLTool"\r
- TypeLibraryName=".\Debug/udptsseg.tlb"\r
- HeaderFileName=""\r
- />\r
- <Tool\r
- Name="VCCLCompilerTool"\r
- Optimization="0"\r
- AdditionalIncludeDirectories="..\..\include"\r
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;"\r
- MinimalRebuild="true"\r
- BasicRuntimeChecks="3"\r
- RuntimeLibrary="3"\r
- PrecompiledHeaderFile=".\Debug/udptsseg.pch"\r
- AssemblerListingLocation=".\Debug/"\r
- ObjectFile=".\Debug/"\r
- ProgramDataBaseFileName=".\Debug/"\r
- BrowseInformation="1"\r
- WarningLevel="3"\r
- SuppressStartupBanner="true"\r
- DebugInformationFormat="4"\r
- />\r
- <Tool\r
- Name="VCManagedResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCResourceCompilerTool"\r
- PreprocessorDefinitions="_DEBUG"\r
- Culture="1036"\r
- />\r
- <Tool\r
- Name="VCPreLinkEventTool"\r
- />\r
- <Tool\r
- Name="VCLinkerTool"\r
- AdditionalDependencies="odbc32.lib odbccp32.lib"\r
- OutputFile="../../bin/$(PlatformName)/$(ConfigurationName)/udptsseg.exe"\r
- LinkIncremental="2"\r
- SuppressStartupBanner="true"\r
- AdditionalLibraryDirectories="../../../extra_lib/lib/w32_deb"\r
- GenerateDebugInformation="true"\r
- ProgramDatabaseFile=".\Debug/udptsseg.pdb"\r
- SubSystem="1"\r
- TargetMachine="1"\r
- />\r
- <Tool\r
- Name="VCALinkTool"\r
- />\r
- <Tool\r
- Name="VCManifestTool"\r
- />\r
- <Tool\r
- Name="VCXDCMakeTool"\r
- />\r
- <Tool\r
- Name="VCBscMakeTool"\r
- SuppressStartupBanner="true"\r
- OutputFile=".\Debug/udptsseg.bsc"\r
- />\r
- <Tool\r
- Name="VCFxCopTool"\r
- />\r
- <Tool\r
- Name="VCAppVerifierTool"\r
- />\r
- <Tool\r
- Name="VCWebDeploymentTool"\r
- />\r
- <Tool\r
- Name="VCPostBuildEventTool"\r
- />\r
- </Configuration>\r
- <Configuration\r
- Name="Release|Win32"\r
- OutputDirectory=".\Release"\r
- IntermediateDirectory=".\Release"\r
- ConfigurationType="1"\r
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"\r
- UseOfMFC="0"\r
- ATLMinimizesCRunTimeLibraryUsage="false"\r
- CharacterSet="2"\r
- >\r
- <Tool\r
- Name="VCPreBuildEventTool"\r
- />\r
- <Tool\r
- Name="VCCustomBuildTool"\r
- />\r
- <Tool\r
- Name="VCXMLDataGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCWebServiceProxyGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCMIDLTool"\r
- TypeLibraryName=".\Release/udptsseg.tlb"\r
- HeaderFileName=""\r
- />\r
- <Tool\r
- Name="VCCLCompilerTool"\r
- Optimization="2"\r
- InlineFunctionExpansion="1"\r
- AdditionalIncludeDirectories="../../include"\r
- PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE"\r
- StringPooling="true"\r
- RuntimeLibrary="2"\r
- EnableFunctionLevelLinking="true"\r
- PrecompiledHeaderFile=".\Release/udptsseg.pch"\r
- AssemblerListingLocation=".\Release/"\r
- ObjectFile=".\Release/"\r
- ProgramDataBaseFileName=".\Release/"\r
- WarningLevel="3"\r
- SuppressStartupBanner="true"\r
- />\r
- <Tool\r
- Name="VCManagedResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCResourceCompilerTool"\r
- PreprocessorDefinitions="NDEBUG"\r
- Culture="1036"\r
- />\r
- <Tool\r
- Name="VCPreLinkEventTool"\r
- />\r
- <Tool\r
- Name="VCLinkerTool"\r
- AdditionalDependencies="odbc32.lib odbccp32.lib"\r
- OutputFile="../../bin/$(PlatformName)/$(ConfigurationName)/udptsseg.exe"\r
- LinkIncremental="1"\r
- SuppressStartupBanner="true"\r
- AdditionalLibraryDirectories="../../../extra_lib/lib/w32_rel"\r
- ProgramDatabaseFile=".\Release/udptsseg.pdb"\r
- SubSystem="1"\r
- TargetMachine="1"\r
- />\r
- <Tool\r
- Name="VCALinkTool"\r
- />\r
- <Tool\r
- Name="VCManifestTool"\r
- />\r
- <Tool\r
- Name="VCXDCMakeTool"\r
- />\r
- <Tool\r
- Name="VCBscMakeTool"\r
- SuppressStartupBanner="true"\r
- OutputFile=".\Release/udptsseg.bsc"\r
- />\r
- <Tool\r
- Name="VCFxCopTool"\r
- />\r
- <Tool\r
- Name="VCAppVerifierTool"\r
- />\r
- <Tool\r
- Name="VCWebDeploymentTool"\r
- />\r
- <Tool\r
- Name="VCPostBuildEventTool"\r
- />\r
- </Configuration>\r
- </Configurations>\r
- <References>\r
- </References>\r
- <Files>\r
- <File\r
- RelativePath=".\main.c"\r
- >\r
- </File>\r
- </Files>\r
- <Globals>\r
- </Globals>\r
-</VisualStudioProject>\r
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / wave audio render module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <gpac/modules/audio_out.h>
-/*symbian audio stuff*/
-#include <mdaaudiooutputstream.h>
-#include <mda/common/audio.h>
-
-#define EPOC_MAX_BUFFERS 8
-
-enum {
- EPOC_AUDIO_INIT = 0,
- EPOC_AUDIO_OPEN,
- EPOC_AUDIO_PLAY,
- EPOC_AUDIO_ERROR,
-};
-
-class EPOCAudio : public MMdaAudioOutputStreamCallback
-{
-public:
- EPOCAudio();
- virtual ~EPOCAudio();
-
- virtual void MaoscOpenComplete( TInt aError );
- virtual void MaoscBufferCopied( TInt aError, const TDesC8& a_Buffer);
- virtual void MaoscPlayComplete( TInt );
-
- GF_Err Open(u32 sample_rate, Bool stereo);
- void Close(Bool and_wait);
-
- CMdaAudioOutputStream* m_stream;
- TMdaAudioDataSettings m_settings;
- u32 state;
-
- /*desired config*/
- u32 cfg_num_buffers, cfg_total_duration, init_vol, init_pan;
- /*actual config*/
- u32 num_buffers, total_duration, buffer_len;
-
- /*audio buffers*/
- char *buffers[EPOC_MAX_BUFFERS];
- TPtrC8 sent_buffers[EPOC_MAX_BUFFERS];
- u32 buffer_size;
- u32 current_buffer, nb_buffers_queued;
-};
-
-EPOCAudio::EPOCAudio()
-{
- u32 i;
- m_stream = NULL;
- for (i=0; i<EPOC_MAX_BUFFERS; i++) buffers[i] = NULL;
- state = EPOC_AUDIO_INIT;
- num_buffers = 0;
- init_vol = 100;
-}
-
-EPOCAudio::~EPOCAudio()
-{
- if (m_stream) {
- delete m_stream;
- }
-}
-
-GF_Err EPOCAudio::Open(u32 sample_rate, Bool stereo)
-{
- TInt res = 0;
- u32 count;
- TMdaAudioDataSettings::TAudioCaps epoc_sr;
-
-
- switch (sample_rate) {
- case 8000:
- epoc_sr = TMdaAudioDataSettings::ESampleRate8000Hz;
- break;
- case 11025:
- epoc_sr = TMdaAudioDataSettings::ESampleRate11025Hz;
- break;
- case 12000:
- epoc_sr = TMdaAudioDataSettings::ESampleRate12000Hz;
- break;
- case 16000:
- epoc_sr = TMdaAudioDataSettings::ESampleRate16000Hz;
- break;
- case 22050:
- epoc_sr = TMdaAudioDataSettings::ESampleRate22050Hz;
- break;
- case 24000:
- epoc_sr = TMdaAudioDataSettings::ESampleRate24000Hz;
- break;
- case 32000:
- epoc_sr = TMdaAudioDataSettings::ESampleRate32000Hz;
- break;
- case 44100:
- epoc_sr = TMdaAudioDataSettings::ESampleRate44100Hz;
- break;
- case 48000:
- epoc_sr = TMdaAudioDataSettings::ESampleRate48000Hz;
- break;
- default:
- return GF_NOT_SUPPORTED;
- }
-
- state = EPOC_AUDIO_INIT;
-
- gf_sleep(10);
- TRAP(res, m_stream = CMdaAudioOutputStream::NewL(*this) );
- if ((res!=KErrNone) || !m_stream) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOCAudio] Cannot create output audio stream\n"));
- return GF_IO_ERR;
- }
- m_stream->Open(&m_settings);
-
- /*wait for ack - if not getting it in 50*40 = 2sec, abort*/
- count = 50;
- while (count) {
- if (state == EPOC_AUDIO_OPEN) break;
- else if (state == EPOC_AUDIO_ERROR) {
- return GF_IO_ERR;
- }
- gf_sleep(40);
-
- TInt error;
- CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
- count--;
- }
- if (state != EPOC_AUDIO_OPEN) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOCAudio] Failed to open sound device - is it present?\n"));
- return GF_NOT_SUPPORTED;
- }
-
- TRAP(res, m_stream->SetAudioPropertiesL(epoc_sr, stereo ? TMdaAudioDataSettings::EChannelsStereo : TMdaAudioDataSettings::EChannelsMono) );
- m_stream->SetPriority(EPriorityAbsoluteHigh, EMdaPriorityPreferenceTime );
- m_stream->SetVolume(init_vol * m_stream->MaxVolume() / 100);
-
- current_buffer = nb_buffers_queued = 0;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOCAudio] output audio stream ready - sample rate %d - %d channels\n", sample_rate, stereo ? 2 : 1));
- return GF_OK;
-}
-
-void EPOCAudio::Close(Bool and_wait)
-{
- u32 i;
- if (m_stream) {
- if (state==EPOC_AUDIO_PLAY) {
-#if 0
- m_stream->Stop();
-
- while (0 && and_wait) {
-
- if (state != EPOC_AUDIO_PLAY) break;
- gf_sleep(1);
-
- TInt error;
- CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
- }
-#endif
- }
- delete m_stream;
- m_stream = NULL;
- }
- for (i=0; i<num_buffers; i++) {
- if (buffers[i]) gf_free(buffers[i]);
- buffers[i] = NULL;
- }
- num_buffers = 0;
- state = EPOC_AUDIO_INIT;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOCAudio] output audio stream closed\n"));
-}
-
-void EPOCAudio::MaoscOpenComplete(TInt aError)
-{
- if (aError) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOCAudio] Failed to open sound device - error %d\n", aError));
- } else {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOCAudio] Sound device opened\n", aError));
- state = EPOC_AUDIO_OPEN;
- }
-}
-
-void EPOCAudio::MaoscBufferCopied(TInt aError, const TDesC8& a_Buffer)
-{
- assert(nb_buffers_queued);
- nb_buffers_queued--;
- state = nb_buffers_queued ? EPOC_AUDIO_PLAY : EPOC_AUDIO_OPEN;
-}
-
-void EPOCAudio::MaoscPlayComplete(TInt aError)
-{
- if (aError) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOCAudio] Playback stopped due to error %d\n", aError));
- state = EPOC_AUDIO_ERROR;
- } else {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOCAudio] Playback stopped due to user request\n"));
- state = EPOC_AUDIO_OPEN;
- }
-}
-
-
-static GF_Err EAUD_Setup(GF_AudioOutput *dr, void *os_handle, u32 num_buffers, u32 total_duration)
-{
- EPOCAudio *ctx = (EPOCAudio *)dr->opaque;
- ctx->cfg_num_buffers = MAX(num_buffers, EPOC_MAX_BUFFERS);
- ctx->cfg_total_duration = total_duration;
- return GF_OK;
-}
-
-static void EAUD_Shutdown(GF_AudioOutput *dr)
-{
- EPOCAudio *ctx = (EPOCAudio *)dr->opaque;
- ctx->Close(1);
-}
-
-
-/*we assume what was asked is what we got*/
-static GF_Err EAUD_ConfigureOutput(GF_AudioOutput *dr, u32 *SampleRate, u32 *NbChannels, u32 *nbBitsPerSample, u32 channel_cfg)
-{
- u32 snd_align, bps, i;
- GF_Err e;
- EPOCAudio *ctx = (EPOCAudio *)dr->opaque;
-
- ctx->Close(1);
-
- *nbBitsPerSample = 16;
- if (*NbChannels > 2) *NbChannels = 2;
-
- e = ctx->Open(*SampleRate, (*NbChannels ==2) ? 1 : 0);
- if (e) return e;
-
- snd_align = *NbChannels * 2;
- bps = snd_align **SampleRate;
-
- if (ctx->cfg_total_duration) {
- ctx->num_buffers = ctx->cfg_num_buffers;
- ctx->buffer_size = (bps*ctx->cfg_total_duration/1000) / ctx->num_buffers;
- } else {
- ctx->num_buffers = 4;
- /*use 25 ms buffers*/
- ctx->buffer_size = bps / 40;
- }
- ctx->buffer_size /= snd_align;
- ctx->buffer_size *= snd_align;
-
- ctx->buffer_len = ctx->buffer_size * 1000 / bps;
- ctx->total_duration = ctx->buffer_len * ctx->num_buffers;
-
- for (i=0; i<ctx->num_buffers; i++) {
- ctx->buffers[i] = (char *)gf_malloc(sizeof(char)*ctx->buffer_size);
- }
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOCAudio] Output audio stream configured - %d buffers of %d ms each\n", ctx->num_buffers, ctx->buffer_len));
-
- return GF_OK;
-}
-
-static void EAUD_WriteAudio(GF_AudioOutput *dr)
-{
- EPOCAudio *ctx = (EPOCAudio *)dr->opaque;
-
- /*no buffers available...*/
- if (ctx->nb_buffers_queued == ctx->num_buffers) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOCAudio] Audio queue full - yielding to app\n"));
- User::After(0);
- TInt error;
- CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
- return;
- }
-
- while (ctx->nb_buffers_queued < ctx->num_buffers) {
- u32 written = dr->FillBuffer(dr->audio_renderer, ctx->buffers[ctx->current_buffer], ctx->buffer_size);
- //GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOCAudio] Filling audio buffer %d / %d\n", ctx->current_buffer, ctx->num_buffers));
- if (!written) return;
-
- ctx->sent_buffers[ctx->current_buffer].Set((const TText8 *) ctx->buffers[ctx->current_buffer], written);
-
- ctx->nb_buffers_queued++;
- ctx->m_stream->WriteL(ctx->sent_buffers[ctx->current_buffer]);
- ctx->current_buffer = (ctx->current_buffer + 1) % ctx->num_buffers;
- }
-}
-
-static void EAUD_Play(GF_AudioOutput *dr, u32 PlayType)
-{
-}
-
-static void EAUD_SetVolume(GF_AudioOutput *dr, u32 Volume)
-{
- EPOCAudio *ctx = (EPOCAudio *)dr->opaque;
- ctx->init_vol = Volume;
- if (ctx->m_stream)
- ctx->m_stream->SetVolume(ctx->init_vol * ctx->m_stream->MaxVolume() / 100);
-}
-
-static void EAUD_SetPan(GF_AudioOutput *dr, u32 Pan)
-{
-}
-
-
-static GF_Err EAUD_QueryOutputSampleRate(GF_AudioOutput *dr, u32 *desired_samplerate, u32 *NbChannels, u32 *nbBitsPerSample)
-{
- *nbBitsPerSample = 16;
- if (*NbChannels > 2) *NbChannels = 2;
- return GF_OK;
-}
-
-static u32 EAUD_GetAudioDelay(GF_AudioOutput *dr)
-{
- EPOCAudio *ctx = (EPOCAudio *)dr->opaque;
- return ctx->current_buffer*ctx->buffer_len;
-}
-
-static u32 EAUD_GetTotalBufferTime(GF_AudioOutput *dr)
-{
- EPOCAudio *ctx = (EPOCAudio *)dr->opaque;
- return ctx->total_duration;
-}
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void *EPOC_aout_new()
-{
- GF_AudioOutput *driv;
- driv = (GF_AudioOutput *) gf_malloc(sizeof(GF_AudioOutput));
- memset(driv, 0, sizeof(GF_AudioOutput));
- GF_REGISTER_MODULE_INTERFACE(driv, GF_AUDIO_OUTPUT_INTERFACE, "EPOC Audio Output", "gpac distribution")
-
- driv->Setup = EAUD_Setup;
- driv->Shutdown = EAUD_Shutdown;
- driv->ConfigureOutput = EAUD_ConfigureOutput;
- driv->GetAudioDelay = EAUD_GetAudioDelay;
- driv->GetTotalBufferTime = EAUD_GetTotalBufferTime;
- driv->SetVolume = EAUD_SetVolume;
- driv->SetPan = EAUD_SetPan;
- driv->Play = EAUD_Play;
- driv->QueryOutputSampleRate = EAUD_QueryOutputSampleRate;
- driv->WriteAudio = EAUD_WriteAudio;
-
- driv->SelfThreaded = 0;
- driv->opaque = new EPOCAudio();
-
- return driv;
-}
-
-void EPOC_aout_del(void *ifce)
-{
- GF_AudioOutput *dr = (GF_AudioOutput *) ifce;
- EPOCAudio *ctx = (EPOCAudio*)dr->opaque;
- delete ctx;
- gf_free(dr);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / AAC reader module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <gpac/modules/codec.h>
-#include <gpac/constants.h>
-#include <gpac/avparse.h>
-
-#include <mmf/server/mmfcodec.h>
-#include <mmf/plugin/mmfcodecimplementationuids.hrh>
-
-#define KMMFFourCCCodeEAACP 0x43414520 // ' ' 'E' 'A' 'C'
-
-#if defined(__SYMBIAN32__) && !defined(__SERIES60_3X__)
-//codec configuration UID
-#define KUidMmfCodecAudioSettings 0x10203622
-#endif
-
-enum
-{
- GF_EPOC_HAS_AMR = 1,
- GF_EPOC_HAS_AMR_WB = 1<<1,
- GF_EPOC_HAS_AAC = 1<<2,
- GF_EPOC_HAS_HEAAC = 1<<3,
- GF_EPOC_HAS_MP3 = 1<<4,
-};
-
-typedef struct
-{
- u32 caps;
- Bool is_audio;
-
- u32 sample_rate, out_size, num_samples;
- u8 num_channels;
-
- const char *codec_name;
- CMMFCodec *dec;
-
- CMMFPtrBuffer *mmf_in, *mmf_out;
- TPtr8 ptr_in, ptr_out;
-} EPOCCodec;
-
-static void EDEC_LoadCaps(GF_BaseDecoder *ifcg)
-{
- EPOCCodec *ctx = (EPOCCodec *)ifcg->privateStack;
- CMMFCodec *codec = NULL;
- TInt err;
-
- ctx->caps = 0;
- /*AMR*/
- TRAP(err, codec = CMMFCodec::NewL(KMMFFourCCCodeAMR, KMMFFourCCCodePCM16));
- if (err==KErrNone) {
- ctx->caps |= GF_EPOC_HAS_AMR;
- delete codec;
- }
- /*AMR-WB*/
- TRAP(err, codec = CMMFCodec::NewL(KMMFFourCCCodeAWB, KMMFFourCCCodePCM16));
- if (err==KErrNone) {
- ctx->caps |= GF_EPOC_HAS_AMR_WB;
- delete codec;
- }
- /*AAC*/
- TRAP(err, codec = CMMFCodec::NewL(KMMFFourCCCodeAAC, KMMFFourCCCodePCM16));
- if (err==KErrNone) {
- ctx->caps |= GF_EPOC_HAS_AAC;
- delete codec;
- }
- /*HE-AAC*/
- TRAP(err, codec = CMMFCodec::NewL(KMMFFourCCCodeEAACP, KMMFFourCCCodePCM16));
- if (err==KErrNone) {
- ctx->caps |= GF_EPOC_HAS_HEAAC;
- delete codec;
- }
-
- /*MP3*/
- TRAP(err, codec = CMMFCodec::NewL(KMMFFourCCCodeMP3, KMMFFourCCCodePCM16));
- if (err==KErrNone) {
- ctx->caps |= GF_EPOC_HAS_MP3;
- delete codec;
- }
-
-}
-
-
-static GF_Err EDEC_AttachStream(GF_BaseDecoder *ifcg, GF_ESD *esd)
-{
- RArray<TInt> configParams;
- GF_M4ADecSpecInfo a_cfg;
- Bool aac_sbr_upsample;
- TInt err;
- EPOCCodec *ctx = (EPOCCodec *)ifcg->privateStack;
- if (esd->dependsOnESID) return GF_NOT_SUPPORTED;
- if (ctx->dec) return GF_BAD_PARAM;
-
-
- /*audio decs*/
- switch (esd->decoderConfig->objectTypeIndication) {
- /*MPEG2 aac*/
- case GPAC_OTI_AUDIO_AAC_MPEG2_MP:
- case GPAC_OTI_AUDIO_AAC_MPEG2_LCP:
- case GPAC_OTI_AUDIO_AAC_MPEG2_SSRP:
- /*MPEG4 aac*/
- case GPAC_OTI_AUDIO_AAC_MPEG4:
- if (!esd->decoderConfig->decoderSpecificInfo || !esd->decoderConfig->decoderSpecificInfo->data) return GF_NON_COMPLIANT_BITSTREAM;
- if (gf_m4a_get_config(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, &a_cfg) != GF_OK) return GF_NON_COMPLIANT_BITSTREAM;
-
- aac_sbr_upsample = 0;
-#if !defined(__SYMBIAN32__) || defined(__SERIES60_3X__)
- if (a_cfg.has_sbr && (ctx->caps & GF_EPOC_HAS_HEAAC)) {
- TRAP(err, ctx->dec = CMMFCodec::NewL(KMMFFourCCCodeEAACP, KMMFFourCCCodePCM16));
- if (err != KErrNone) {
- a_cfg.has_sbr = 0;
- goto retry_no_sbr;
- }
- aac_sbr_upsample = (a_cfg.base_sr<=24000) ? 1 : 0;
-
- configParams.Append(a_cfg.base_sr); // 0: Input Sample Frequency
- configParams.Append(a_cfg.nb_chan); // 1: Num Channels [1|2]
- configParams.Append(1); // 2: Input Profile Object type [1 - LC, 3 - LTP]
- configParams.Append(aac_sbr_upsample ? 2048 : 1024); // 3: Output Frame Size
- configParams.Append(1024); // 4: Input Frame Len [1024, 960]
- configParams.Append(a_cfg.base_sr); // 5: Input Sample Rate
- configParams.Append(0); // 6: 0
- configParams.Append(aac_sbr_upsample ? 0 : 1); // 7: Down Sample Mode [0|1]
- configParams.Append(16); // 8: Sample resolution, 8Khz (8-bit PCM) or 16Khz (16-bit)
- configParams.Append(a_cfg.sbr_sr); // 9: Output Sample Frequency
- configParams.Append(5); // 10: Extension Object Type
-
- TRAP(err, ctx->dec->ConfigureL(TUid::Uid(KUidMmfCodecAudioSettings), (TDesC8&) configParams));
- if (err != KErrNone) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[EPOC Decoder] Failed to configure HE-AAC decoder (error %d) - retrying with AAC\n", err));
- configParams.Reset();
- goto retry_no_sbr;
- }
- ctx->codec_name = "EPOC HE-AAC Decoder";
- ctx->num_channels = a_cfg.nb_chan;
- ctx->num_samples = aac_sbr_upsample ? 2048 : 1024;
- ctx->sample_rate = a_cfg.sbr_sr;
- } else
-#endif
- {
-retry_no_sbr:
- TRAP(err, ctx->dec = CMMFCodec::NewL(KMMFFourCCCodeAAC, KMMFFourCCCodePCM16));
- if (err != KErrNone) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[EPOC Decoder] Unable to load native codec: error %d\n", err));
- return GF_IO_ERR;
- }
- configParams.Append(a_cfg.base_sr); // Input Sample Rate
- configParams.Append(a_cfg.nb_chan); // Num Channels [1|2]
- configParams.Append((a_cfg.base_object_type==GF_M4A_AAC_LC) ? 1 : 3); // AAC Input Profile [1 - LC, 3 - LTP]
- configParams.Append(1024); // Input Frame Len [1024, 960]
- configParams.Append(0); // AAC Down Mixing [0-none | 1 mono | 2 stereo]
- configParams.Append(0); // Aac output channels selection {0 - none, 1 - 1, 2 - 2}
- configParams.Append(0); // Aac decimation factor {0 - none, 2 - decimation by 2, 4 - decimation by 4}
- configParams.Append(0); // Aac concealment - It can be {0 - none, 1 - basic}
- configParams.Append(16); // Sample resolution - It can be {16 - 16-bit resolution}
- configParams.Append(0); // Sample Rate Conversion 0 : none
-
- TRAP(err, ctx->dec->ConfigureL(TUid::Uid(KUidMmfCodecAudioSettings), (TDesC8&) configParams));
- if (err != KErrNone) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[EPOC Decoder] Failed to configure AAC decoder (error %d)\n", err));
- return GF_NON_COMPLIANT_BITSTREAM;
- }
- ctx->codec_name = "EPOC AAC Decoder";
- ctx->num_channels = a_cfg.nb_chan;
- ctx->num_samples = 1024;
- ctx->sample_rate = a_cfg.base_sr;
- }
- ctx->out_size = ctx->num_channels * ctx->num_samples * 2;
- break;
- /*non-mpeg4 codecs*/
- case GPAC_OTI_MEDIA_GENERIC:
- if (!esd->decoderConfig->decoderSpecificInfo || esd->decoderConfig->decoderSpecificInfo->dataLength<4) return GF_BAD_PARAM;
- if (!strnicmp(esd->decoderConfig->decoderSpecificInfo->data, "samr", 4) || !strnicmp(esd->decoderConfig->decoderSpecificInfo->data, "amr ", 4)) {
- TRAP(err, ctx->dec = CMMFCodec::NewL(KMMFFourCCCodeAMR, KMMFFourCCCodePCM16));
- if (err != KErrNone) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[EPOC Decoder] Unable to load native codec: error %d\n", err));
- return GF_IO_ERR;
- }
- ctx->is_audio = 1;
- ctx->num_channels = 1;
- ctx->num_samples = 160;
- ctx->sample_rate = 8000;
- ctx->out_size = ctx->num_channels * ctx->num_samples * 2;
- ctx->codec_name = "EPOC AMR Decoder";
- }
- else if (!strnicmp(esd->decoderConfig->decoderSpecificInfo->data, "sawb", 4)) {
- TRAP(err, ctx->dec = CMMFCodec::NewL(KMMFFourCCCodeAWB, KMMFFourCCCodePCM16));
- if (err != KErrNone) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[EPOC Decoder] Unable to load native codec: error %d\n", err));
- return GF_IO_ERR;
- }
- ctx->is_audio = 1;
- ctx->num_channels = 1;
- ctx->num_samples = 320;
- ctx->sample_rate = 16000;
- ctx->out_size = ctx->num_channels * ctx->num_samples * 2;
- ctx->codec_name = "EPOC AMR-Wideband Decoder";
- }
- break;
- default:
- return GF_BAD_PARAM;
- }
-
- ctx->mmf_in = CMMFPtrBuffer::NewL();
- ctx->mmf_out = CMMFPtrBuffer::NewL();
-
- return GF_OK;
-}
-
-static GF_Err EDEC_DetachStream(GF_BaseDecoder *ifcg, u16 ES_ID)
-{
- EPOCCodec *ctx = (EPOCCodec *)ifcg->privateStack;
-
- if (ctx->mmf_in) {
- delete ctx->mmf_in;
- ctx->mmf_in = NULL;
- }
- if (ctx->mmf_out) {
- delete ctx->mmf_out;
- ctx->mmf_out = NULL;
- }
- if (ctx->dec) {
- delete ctx->dec;
- ctx->dec = NULL;
- }
- return GF_OK;
-}
-static GF_Err EDEC_GetCapabilities(GF_BaseDecoder *ifcg, GF_CodecCapability *capability)
-{
- EPOCCodec *ctx = (EPOCCodec *)ifcg->privateStack;
-
- switch (capability->CapCode) {
- /*not tested yet*/
- case GF_CODEC_RESILIENT:
- capability->cap.valueInt = 1;
- break;
- case GF_CODEC_OUTPUT_SIZE:
- capability->cap.valueInt = ctx->out_size;
- break;
- case GF_CODEC_SAMPLERATE:
- capability->cap.valueInt = ctx->sample_rate;
- break;
- case GF_CODEC_NB_CHAN:
- capability->cap.valueInt = ctx->num_channels;
- break;
- case GF_CODEC_BITS_PER_SAMPLE:
- capability->cap.valueInt = 16;
- break;
- case GF_CODEC_BUFFER_MIN:
- capability->cap.valueInt = 4;
- break;
- case GF_CODEC_BUFFER_MAX:
- capability->cap.valueInt = 12;
- break;
- case GF_CODEC_CU_DURATION:
- capability->cap.valueInt = ctx->num_samples;
- break;
- /*to refine, it seems that 4 bytes padding is not enough on all streams ?*/
- case GF_CODEC_PADDING_BYTES:
- capability->cap.valueInt = 4;
- break;
- case GF_CODEC_CHANNEL_CONFIG:
- capability->cap.valueInt = (ctx->num_channels==1) ? GF_AUDIO_CH_FRONT_CENTER : (GF_AUDIO_CH_FRONT_LEFT | GF_AUDIO_CH_FRONT_RIGHT);
- break;
- default:
- capability->cap.valueInt = 0;
- break;
- }
- return GF_OK;
-}
-static GF_Err EDEC_SetCapabilities(GF_BaseDecoder *ifcg, GF_CodecCapability capability)
-{
- /*return unsupported to avoid confusion by the player (like SR changing ...) */
- return GF_NOT_SUPPORTED;
-}
-
-
-static GF_Err EDEC_ProcessData(GF_MediaDecoder *ifcg,
- char *inBuffer, u32 inBufferLength,
- u16 ES_ID, u32 *CTS,
- char *outBuffer, u32 *outBufferLength,
- u8 PaddingBits, u32 mmlevel)
-{
- TCodecProcessResult res;
- EPOCCodec *ctx = (EPOCCodec *)ifcg->privateStack;
-
- if (*outBufferLength < ctx->out_size) {
- *outBufferLength = ctx->out_size;
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("AMR buffer too small\n"));
- return GF_BUFFER_TOO_SMALL;
- }
-
- ctx->ptr_in.Set((TUint8*)inBuffer, inBufferLength, inBufferLength);
- ctx->mmf_in->SetPtr(ctx->ptr_in);
- ctx->ptr_out.Set((TUint8*)outBuffer, *outBufferLength, *outBufferLength);
- ctx->mmf_out->SetPtr(ctx->ptr_out);
-
- TRAPD(e, res = ctx->dec->ProcessL(*ctx->mmf_in, *ctx->mmf_out));
- if (res.iStatus==TCodecProcessResult::EProcessError) {
- GF_LOG(GF_LOG_WARNING, GF_LOG_CODEC, ("[EPOC Decoder] Decode failed - error %d\n", res.iStatus));
- return GF_NON_COMPLIANT_BITSTREAM;
- }
-
- return GF_OK;
-}
-
-static const char *EDEC_GetCodecName(GF_BaseDecoder *ifcg)
-{
- EPOCCodec *ctx = (EPOCCodec *)ifcg->privateStack;
- return ctx->codec_name;
-}
-
-static u32 EDEC_CanHandleStream(GF_BaseDecoder *ifcg, u32 StreamType, GF_ESD *esd, u8 PL)
-{
- char *dsi;
- GF_M4ADecSpecInfo a_cfg;
- EPOCCodec *ctx = (EPOCCodec *)ifcg->privateStack;
-
- /*audio decs*/
- if (StreamType == GF_STREAM_AUDIO) {
- /*media type query*/
- if (!esd) return GF_CODEC_STREAM_TYPE_SUPPORTED;
- dsi = esd->decoderConfig->decoderSpecificInfo ? esd->decoderConfig->decoderSpecificInfo->data : NULL;
- switch (esd->decoderConfig->objectTypeIndication) {
- /*MPEG2 aac*/
- case GPAC_OTI_AUDIO_AAC_MPEG2_MP:
- case GPAC_OTI_AUDIO_AAC_MPEG2_LCP:
- case GPAC_OTI_AUDIO_AAC_MPEG2_SSRP:
- /*MPEG4 aac*/
- case GPAC_OTI_AUDIO_AAC_MPEG4:
- if (!dsi) return GF_CODEC_NOT_SUPPORTED;
- if (gf_m4a_get_config(dsi, esd->decoderConfig->decoderSpecificInfo->dataLength, &a_cfg) != GF_OK) return GF_CODEC_MAYBE_SUPPORTED;
- switch (a_cfg.base_object_type) {
- /*only LTP and LC supported*/
- case GF_M4A_AAC_LC:
- case GF_M4A_AAC_LTP:
- if ((ctx->caps & GF_EPOC_HAS_AAC) || (ctx->caps & GF_EPOC_HAS_HEAAC) ) return GF_CODEC_SUPPORTED;
- default:
- break;
- }
- break;
- /*MPEG1 audio*/
- case GPAC_OTI_AUDIO_MPEG2_PART3:
- /*MPEG2 audio*/
- case GPAC_OTI_AUDIO_MPEG1:
- /* NOT SUPPORTED YET if (ctx->caps & GF_EPOC_HAS_MP3) return 1; */
- break;
- /*non-mpeg4 codecs*/
- case GPAC_OTI_MEDIA_GENERIC:
- if (!dsi) return GF_CODEC_NOT_SUPPORTED;
- if (esd->decoderConfig->decoderSpecificInfo->data < 4) return GF_CODEC_NOT_SUPPORTED;
- if (!strnicmp(dsi, "samr", 4) || !strnicmp(dsi, "amr ", 4)) {
- if (ctx->caps & GF_EPOC_HAS_AMR) return GF_CODEC_SUPPORTED;
- }
- if (!strnicmp(dsi, "sawb", 4)) {
- if (ctx->caps & GF_EPOC_HAS_AMR_WB) return GF_CODEC_SUPPORTED;
- }
- break;
- default:
- return GF_CODEC_NOT_SUPPORTED;
- }
- }
- return GF_CODEC_NOT_SUPPORTED;
-}
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-GF_BaseDecoder *EPOC_codec_new()
-{
- GF_MediaDecoder *ifce;
- EPOCCodec *ctx;
-
- GF_SAFEALLOC(ifce, GF_MediaDecoder);
- GF_REGISTER_MODULE_INTERFACE(ifce, GF_MEDIA_DECODER_INTERFACE, "EPOC Native Decoder", "gpac distribution")
-
- GF_SAFEALLOC(ctx, EPOCCodec);
- ifce->privateStack = ctx;
-
- /*setup our own interface*/
- ifce->AttachStream = EDEC_AttachStream;
- ifce->DetachStream = EDEC_DetachStream;
- ifce->GetCapabilities = EDEC_GetCapabilities;
- ifce->SetCapabilities = EDEC_SetCapabilities;
- ifce->ProcessData = EDEC_ProcessData;
- ifce->CanHandleStream = EDEC_CanHandleStream;
- ifce->GetName = EDEC_GetCodecName;
- EDEC_LoadCaps((GF_BaseDecoder*)ifce);
- return (GF_BaseDecoder *) ifce;
-}
-
-void EPOC_codec_del(GF_BaseDecoder *ifcg)
-{
- EPOCCodec *ctx = (EPOCCodec *)ifcg->privateStack;
-
- gf_free(ctx);
- gf_free(ifcg);
-}
-
-
-#ifdef __cplusplus
-}
-#endif
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / EPOC video output module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*driver interface*/
-#include <gpac/modules/video_out.h>
-#include <gpac/modules/audio_out.h>
-#include <gpac/modules/codec.h>
-
-#include <w32std.h>
-
-#ifdef GPAC_USE_GLES1X
-#include <GLES/egl.h>
-#endif
-
-typedef struct
-{
- RWindow *window;
- RWsSession *session;
-
- u32 pixel_format, bpp, width, height;
- CWsScreenDevice *screen;
- CFbsBitmap *surface;
- CWindowGc *gc;
-
- char *locked_data;
- u32 output_3d_type;
-
-#ifdef GPAC_USE_GLES1X
- EGLDisplay egl_display;
- EGLSurface egl_surface;
- EGLContext egl_context;
-#endif
-
-} EPOCVideo;
-
-
-static void EVID_ResetSurface(GF_VideoOutput *dr, Bool gl_only)
-{
- EPOCVideo *ctx = (EPOCVideo *)dr->opaque;
-
-#ifdef GPAC_USE_GLES1X
- if (ctx->egl_display) {
- eglMakeCurrent(ctx->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- if (ctx->egl_context) eglDestroyContext(ctx->egl_display, ctx->egl_context);
- ctx->egl_context = NULL;
- if (ctx->egl_surface) eglDestroySurface(ctx->egl_display, ctx->egl_surface);
- ctx->egl_surface = NULL;
- eglTerminate(ctx->egl_display);
- ctx->egl_display = NULL;
- }
-#endif
- if (gl_only) return;
-
- if (ctx->locked_data) ctx->surface->UnlockHeap();
- ctx->locked_data = NULL;
- if (ctx->surface) delete ctx->surface;
- ctx->surface = NULL;
- if (ctx->gc) delete ctx->gc;
- ctx->gc = NULL;
- if (ctx->screen) delete ctx->screen;
- ctx->screen = NULL;
-}
-
-static GF_Err EVID_InitSurface(GF_VideoOutput *dr)
-{
- TInt gl_buffer_size;
- TInt e;
- TDisplayMode disp_mode;
- TSize s;
- EPOCVideo *ctx = (EPOCVideo *)dr->opaque;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Reseting video\n"));
- EVID_ResetSurface(dr, 0);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Video reset OK\n"));
-
- ctx->screen = new CWsScreenDevice(*ctx->session);
- if (!ctx->screen) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot create screen device for session\n"));
- return GF_IO_ERR;
- }
- e = ctx->screen->Construct();
- if (e != KErrNone) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot construct screen device for session - error %d\n", e));
- return GF_IO_ERR;
- }
- e = ctx->screen->CreateContext(ctx->gc);
- if (e != KErrNone) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot create graphical context - error %d\n", e));
- return GF_IO_ERR;
- }
-
- ctx->surface = new CFbsBitmap();
- if (!ctx->surface) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot allocate backbuffer surface\n"));
- return GF_IO_ERR;
- }
-
- s = ctx->window->Size();
- disp_mode = ctx->screen->DisplayMode();
- e = ctx->surface->Create(s, disp_mode);
- if (e != KErrNone) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot create backbuffer surface - error %d\n", e));
- return GF_IO_ERR;
- }
-
- gl_buffer_size = 0;
- switch (disp_mode) {
- case EGray256:
- ctx->pixel_format = GF_PIXEL_GREYSCALE;
- ctx->bpp = 1;
- break;
- case EColor64K:
- ctx->pixel_format = GF_PIXEL_RGB_565;
- ctx->bpp = 2;
- gl_buffer_size = 16;
- break;
- case EColor16M:
- ctx->pixel_format = GF_PIXEL_RGB_24;
- ctx->bpp = 3;
- gl_buffer_size = 24;
- break;
- /** 4096 colour display (12 bpp). */
- case EColor4K:
- ctx->pixel_format = GF_PIXEL_RGB_444;
- ctx->bpp = 2;
- gl_buffer_size = 12;
- break;
- /** True colour display mode (32 bpp, but top byte is unused and unspecified) */
- case EColor16MU:
- ctx->pixel_format = GF_PIXEL_RGB_32;
- ctx->bpp = 4;
- gl_buffer_size = 32;
- break;
-#if defined(__SERIES60_3X__)
- /** Display mode with alpha (24bpp colour plus 8bpp alpha) */
- case EColor16MA:
- ctx->pixel_format = GF_PIXEL_ARGB;
- ctx->bpp = 4;
- gl_buffer_size = 32;
- break;
-#endif
- default:
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Unsupported display type %d\n", disp_mode));
- return GF_NOT_SUPPORTED;
- }
- ctx->width = s.iWidth;
- ctx->height = s.iHeight;
-
-#ifdef GPAC_USE_GLES1X
- if (ctx->output_3d_type==1) {
- if (!gl_buffer_size) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Display mode not supported by OpenGL\n"));
- return GF_IO_ERR;
- }
- ctx->egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- if (ctx->egl_display == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot open OpenGL display\n"));
- return GF_IO_ERR;
- }
-
- if (eglInitialize(ctx->egl_display, NULL, NULL) == EGL_FALSE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot initialize OpenGL display\n"));
- return GF_IO_ERR;
- }
- EGLConfig *configList = NULL;
- EGLint numOfConfigs = 0;
- EGLint configSize = 0;
- if (eglGetConfigs(ctx->egl_display, configList, configSize, &numOfConfigs) == EGL_FALSE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot retrieve OpenGL configurations\n"));
- return GF_IO_ERR;
- }
- configSize = numOfConfigs;
- configList = (EGLConfig*) gf_malloc(sizeof(EGLConfig)*configSize);
-
- // Define properties for the wanted EGLSurface
- EGLint atts[7];
- const char *opt = gf_opts_get_key("core", "gl-bits-depth");
-
- atts[0] = EGL_BUFFER_SIZE;
- atts[1] = gl_buffer_size;
- atts[2] = EGL_DEPTH_SIZE;
- atts[3] = opt ? atoi(opt) : 16;
- atts[4] = EGL_SURFACE_TYPE;
- atts[5] = EGL_PIXMAP_BIT;
- atts[6] = EGL_NONE;
-
- if (eglChooseConfig(ctx->egl_display, atts, configList, configSize, &numOfConfigs) == EGL_FALSE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot choose OpenGL configuration\n"));
- return GF_IO_ERR;
- }
- EGLConfig gl_cfg = configList[0];
- gf_free(configList);
-
- ctx->egl_surface = eglCreatePixmapSurface(ctx->egl_display, gl_cfg, ctx->surface, NULL);
- if (ctx->egl_surface == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot create OpenGL surface\n"));
- return GF_IO_ERR;
- }
- ctx->egl_context = eglCreateContext(ctx->egl_display, gl_cfg, EGL_NO_CONTEXT, NULL);
- if (ctx->egl_context == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot create OpenGL context\n"));
- return GF_IO_ERR;
- }
- if (eglMakeCurrent(ctx->egl_display, ctx->egl_surface, ctx->egl_surface, ctx->egl_context) == EGL_FALSE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot bind OpenGL context to current thread\n"));
- return GF_IO_ERR;
- }
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Video OpenGL setup\n"));
- }
-
-#endif
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Video setup OK - %d x %d @ PixelFormat %s\n", ctx->width, ctx->height, gf_4cc_to_str(ctx->pixel_format) ));
- return GF_OK;
-}
-
-#ifdef GPAC_USE_GLES1X
-
-static GF_Err EVID_SetupOGL_ES_Offscreen(GF_VideoOutput *dr, u32 width, u32 height)
-{
- EPOCVideo *ctx = (EPOCVideo *)dr->opaque;
- EVID_ResetSurface(dr, 1);
- if (!ctx->screen) return GF_NOT_SUPPORTED;
-
- TDisplayMode disp_mode = ctx->screen->DisplayMode();
- TInt gl_buffer_size = 0;
- switch (disp_mode) {
- case EColor64K:
- gl_buffer_size = 16;
- break;
- case EColor16M:
- gl_buffer_size = 24;
- break;
- /** 4096 colour display (12 bpp). */
- case EColor4K:
- gl_buffer_size = 12;
- break;
- /** True colour display mode (32 bpp, but top byte is unused and unspecified) */
- case EColor16MU:
- gl_buffer_size = 32;
- break;
-#if defined(__SERIES60_3X__)
- /** Display mode with alpha (24bpp colour plus 8bpp alpha) */
- case EColor16MA:
- gl_buffer_size = 32;
- break;
-#endif
- case EGray256:
- default:
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Unsupported display type %d for OpenGL\n", disp_mode));
- return GF_NOT_SUPPORTED;
- }
-
- ctx->egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- if (ctx->egl_display == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot open OpenGL display\n"));
- return GF_IO_ERR;
- }
-
- if (eglInitialize(ctx->egl_display, NULL, NULL) == EGL_FALSE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot initialize OpenGL display\n"));
- return GF_IO_ERR;
- }
-
- EGLConfig *configList = NULL;
- EGLint numOfConfigs = 0;
- EGLint configSize = 0;
- if (eglGetConfigs(ctx->egl_display, configList, configSize, &numOfConfigs) == EGL_FALSE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot retrieve OpenGL configurations\n"));
- return GF_IO_ERR;
- }
- configSize = numOfConfigs;
- configList = (EGLConfig*) gf_malloc(sizeof(EGLConfig)*configSize);
-
- // Define properties for the wanted EGLSurface
- EGLint atts[13];
- const char *opt = gf_opts_get_key("core", "gl-bits-depth");
- atts[0] = EGL_RED_SIZE;
- atts[1] = 8;
- atts[2] = EGL_GREEN_SIZE;
- atts[3] = 8;
- atts[4] = EGL_BLUE_SIZE;
- atts[5] = 8;
- atts[6] = EGL_ALPHA_SIZE;
- atts[7] = (dr->hw_caps & GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA) ? 8 : EGL_DONT_CARE;
- atts[8] = EGL_SURFACE_TYPE;
- atts[9] = EGL_PBUFFER_BIT;
- atts[10] = EGL_DEPTH_SIZE;
- atts[11] = opt ? atoi(opt) : 16;
- atts[12] = EGL_NONE;
-
- if (eglChooseConfig(ctx->egl_display, atts, configList, configSize, &numOfConfigs) == EGL_FALSE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot choose Offscreen OpenGL configuration\n"));
- return GF_IO_ERR;
- }
- EGLConfig gl_cfg = configList[0];
- gf_free(configList);
-
- atts[0] = EGL_WIDTH;
- atts[1] = width;
- atts[2] = EGL_HEIGHT;
- atts[3] = height;
- atts[4] = EGL_NONE;
-
- ctx->egl_surface = eglCreatePbufferSurface(ctx->egl_display, gl_cfg, atts);
- if (ctx->egl_surface == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot create OpenGL Pbuffer\n"));
- return GF_IO_ERR;
- }
- ctx->egl_context = eglCreateContext(ctx->egl_display, gl_cfg, EGL_NO_CONTEXT, NULL);
- if (ctx->egl_context == NULL) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot create Offscreen OpenGL context\n"));
- return GF_IO_ERR;
- }
- if (eglMakeCurrent(ctx->egl_display, ctx->egl_surface, ctx->egl_surface, ctx->egl_context) == EGL_FALSE) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[EPOC Video] Cannot bind Offscreen OpenGL context to current thread\n"));
- return GF_IO_ERR;
- }
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Offscreen OpenGL setup - size %d x %d\n", width, height));
- return GF_OK;
-}
-#endif
-
-
-static GF_Err EVID_Setup(GF_VideoOutput *dr, void *os_handle, void *os_display, u32 init_flags)
-{
- GF_Err res;
- EPOCVideo *ctx = (EPOCVideo *)dr->opaque;
-
- ctx->window = (RWindow *)os_handle;
- ctx->session = (RWsSession *)os_display;
-
- res = EVID_InitSurface(dr);
-
- /*setup opengl offscreen*/
-#ifdef GPAC_USE_GLES1X
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Querying Offscreen OpenGL Capabilities\n"));
- dr->hw_caps |= GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;
- GF_Err e = EVID_SetupOGL_ES_Offscreen(dr, 20, 20);
- if (e!=GF_OK) {
- dr->hw_caps &= ~GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;
- e = EVID_SetupOGL_ES_Offscreen(dr, 20, 20);
- }
- if (!e) {
- dr->hw_caps |= GF_VIDEO_HW_OPENGL_OFFSCREEN;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Offscreen OpenGL available - alpha support: %s\n", (dr->hw_caps & GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA) ? "yes" : "no"));
- } else {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Offscreen OpenGL not available\n"));
- }
-#endif
-
- return res;
-}
-
-static void EVID_Shutdown(GF_VideoOutput *dr)
-{
- EPOCVideo *ctx = (EPOCVideo *)dr->opaque;
- EVID_ResetSurface(dr, 0);
- ctx->session = NULL;
- ctx->window = NULL;
-}
-
-static GF_Err EVID_SetFullScreen(GF_VideoOutput *dr, Bool bOn, u32 *outWidth, u32 *outHeight)
-{
- //EPOCVideo *ctx = (EPOCVideo *)dr->opaque;
- return GF_NOT_SUPPORTED;
-}
-
-static GF_Err EVID_Flush(GF_VideoOutput *dr, GF_Window *dest)
-{
- EPOCVideo *ctx = (EPOCVideo *)dr->opaque;
-
- if (ctx->gc && ctx->surface) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Activating window\n"));
- ctx->gc->Activate(*ctx->window);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Bliting backbuffer\n"));
- ctx->gc->BitBlt(TPoint(0,0), ctx->surface);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Deactivating window\n"));
- ctx->gc->Deactivate();
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Flush success\n"));
- }
- return GF_OK;
-}
-
-static GF_Err EVID_ProcessEvent(GF_VideoOutput *dr, GF_Event *evt)
-{
- //EPOCVideo *ctx = (EPOCVideo *)dr->opaque;
- if (!evt) return GF_OK;
-
- switch (evt->type) {
- case GF_EVENT_SHOWHIDE:
- break;
- case GF_EVENT_SIZE:
- /*nothing to do since we don't own the window*/
- break;
- case GF_EVENT_VIDEO_SETUP:
- ((EPOCVideo *)dr->opaque)->output_3d_type = evt->setup.opengl_mode;
- if (evt->setup.opengl_mode==2) {
-#ifdef GPAC_USE_GLES1X
- return EVID_SetupOGL_ES_Offscreen(dr, evt->setup.width, evt->setup.height);
-#else
- return GF_NOT_SUPPORTED;
-#endif
- }
- return EVID_InitSurface(dr/*, evt->size.width, evt->size.height*/);
- }
- return GF_OK;
-}
-
-static GF_Err EVID_LockBackBuffer(GF_VideoOutput *dr, GF_VideoSurface *vi, Bool do_lock)
-{
- EPOCVideo *ctx = (EPOCVideo *)dr->opaque;
- if (!ctx->surface) return GF_BAD_PARAM;
-
- if (do_lock) {
- if (!ctx->locked_data) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Locking backbuffer memory\n"));
- ctx->surface->LockHeap();
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Retrieving backbuffer memory address\n"));
- ctx->locked_data = (char *)ctx->surface->DataAddress();
- }
- memset(vi, 0, sizeof(GF_VideoSurface));
- vi->height = ctx->height;
- vi->width = ctx->width;
- vi->is_hardware_memory = 0;
- vi->pitch = ctx->width * ctx->bpp;
- vi->pixel_format = ctx->pixel_format;
- vi->video_buffer = ctx->locked_data;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Backbuffer locked OK - address 0x%08x\n", ctx->locked_data));
- } else {
- if (ctx->locked_data) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Unlocking backbuffer memory\n"));
- ctx->surface->UnlockHeap();
- ctx->locked_data = NULL;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOC Video] Backbuffer unlocked OK\n"));
- }
- }
- return GF_OK;
-}
-
-static void *EPOC_vout_new()
-{
- EPOCVideo *priv;
- GF_VideoOutput *driv;
- GF_SAFEALLOC(driv, GF_VideoOutput);
- GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "EPOC Video Output", "gpac distribution")
-
- GF_SAFEALLOC(priv, EPOCVideo);
- driv->opaque = priv;
-
- /*alpha and keying to do*/
- driv->hw_caps = 0;
-#ifdef GPAC_USE_GLES1X
- /*no offscreen opengl with epoc at the moment*/
- driv->hw_caps |= GF_VIDEO_HW_OPENGL;
-#endif
-
- driv->Setup = EVID_Setup;
- driv->Shutdown = EVID_Shutdown;
- driv->Flush = EVID_Flush;
- driv->ProcessEvent = EVID_ProcessEvent;
- driv->Blit = NULL;
- driv->LockBackBuffer = EVID_LockBackBuffer;
- driv->SetFullScreen = EVID_SetFullScreen;
- return (void *)driv;
-}
-static void EPOC_vout_del(void *ifce)
-{
- GF_VideoOutput *driv = (GF_VideoOutput *) ifce;
- EPOCVideo *priv = (EPOCVideo *)driv->opaque;
- gf_free(priv);
- gf_free(driv);
-}
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-void *EPOC_aout_new();
-void EPOC_aout_del(void *ifce);
-
-void EPOC_codec_del(void *ifcg);
-void *EPOC_codec_new();
-
-/*interface query*/
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_VIDEO_OUTPUT_INTERFACE,
- GF_AUDIO_OUTPUT_INTERFACE,
- GF_MEDIA_DECODER_INTERFACE,
- 0
- };
- return si;
-}
-
-/*interface create*/
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_VIDEO_OUTPUT_INTERFACE) return (GF_BaseInterface *) EPOC_vout_new();
- if (InterfaceType == GF_AUDIO_OUTPUT_INTERFACE) return (GF_BaseInterface *) EPOC_aout_new();
- if (InterfaceType == GF_MEDIA_DECODER_INTERFACE) return (GF_BaseInterface *) EPOC_codec_new();
- return NULL;
-}
-
-/*interface destroy*/
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- GF_VideoOutput *dd = (GF_VideoOutput *)ifce;
- switch (dd->InterfaceType) {
- case GF_VIDEO_OUTPUT_INTERFACE:
- EPOC_vout_del(dd);
- break;
- case GF_AUDIO_OUTPUT_INTERFACE:
- EPOC_aout_del(ifce);
- break;
- case GF_MEDIA_DECODER_INTERFACE:
- EPOC_codec_del(ifce);
- break;
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( epoc_vout )
-
-#ifdef __cplusplus
-}
-#endif
-
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/audio_filter
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= audio_filter.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_audio_filter$(DYN_LIB_SUFFIX)
-
-all: $(LIB)
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac $(LDFLAGS)
-
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2010-2012
- * All rights reserved
- *
- *
- * This file is part of GPAC / sample audio filter module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <gpac/modules/audio_out.h>
-#include <gpac/maths.h>
-
-#ifndef PI
-#define PI GF_PI
-#endif
-
-typedef struct
-{
- u32 type;
- Bool inplace;
- u32 sample_block_size;
-
- /*distorsion param*/
- Double gain, clip, volume;
-
- /*delai param*/
- char *delai_buffer, *block_buffer;
- u32 delai_ms, delai_buffer_size, block_size, nb_bytes;
- Double feedback;
-} FilterContext;
-
-static GF_Err ProcessDistorsion(GF_AudioFilter *af, void *in_block, u32 in_block_size, void *out_block, u32 *out_block_size)
-{
- u32 i, count;
- register Double temp;
- Double gain, clip, volume;
- FilterContext *ctx = (FilterContext*)af->udta;
-
- gain=ctx->gain / 100.0;
- clip=ctx->clip * 32768.0 / 100.0;
- volume=ctx->volume / 100.0;
- count = in_block_size>>1;
- for(i=0; i<count; i++) {
- temp = (Double) ((s16 *) in_block)[i];
- temp = temp * gain;
-
- if (temp > clip) temp = clip;
- else if (temp < -clip) temp = -clip;
- temp = temp*volume;
-
- if (temp > 32767.0) temp = 32767.0;
- else if (temp < -32768.0) temp = -32768.0;
- ((s16 *) out_block)[i] = (s16) temp;
- }
- *out_block_size = in_block_size;
- return GF_OK;
-}
-
-static GF_Err ProcessIdentity(GF_AudioFilter *af, void *in_block, u32 in_block_size, void *out_block, u32 *out_block_size)
-{
- FilterContext *ctx = (FilterContext*)af->udta;
- if (!ctx->inplace)
- memcpy(out_block, in_block, in_block_size);
-
- *out_block_size = in_block_size;
- return GF_OK;
-}
-
-static GF_Err ProcessDelai(GF_AudioFilter *af, void *in_block, u32 in_block_size, void *out_block, u32 *out_block_size)
-{
- s16 *in, *delay, *out;
- u32 i;
- register Double temp;
- Double ratio, vol;
- FilterContext *ctx = (FilterContext*)af->udta;
- assert(ctx->block_size==in_block_size);
-
- /*fill delai buffer*/
- if (ctx->nb_bytes<ctx->delai_buffer_size) {
- memcpy(ctx->delai_buffer + ctx->nb_bytes, in_block, in_block_size);
- ctx->nb_bytes += in_block_size;
- memcpy(out_block, in_block, in_block_size);
- *out_block_size = in_block_size;
- return GF_OK;
- }
- memcpy(ctx->block_buffer, ctx->delai_buffer, ctx->block_size);
- memmove(ctx->delai_buffer, ctx->delai_buffer + ctx->block_size, (ctx->delai_buffer_size-ctx->block_size) );
-
- vol = ctx->volume / 100;
- ratio = ctx->feedback/100;
- delay = (s16 *) ctx->block_buffer;
- in = (s16 *) in_block;
- out = (s16 *) out_block;
- for (i=0; i<ctx->block_size/2; i++) {
- temp = (1-ratio)*in[i] + ratio*delay[i];
- temp = temp*vol;
- out[i] = (s16) temp;
- }
- memcpy(ctx->delai_buffer + ctx->nb_bytes - in_block_size, out_block, in_block_size);
-
- *out_block_size = ctx->block_size;
- return GF_OK;
-}
-
-
-static GF_Err Configure(GF_AudioFilter *af, u32 in_sr, u32 in_bps, u32 in_nb_ch, u32 in_ch_cfg, u32 *out_nb_ch, u32 *out_ch_cfg, u32 *out_block_len_in_samples, u32 *delay_ms, Bool *inplace)
-{
- FilterContext *ctx = (FilterContext*)af->udta;
-
- *inplace = ctx->inplace;
- *delay_ms = 0;
- *out_nb_ch = in_nb_ch;
- *out_ch_cfg = in_ch_cfg;
-
- switch (ctx->type) {
- case 2:
- ctx->block_size = ctx->sample_block_size * in_nb_ch * in_bps / 8;
- ctx->delai_buffer_size = in_nb_ch * in_bps * ctx->delai_ms * in_sr / 1000 / 8;
- ctx->delai_buffer_size /= ctx->block_size;
- ctx->delai_buffer_size *= ctx->block_size;
-
- if (ctx->delai_buffer) gf_free(ctx->delai_buffer);
- ctx->delai_buffer = (char*)gf_malloc(sizeof(char)*ctx->delai_buffer_size);
- memset(ctx->delai_buffer, 0, sizeof(char)*ctx->delai_buffer_size);
-
- if (ctx->block_buffer) gf_free(ctx->block_buffer);
- ctx->block_buffer = (char*)gf_malloc(sizeof(char)*ctx->block_size);
- memset(ctx->block_buffer, 0, sizeof(char)*ctx->block_size);
- break;
- }
-
- *out_block_len_in_samples = ctx->sample_block_size;
- return GF_OK;
-}
-
-static Bool SetFilter(GF_AudioFilter *af, char *filter)
-{
- char *opts;
- FilterContext *ctx = (FilterContext*)af->udta;
- if (!filter) return GF_FALSE;
-
- opts = strchr(filter, '@');
- if (opts) opts[0] = 0;
-
- ctx->sample_block_size = 0;
- ctx->inplace = GF_TRUE;
- ctx->volume = 100.0;
-
- if (!stricmp(filter, "identity")) {
- af->Process = ProcessIdentity;
- ctx->type = 0;
- }
- else if (!stricmp(filter, "distorsion")) {
- ctx->gain=50.0;
- ctx->clip=100.0;
- af->Process = ProcessDistorsion;
- ctx->type = 1;
- }
- else if (!stricmp(filter, "delai")) {
- ctx->delai_ms = 100;
- ctx->feedback = 50;
- af->Process = ProcessDelai;
- ctx->type = 2;
- ctx->sample_block_size = 120;
- } else {
- if (opts) opts[0] = '@';
- return GF_FALSE;
- }
- if (opts) {
- opts[0] = '@';
- opts++;
-
- while (1) {
- char *sep = strchr(opts, ';');
- if (sep) sep[0] = 0;
-
- if (!strnicmp(opts, "blocksize=", 10)) ctx->sample_block_size = atoi(opts+10);
- else if (!stricmp(opts, "noinplace")) ctx->inplace = GF_FALSE;
- else if (!strnicmp(opts, "gain=", 5)) ctx->gain = atof(opts+5);
- else if (!strnicmp(opts, "clip=", 5)) ctx->clip = atof(opts+5);
- else if (!strnicmp(opts, "volume=", 7)) ctx->volume = atof(opts+7);
- else if (!strnicmp(opts, "delai=", 6)) ctx->delai_ms = atoi(opts+6);
- else if (!strnicmp(opts, "feedback=", 9)) {
- ctx->feedback = atof(opts+9);
- if (ctx->feedback>100) ctx->feedback=100;
- }
-
- if (!sep) break;
- sep[0] = ';';
- opts = sep+1;
- }
- }
-
- return GF_TRUE;
-}
-
-
-static Bool SetOption(GF_AudioFilter *af, char *option, char *value)
-{
- return GF_TRUE;
-}
-static void Reset(GF_AudioFilter *af)
-{
-}
-
-
-GF_BaseInterface *NewAudioFilter()
-{
- FilterContext *ctx;
- GF_AudioFilter *mod;
- GF_SAFEALLOC(ctx, FilterContext);
- if(!ctx) return NULL;
-
- GF_SAFEALLOC(mod, GF_AudioFilter);
- if(!mod) {
- gf_free(ctx);
- return NULL;
- }
- mod->udta = ctx;
- mod->SetFilter = SetFilter;
- mod->Configure = Configure;
- mod->Process = ProcessIdentity;
- mod->SetOption = SetOption;
- mod->Reset = Reset;
-
- GF_REGISTER_MODULE_INTERFACE(mod, GF_AUDIO_FILTER_INTERFACE, "Sample Audio Filter", "gpac distribution");
- return (GF_BaseInterface*)mod;
-}
-
-void DeleteAudioFilter(void *ifce)
-{
- GF_AudioFilter *dr = (GF_AudioFilter*) ifce;
- FilterContext *ctx = (FilterContext *)dr->udta;
-
- if (ctx->delai_buffer) gf_free(ctx->delai_buffer);
- gf_free(ctx);
- gf_free(dr);
-}
-
-
-/*
- * ********************************************************************
- * interface
- */
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_AUDIO_FILTER_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_AUDIO_FILTER_INTERFACE)
- return NewAudioFilter();
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- if (ifce->InterfaceType==GF_AUDIO_FILTER_INTERFACE)
- DeleteAudioFilter((GF_AudioFilter*)ifce);
-}
-
-GPAC_MODULE_STATIC_DECLARATION( audio_filter )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/avcap
-
-CFLAGS= $(CXXFLAGS) -I"$(SRC_PATH)/include" $(AVCAP_CFLAGS)
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-LINKLIBS= $(AVCAP_LDFLAGS) -L../../bin/gcc -lgpac
-
-
-#common objects
-OBJS=avcap.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_avcap$(DYN_LIB_SUFFIX)
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CXX) -w $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(LINKLIBS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CXX) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2011-20XX
- * All rights reserved
- *
- * This file is part of GPAC / AVCAP video input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <avcap/avcap.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <gpac/modules/service.h>
-#include <gpac/modules/codec.h>
-/*for GF_STREAM_PRIVATE_SCENE definition*/
-#include <gpac/constants.h>
-#include <gpac/download.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#if !defined(__GNUC__)&& (defined(_WIN32_WCE) || defined (WIN32))
-# pragma comment(lib, "strmiids")
-#ifdef _DEBUG
-# pragma comment(lib, "avcapd")
-# pragma comment(lib, "strmbasd")
-#else
-# pragma comment(lib, "avcap")
-# pragma comment(lib, "strmbase")
-#endif
-# pragma comment(lib, "winmm")
-#endif
-
-
-using namespace avcap;
-
-class GPACCaptureHandler : public CaptureHandler
-{
-public:
- GPACCaptureHandler(GF_ClientService *service, LPNETCHANNEL channel)
- : m_pService(service), m_pChannel(channel), m_data(NULL)
- {
- memset(&m_pSLHeader, 0, sizeof(GF_SLHeader));
- m_pSLHeader.compositionTimeStampFlag = 1;
- }
- virtual ~GPACCaptureHandler() {
- if (m_data != NULL) {
- gf_free(m_data);
- m_data=NULL;
- }
- }
-
- GF_ClientService *m_pService;
- LPNETCHANNEL m_pChannel;
- GF_SLHeader m_pSLHeader;
-
- u32 m_height;
- u32 m_stride;
-
- char* m_data;
-
-public:
- void AllocData(u32 height, u32 stride) {
- m_height = height;
- m_stride = stride;
- m_data = (char*)gf_malloc(m_height * m_stride);
- }
- /* This method is called by the CaptureManager, when new data was captured.
- * \param io_buf The buffer, that contains the captured data. */
- void handleCaptureEvent(IOBuffer* io_buf);
-};
-
-
-void GPACCaptureHandler::handleCaptureEvent(IOBuffer* io_buf)
-{
- m_pSLHeader.compositionTimeStamp = io_buf->getTimestamp();
-
- if (m_data) {
- char* data = (char*)io_buf->getPtr();
- for (u32 i=0; i<m_height; i++) {
- memcpy(m_data + (m_height - 1 - i) * m_stride, data + i*m_stride, m_stride);
- }
- gf_service_send_packet(m_pService, m_pChannel, m_data, (u32)io_buf->getValidBytes(), &m_pSLHeader, GF_OK);
- } else {
- gf_service_send_packet(m_pService, m_pChannel, (char *) io_buf->getPtr(), (u32)io_buf->getValidBytes(), &m_pSLHeader, GF_OK);
- }
- io_buf->release();
-}
-
-DeviceDescriptor* get_device_descriptor(char *name)
-{
- // find the descriptor of the device in the device-list by index
- const DeviceCollector::DeviceList& dl = DEVICE_COLLECTOR::instance().getDeviceList();
- DeviceDescriptor* dd = 0;
- int index = 0;
-
- for(DeviceCollector::DeviceList::const_iterator i = dl.begin(); i != dl.end(); i++, index++) {
- dd = *i;
-
- if (!name || !stricmp(name, "default") )
- return dd;
- if (strstr((char *) dd->getName().c_str(), name) != NULL)
- return dd;
- }
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[VideoCapture] Cannot find capture driver %s\n", name));
- return NULL;
-}
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct
-{
- /*the service we're responsible for*/
- GF_ClientService *service;
- u32 state;
-
- DeviceDescriptor *device_desc;
- CaptureDevice* device;
-
- GPACCaptureHandler *video_handler;
- GPACCaptureHandler *audio_handler;
-
- u32 width, height, pixel_format, stride, out_size, fps;
- u32 default_4cc;
- Bool flip_video;
-} AVCapIn;
-
-
-Bool AVCap_CanHandleURL(GF_InputService *plug, const char *url)
-{
- if (!strnicmp(url, "camera://", 9)) return GF_TRUE;
- if (!strnicmp(url, "video://", 8)) return GF_TRUE;
- return GF_FALSE;
-}
-
-
-GF_Err AVCap_ConnectService(GF_InputService *plug, GF_ClientService *serv, const char *url)
-{
- GF_ESD *esd;
- GF_BitStream *bs;
- GF_ObjectDescriptor *od;
- const char *opt;
- AVCapIn *vcap = (AVCapIn *) plug->priv;
-
- if (!vcap || !serv || !url) return GF_BAD_PARAM;
-
- vcap->state = 0;
- vcap->service = serv;
-
- opt = gf_opts_get_key("AVCap", "FlipVideo");
- if (opt && !strcmp(opt, "yes")) vcap->flip_video = GF_TRUE;
-
- if (!vcap->device_desc) {
- Format *format;
- u32 default_4cc;
- char *name;
- char *params = (char *) strchr(url, '?');
- if (params) params[0] = 0;
- name = (char *) strstr(url, "://");
- if (name) name += 3;
- /* get device by name */
- vcap->device_desc = get_device_descriptor(name);
- if (params) {
- params[0] = '?';
- params ++;
- }
-
- if (!vcap->device_desc) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[VideoCapture] Failed to instanciate AVCap\n"));
- gf_service_connect_ack(serv, NULL, GF_REMOTE_SERVICE_ERROR);
- return GF_OK;
- }
-
- vcap->device_desc->open();
- if ( (!strnicmp(url, "camera://", 9) || !strnicmp(url, "video://", 8)) && !vcap->device_desc->isVideoCaptureDev()) {
- vcap->device_desc->close();
- gf_service_connect_ack(serv, NULL, GF_URL_ERROR);
- return GF_OK;
- }
- else if (!strnicmp(url, "audio://", 8) && !vcap->device_desc->isAudioDev()) {
- vcap->device_desc->close();
- gf_service_connect_ack(serv, NULL, GF_URL_ERROR);
- return GF_OK;
- }
- vcap->device = vcap->device_desc->getDevice();
- if (!vcap->device) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[VideoCapture] Failed to initialize capture device\n"));
- vcap->device_desc->close();
- gf_service_connect_ack(serv, NULL, GF_SERVICE_ERROR);
- return GF_OK;
- }
- vcap->device->getFormatMgr()->setFramerate(30);
-
- default_4cc = 0;
- opt = gf_opts_get_key("AVCap", "Default4CC");
- if (opt) {
- default_4cc = GF_4CC(opt[0], opt[1], opt[2], opt[3]);
- vcap->device->getFormatMgr()->setFormat(default_4cc);
- }
-
-
- while (params) {
- char *sep = (char *) strchr(params, '&');
- if (sep) sep[0] = 0;
-
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[VideoCapture] Set camera option %s\n", params));
-
- if (!strnicmp(params, "resolution=", 11)) {
- u32 w, h;
- if (sscanf(params+11, "%dx%d", &w, &h)==2) {
- vcap->device->getFormatMgr()->setResolution(w, h);
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[VideoCapture] Set resolution to %dx%d\n", w, h));
- }
- }
- else if (!strnicmp(params, "fps=", 4)) {
- u32 fps;
- if (sscanf(params+4, "%d", &fps)==1) {
- vcap->device->getFormatMgr()->setFramerate(fps);
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[VideoCapture] Set framerate to %d\n", fps));
- }
- }
- else if (!strnicmp(params, "stereo=", 7)) {
- }
- else if (!strnicmp(params, "mode=", 5)) {
- }
- else if (!strnicmp(params, "fmt=", 4)) {
- if (!strnicmp(params+4, "rgb", 3)) {
- default_4cc = GF_4CC('3', 'B', 'G', 'R');
- }
- else if (!strnicmp(params+4, "yuv", 3)) {
- default_4cc = GF_4CC('V', 'Y', 'U', 'Y');
- }
- else if (strlen(params+4)>=4) {
- default_4cc = GF_4CC(params[4], params[5], params[6], params[7]);
- }
- }
-
- if (!sep) break;
- sep[0] = '&';
- params = sep+1;
- }
-
- vcap->width = vcap->device->getFormatMgr()->getWidth();
- vcap->height = vcap->device->getFormatMgr()->getHeight();
- vcap->fps = vcap->device->getFormatMgr()->getFramerate();
-
- if (default_4cc )
- vcap->device->getFormatMgr()->setFormat(default_4cc );
-
- format = vcap->device->getFormatMgr()->getFormat();
- switch (format->getFourcc()) {
- case GF_4CC('V', 'Y', 'U', 'Y'):
- case GF_4CC('2', 'Y', 'U', 'Y'):
- vcap->pixel_format = GF_PIXEL_YUY2;
- vcap->stride = 2*vcap->width;
- vcap->out_size = 2*vcap->width*vcap->height;
- break;
- case GF_4CC('2', '1', 'U', 'Y'):
- vcap->pixel_format = GF_PIXEL_I420;
- vcap->stride = (u32)vcap->device->getFormatMgr()->getBytesPerLine();//1.5*vcap->width;//
- vcap->out_size = (u32)vcap->device->getFormatMgr()->getImageSize();//1.5*vcap->width*vcap->height;//
- break;
- case GF_4CC('3', 'B', 'G', 'R'):
- vcap->pixel_format = GF_PIXEL_BGR_24;
- vcap->stride = vcap->device->getFormatMgr()->getBytesPerLine();//1.5*vcap->width;//
- vcap->out_size = (u32)vcap->device->getFormatMgr()->getImageSize();//1.5*vcap->width*vcap->height;//
- break;
- default:
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[VideoCapture] Unsupported 4CC %s (%08x) from capture device\n", gf_4cc_to_str(format->getFourcc()), format->getFourcc()));
- vcap->device_desc->close();
- gf_service_connect_ack(serv, NULL, GF_NOT_SUPPORTED);
- return GF_OK;
- }
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[VideoCapture] Device configured - resolution %dx%d - Frame Rate %d - Pixel Format %s (Device 4CC %08x) \n", vcap->width, vcap->height, vcap->fps, gf_4cc_to_str(vcap->pixel_format), format->getFourcc()));
- }
-
- /*ACK connection is OK*/
- gf_service_connect_ack(serv, NULL, GF_OK);
-
-
- /*setup object descriptor*/
- od = (GF_ObjectDescriptor *) gf_odf_desc_new(GF_ODF_OD_TAG);
-
- esd = gf_odf_desc_esd_new(0);
- esd->slConfig->timestampResolution = 1000;
- if (!strnicmp(url, "camera://", 9) || !strnicmp(url, "video://", 8)) {
- od->objectDescriptorID = 1;
- esd->ESID = 1;
- esd->decoderConfig->streamType = GF_STREAM_VISUAL;
- } else {
- od->objectDescriptorID = 2;
- esd->ESID = 2;
- esd->decoderConfig->streamType = GF_STREAM_AUDIO;
- }
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_RAW_MEDIA_STREAM;
-
- bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- gf_bs_write_u32(bs, vcap->pixel_format);
- gf_bs_write_u16(bs, vcap->width);
- gf_bs_write_u16(bs, vcap->height);
- gf_bs_write_u32(bs, vcap->out_size);
- gf_bs_write_u32(bs, vcap->stride);
- gf_bs_get_content(bs, &esd->decoderConfig->decoderSpecificInfo->data, &esd->decoderConfig->decoderSpecificInfo->dataLength);
- gf_bs_del(bs);
-
- gf_list_add(od->ESDescriptors, esd);
- gf_service_declare_media(vcap->service, (GF_Descriptor*)od, GF_FALSE);
-
- return GF_OK;
-}
-
-GF_Err AVCap_CloseService(GF_InputService *plug)
-{
- AVCapIn *vcap = (AVCapIn *) plug->priv;
- if (vcap->device_desc) {
- vcap->device_desc->close();
- vcap->device_desc = NULL;
- }
-
- vcap->state = 0;
- gf_service_disconnect_ack(vcap->service, NULL, GF_OK);
- return GF_OK;
-}
-
-/*Dummy input just send a file name, no multitrack to handle so we don't need to check sub_url nor expected type*/
-static GF_Descriptor *AVCap_GetServiceDesc(GF_InputService *plug, u32 expect_type, const char *sub_url)
-{
- return NULL;
-}
-
-
-GF_Err AVCap_ServiceCommand(GF_InputService *plug, GF_NetworkCommand *com)
-{
- AVCapIn *vcap = (AVCapIn *) plug->priv;
-
- if (!com->base.on_channel) return GF_NOT_SUPPORTED;
-
- switch (com->command_type) {
- case GF_NET_CHAN_SET_PULL:
- return GF_NOT_SUPPORTED;
- case GF_NET_CHAN_INTERACTIVE:
- return GF_OK;
- /*since data is file-based, no padding is needed (decoder plugin will handle it itself)*/
- case GF_NET_CHAN_SET_PADDING:
- return GF_OK;
- case GF_NET_CHAN_BUFFER:
- com->buffer.max = com->buffer.min = 500;
- return GF_OK;
- case GF_NET_CHAN_DURATION:
- /*this module is not made for updates, use undefined duration*/
- com->duration.duration = 0;
- return GF_OK;
- case GF_NET_CHAN_PLAY:
- if (vcap->state==0) {
- /*start capture*/
- if (vcap->video_handler)
- vcap->device->getVidCapMgr()->registerCaptureHandler(vcap->video_handler);
-
- if (vcap->device->getVidCapMgr()->startCapture() != -1)
- vcap->state = 1;
- else
- vcap->device->getVidCapMgr()->removeCaptureHandler();
- }
- return GF_OK;
- case GF_NET_CHAN_STOP:
- if (vcap->state==1) {
- /*stop capture*/
- vcap->device->getVidCapMgr()->removeCaptureHandler();
- vcap->device->getVidCapMgr()->stopCapture();
- vcap->state = 0;
- }
- return GF_OK;
- case GF_NET_CHAN_CONFIG:
- return GF_OK;
- case GF_NET_CHAN_GET_DSI:
- com->get_dsi.dsi = NULL;
- com->get_dsi.dsi_len = 0;
- return GF_OK;
- default:
- break;
- }
- return GF_OK;
-}
-
-GF_Err AVCap_ConnectChannel(GF_InputService *plug, LPNETCHANNEL channel, const char *url, Bool upstream)
-{
- u32 ESID;
- AVCapIn *vcap = (AVCapIn *) plug->priv;
-
- sscanf(url, "ES_ID=%u", &ESID);
- if (ESID == 1) {
- /*video connect*/
- vcap->video_handler = new GPACCaptureHandler(vcap->service, channel);
-
- if (vcap->flip_video)
- vcap->video_handler->AllocData(vcap->height, vcap->stride);
-
- gf_service_connect_ack(vcap->service, channel, GF_OK);
- } else if (ESID == 2) {
- /*audio connect*/
- vcap->audio_handler = new GPACCaptureHandler(vcap->service, channel);
- gf_service_connect_ack(vcap->service, channel, GF_OK);
- } else {
- gf_service_connect_ack(vcap->service, channel, GF_STREAM_NOT_FOUND);
- }
- return GF_OK;
-}
-
-GF_Err AVCap_DisconnectChannel(GF_InputService *plug, LPNETCHANNEL channel)
-{
- AVCapIn *vcap = (AVCapIn *) plug->priv;
- if (vcap->video_handler && vcap->video_handler->m_pChannel==channel) {
- delete vcap->video_handler;
- vcap->video_handler = NULL;
- }
- else if (vcap->audio_handler && vcap->audio_handler->m_pChannel==channel) {
- delete vcap->audio_handler;
- vcap->audio_handler = NULL;
- }
- gf_service_disconnect_ack(vcap->service, channel, GF_OK);
- return GF_OK;
-}
-
-Bool AVCap_CanHandleURLInService(GF_InputService *plug, const char *url)
-{
- return GF_FALSE;
-}
-
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_NET_CLIENT_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_NET_CLIENT_INTERFACE) {
- AVCapIn *vcap;
- GF_InputService *plug;
- GF_SAFEALLOC(plug, GF_InputService);
- memset(plug, 0, sizeof(GF_InputService));
- GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "Video Capture using libavcap", "gpac distribution")
-
- plug->RegisterMimeTypes = NULL;
- plug->CanHandleURL = AVCap_CanHandleURL;
- plug->ConnectService = AVCap_ConnectService;
- plug->CloseService = AVCap_CloseService;
- plug->GetServiceDescriptor = AVCap_GetServiceDesc;
- plug->ConnectChannel = AVCap_ConnectChannel;
- plug->DisconnectChannel = AVCap_DisconnectChannel;
- plug->ServiceCommand = AVCap_ServiceCommand;
- plug->CanHandleURLInService = AVCap_CanHandleURLInService;
-
- GF_SAFEALLOC(vcap, AVCapIn);
- plug->priv = vcap;
- return (GF_BaseInterface *)plug;
- }
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *bi)
-{
- if (bi->InterfaceType==GF_NET_CLIENT_INTERFACE) {
- GF_InputService *ifcn = (GF_InputService*)bi;
- AVCapIn *vcap = (AVCapIn*)ifcn->priv;
- gf_free(vcap);
- gf_free(bi);
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( avcap )
-
-#ifdef __cplusplus
-}
-#endif
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/ffmpeg_in
-
-CFLAGS=-fPIC $(OPTFLAGS) -Wno-deprecated-declarations -I"$(SRC_PATH)/include" $(ffmpeg_cflags)
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-LOCAL_LIB=
-
-LINKFLAGS=$(ffmpeg_lflags)
-
-ifeq ($(STATICBUILD),yes)
-##include static modules and other deps for libgpac
-include ../../static.mak
-LINKFLAGS+=-lgpac_static
-LINKFLAGS+=$(EXTRALIBS)
-else
-LINKFLAGS+=-lgpac
-endif
-
-#common obj
-OBJS=ffmpeg_decode.o ffmpeg_demux.o ffmpeg_load.o
-
-
-#darwin needs bz2
-ifeq ($(CONFIG_DARWIN),yes)
-LINKFLAGS+=-lbz2
-endif
-
-#old ffmpeg lib
-ifeq ($(CONFIG_FFMPEG_OLD),yes)
-CFLAGS+=-DFFMPEG_OLD_HEADERS -I/usr/include
-else
-LINKFLAGS+=-lswscale
-endif
-
-#local ffmpeg lib
-ifeq ($(CONFIG_FFMPEG),local)
-LOCAL_LIB=-L../../extra_lib/lib/gcc
-CFLAGS+= -I"$(LOCAL_INC_PATH)"
-endif
-
-ifeq ($(CONFIG_ZLIB),local)
-LOCAL_LIB=-L../../extra_lib/lib/gcc
-endif
-
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_ffmpeg_in$(DYN_LIB_SUFFIX)
-ifeq ($(CONFIG_WIN32),yes)
-#LDFLAGS+=-export-symbols ffmpeg_in.def
-endif
-
-#need to add cross-libraries if not local
-ifeq ($(CROSS_COMPILING),yes)
-LINKFLAGS+=-L$(prefix)/$(libdir)
-endif
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) -L../../bin/gcc $(LOCAL_LIB) $(LDFLAGS) $(LINKFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / FFMPEG module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "ffmpeg_in.h"
-#include <gpac/avparse.h>
-#include <libavcodec/avcodec.h>
-
-
-#if ((LIBAVCODEC_VERSION_MAJOR == 55) && (LIBAVCODEC_VERSION_MINOR >= 38)) || (LIBAVCODEC_VERSION_MAJOR > 55)
-#define HAS_HEVC
-
-#include <libavutil/opt.h>
-#endif
-
-#if defined(GPAC_CONFIG_ANDROID) || defined(GPAC_CONFIG_IOS)
-#define NO_10bit
-#endif
-
-//#define FFMPEG_DIRECT_DISPATCH
-
-#ifndef AV_INPUT_BUFFER_PADDING_SIZE
-#define AV_INPUT_BUFFER_PADDING_SIZE 0
-#endif
-
-/**
- * Allocates data for FFMPEG decoding
- * \param oldBuffer The oldBuffer (freed if not NULL)
- * \param size Size to allocate (will use extra padding for real size)
- * \return The newly allocated buffer
- */
-static uint8_t * ffmpeg_realloc_buffer(uint8_t * oldBuffer, u32 size) {
- uint8_t * buffer;
- /* Size of buffer must be larger, see avcodec_decode_video2 documentation */
- u32 allocatedSz = sizeof( char ) * (AV_INPUT_BUFFER_PADDING_SIZE + size);
- if (oldBuffer)
- gf_free(oldBuffer);
- buffer = (uint8_t*)gf_malloc( allocatedSz );
- if (buffer)
- memset( buffer, 0, allocatedSz);
- return buffer;
-}
-
-
-static AVCodec *ffmpeg_get_codec(u32 codec_4cc)
-{
- char name[5];
- AVCodec *codec;
- strcpy(name, gf_4cc_to_str(codec_4cc));
-
- codec = avcodec_find_decoder(codec_4cc);
- if (codec) return codec;
-
- codec = avcodec_find_decoder_by_name(name);
- if (codec) return codec;
- strupr(name);
- codec = avcodec_find_decoder_by_name(name);
- if (codec) return codec;
- strlwr(name);
- codec = avcodec_find_decoder_by_name(name);
- if (codec) return codec;
- /*custom mapings*/
- if (!stricmp(name, "s263")) codec = avcodec_find_decoder(CODEC_ID_H263);
- else if (!stricmp(name, "mjp2")) {
- codec = avcodec_find_decoder_by_name("jpeg2000");
- if (!codec) codec = avcodec_find_decoder_by_name("libopenjpeg");
- }
- else if (!stricmp(name, "samr") || !stricmp(name, "amr ")) codec = avcodec_find_decoder(CODEC_ID_AMR_NB);
- else if (!stricmp(name, "sawb")) codec = avcodec_find_decoder(CODEC_ID_AMR_WB);
-
-
- return codec;
-}
-
-
-static void FFDEC_LoadDSI(FFDec *ffd, GF_BitStream *bs, AVCodec *codec, AVCodecContext *ctx, Bool from_ff_demux)
-{
- u32 dsi_size;
- if (!codec) return;
-
- dsi_size = (u32) gf_bs_available(bs);
- if (!dsi_size) return;
-
- /*demuxer is ffmpeg, extra data can be copied directly*/
- if (from_ff_demux) {
- if (ctx->extradata)
- gf_free(ctx->extradata);
- ctx->extradata_size = dsi_size;
- ctx->extradata = ffmpeg_realloc_buffer(ctx->extradata, ctx->extradata_size);
- gf_bs_read_data(bs, (char *) ctx->extradata, ctx->extradata_size);
- return;
- }
-
- switch (codec->id) {
- case CODEC_ID_SVQ3:
- {
- u32 at_type, size;
- size = gf_bs_read_u32(bs);
- /*there should be an 'SMI' entry*/
- at_type = gf_bs_read_u32(bs);
- if (at_type == GF_4CC('S', 'M', 'I', ' ')) {
- if (ctx->extradata)
- gf_free(ctx->extradata);
- ctx->extradata_size = 0x5a + size;
- ctx->extradata = ffmpeg_realloc_buffer(ctx->extradata, ctx->extradata_size);
- strcpy((char *) ctx->extradata, "SVQ3");
- gf_bs_read_data(bs, (char *)ctx->extradata + 0x5a, size);
- }
- }
- break;
- default:
- if (ctx->extradata)
- gf_free(ctx->extradata);
- ctx->extradata_size = dsi_size;
- ctx->extradata = ffmpeg_realloc_buffer(ctx->extradata, ctx->extradata_size);
- gf_bs_read_data(bs, (char *)ctx->extradata, ctx->extradata_size);
- break;
- }
-}
-
-static GF_Err FFDEC_AttachStream(GF_BaseDecoder *plug, GF_ESD *esd)
-{
- u32 codec_id = 0;
- int gotpic;
- GF_BitStream *bs;
- AVCodecContext **ctx;
- AVCodec **codec;
- AVFrame **frame;
-
-#ifndef GPAC_DISABLE_AV_PARSERS
- GF_M4VDecSpecInfo dsi;
- GF_Err e;
-#endif
- FFDec *ffd = (FFDec *)plug->privateStack;
- if (esd->decoderConfig->upstream) return GF_NOT_SUPPORTED;
- if (!ffd->oti) return GF_NOT_SUPPORTED;
-
-
-
- /*locate any auxiliary video data descriptor on this stream*/
- if (esd->dependsOnESID) {
- u32 i = 0;
- GF_Descriptor *d = NULL;
- if (esd->dependsOnESID != ffd->base_ES_ID) return GF_NOT_SUPPORTED;
- while ((d = (GF_Descriptor*)gf_list_enum(esd->extensionDescriptors, &i))) {
- if (d->tag == GF_ODF_AUX_VIDEO_DATA) break;
- }
- if (!d) return GF_NOT_SUPPORTED;
-
- ffd->depth_ES_ID = esd->ESID;
- ctx = &ffd->depth_ctx;
- codec = &ffd->depth_codec;
- frame = &ffd->depth_frame;
- } else {
- if (ffd->base_ES_ID) return GF_NOT_SUPPORTED;
- ffd->base_ES_ID = esd->ESID;
- ctx = &ffd->base_ctx;
- codec = &ffd->base_codec;
- frame = &ffd->base_frame;
- }
- if (!(*ctx)) {
-
-#ifdef USE_AVCTX3
- *ctx = avcodec_alloc_context3(NULL);
-#else
- *ctx = avcodec_alloc_context();
-#endif
- }
-
- /*private FFMPEG DSI*/
- if (ffd->oti == GPAC_OTI_MEDIA_FFMPEG) {
- bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ);
- codec_id = gf_bs_read_u32(bs);
- if (ffd->st==GF_STREAM_AUDIO) {
- (*ctx)->codec_type = AVMEDIA_TYPE_AUDIO;
- (*ctx)->sample_rate = gf_bs_read_u32(bs);
- (*ctx)->channels = gf_bs_read_u16(bs);
- (*ctx)->frame_size = gf_bs_read_u16(bs);
- /*bits_per_sample */gf_bs_read_u8(bs);
- /*num_frames_per_au*/ gf_bs_read_u8(bs);
-
- /*ffmpeg specific*/
- (*ctx)->block_align = gf_bs_read_u16(bs);
- (*ctx)->bit_rate = gf_bs_read_u32(bs);
- (*ctx)->codec_tag = gf_bs_read_u32(bs);
- } else if (ffd->st==GF_STREAM_VISUAL) {
- (*ctx)->codec_type = AVMEDIA_TYPE_VIDEO;
- (*ctx)->width = gf_bs_read_u16(bs);
- (*ctx)->height = gf_bs_read_u16(bs);
- (*ctx)->bit_rate = gf_bs_read_u32(bs);
- (*ctx)->codec_tag = gf_bs_read_u32(bs);
- ffd->raw_pix_fmt = gf_bs_read_u32(bs);
- }
-
- *codec = avcodec_find_decoder(codec_id);
- FFDEC_LoadDSI(ffd, bs, *codec, *ctx, GF_TRUE);
- gf_bs_del(bs);
- }
- /*private QT DSI*/
- else if (ffd->oti == GPAC_OTI_MEDIA_GENERIC) {
- bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ);
- codec_id = gf_bs_read_u32(bs);
- if (ffd->st==GF_STREAM_AUDIO) {
- (*ctx)->codec_type = AVMEDIA_TYPE_AUDIO;
- (*ctx)->sample_rate = gf_bs_read_u32(bs);
- (*ctx)->channels = gf_bs_read_u16(bs);
- (*ctx)->frame_size = gf_bs_read_u16(bs);
- /*bits_per_sample */ gf_bs_read_u8(bs);
- /*num_frames_per_au*/ gf_bs_read_u8(bs);
- /*just in case...*/
- if (codec_id == GF_4CC('a', 'm', 'r', ' ')) {
- (*ctx)->sample_rate = 8000;
- (*ctx)->channels = 1;
- (*ctx)->frame_size = 160;
- }
- } else if (ffd->st==GF_STREAM_VISUAL) {
- (*ctx)->codec_type = AVMEDIA_TYPE_VIDEO;
- (*ctx)->width = gf_bs_read_u16(bs);
- (*ctx)->height = gf_bs_read_u16(bs);
- }
- (*codec) = ffmpeg_get_codec(codec_id);
- codec_id = (*codec)->id;
- FFDEC_LoadDSI(ffd, bs, *codec, *ctx, GF_FALSE);
- gf_bs_del(bs);
- }
- /*use std MPEG-4 st/oti*/
- else {
- u32 codec_id = 0;
- if (ffd->st==GF_STREAM_VISUAL) {
- (*ctx)->codec_type = AVMEDIA_TYPE_VIDEO;
- switch (ffd->oti) {
- case GPAC_OTI_VIDEO_MPEG4_PART2:
- codec_id = CODEC_ID_MPEG4;
- break;
- case GPAC_OTI_VIDEO_AVC:
- codec_id = CODEC_ID_H264;
- break;
-#ifdef HAS_HEVC
- case GPAC_OTI_VIDEO_HEVC:
- codec_id = AV_CODEC_ID_HEVC;
- break;
-#endif
- case GPAC_OTI_VIDEO_MPEG1:
- case GPAC_OTI_VIDEO_MPEG2_SIMPLE:
- case GPAC_OTI_VIDEO_MPEG2_MAIN:
- case GPAC_OTI_VIDEO_MPEG2_SNR:
- case GPAC_OTI_VIDEO_MPEG2_SPATIAL:
- case GPAC_OTI_VIDEO_MPEG2_HIGH:
- case GPAC_OTI_VIDEO_MPEG2_422:
- codec_id = CODEC_ID_MPEG2VIDEO;
- break;
- case GPAC_OTI_IMAGE_JPEG:
- codec_id = CODEC_ID_MJPEG;
- ffd->is_image = GF_TRUE;
- break;
- case GPAC_OTI_IMAGE_PNG:
- codec_id = CODEC_ID_PNG;
- ffd->is_image = GF_TRUE;
- break;
-#ifdef CODEC_ID_VP9
- case GPAC_OTI_VIDEO_VP9:
- codec_id = CODEC_ID_VP9;
- break;
-#endif
-#ifdef CODEC_ID_AV1
- case GPAC_OTI_VIDEO_AV1:
- codec_id = CODEC_ID_AV1;
- break;
-#endif
- case 0xFF:
- codec_id = CODEC_ID_SVQ3;
- break;
- }
- } else if (ffd->st==GF_STREAM_AUDIO) {
- (*ctx)->codec_type = AVMEDIA_TYPE_AUDIO;
- switch (ffd->oti) {
- case GPAC_OTI_AUDIO_MPEG2_PART3:
- case GPAC_OTI_AUDIO_MPEG1:
- (*ctx)->frame_size = 1152;
- codec_id = CODEC_ID_MP2;
- break;
- case GPAC_OTI_AUDIO_AC3:
- codec_id = CODEC_ID_AC3;
- break;
- case GPAC_OTI_AUDIO_EAC3:
- codec_id = CODEC_ID_EAC3;
- break;
- case GPAC_OTI_AUDIO_AAC_MPEG2_LCP:
- case GPAC_OTI_AUDIO_AAC_MPEG2_MP:
- case GPAC_OTI_AUDIO_AAC_MPEG2_SSRP:
- case GPAC_OTI_AUDIO_AAC_MPEG4:
- codec_id = CODEC_ID_AAC;
- break;
-#ifdef CODEC_ID_OPUS
- case GPAC_OTI_MEDIA_OPUS:
- codec_id = CODEC_ID_OPUS;
- (*ctx)->frame_size = 2880;//use max frame size
- break;
-#endif
- }
- }
- else if ((ffd->st==GF_STREAM_ND_SUBPIC) && (ffd->oti==0xe0)) {
- codec_id = CODEC_ID_DVD_SUBTITLE;
- }
- *codec = avcodec_find_decoder(codec_id);
-
- if (*codec) {
- switch (codec_id) {
- case CODEC_ID_AAC:
-#ifdef CODEC_ID_OPUS
- case CODEC_ID_OPUS:
- bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ);
- FFDEC_LoadDSI(ffd, bs, *codec, *ctx, GF_FALSE);
- gf_bs_del(bs);
-#endif
- break;
-
- }
- }
-
- }
- /*should never happen*/
- if (! (*codec)) return GF_OUT_OF_MEM;
-
- /*not sure this is the right way to do so, no doc in ffmpeg on this topic */
-#if 0
- /*check HW accel*/
- avcodec_get_context_defaults3(*ctx, *codec);
- if (*codec) {
- AVHWAccel *hwaccel=NULL;
- while ((hwaccel = av_hwaccel_next(hwaccel))){
- if (hwaccel->id == (*codec)->id) {
- (*ctx)->hwaccel_context = hwaccel;
- (*ctx)->pix_fmt = hwaccel->pix_fmt;
- break;
- }
- }
- }
-#endif
-
- /*setup MPEG-4 video streams*/
- if (ffd->st==GF_STREAM_VISUAL) {
- /*for all MPEG-4 variants get size*/
- if ((ffd->oti==GPAC_OTI_VIDEO_MPEG4_PART2)
- || (ffd->oti == GPAC_OTI_VIDEO_AVC)
- || (ffd->oti == GPAC_OTI_VIDEO_HEVC)
- || (ffd->oti == GPAC_OTI_VIDEO_AV1)
- ) {
- /*if not set this may be a remap of non-mpeg4 transport (eg, transport on MPEG-TS) where
- the DSI is carried in-band*/
- if (esd->decoderConfig->decoderSpecificInfo && esd->decoderConfig->decoderSpecificInfo->data) {
-
- /*for regular MPEG-4, try to decode and if this fails try H263 decoder at first frame*/
- if (ffd->oti==GPAC_OTI_VIDEO_MPEG4_PART2) {
-#ifndef GPAC_DISABLE_AV_PARSERS
- e = gf_m4v_get_config(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, &dsi);
- if (e) return e;
- if (dsi.width%2) dsi.width++;
- if (dsi.height%2) dsi.height++;
- (*ctx)->width = dsi.width;
- (*ctx)->height = dsi.height;
- if (!dsi.width && !dsi.height) ffd->check_short_header = GF_TRUE;
- ffd->previous_par = (dsi.par_num<<16) | dsi.par_den;
- ffd->no_par_update = GF_TRUE;
-#endif
- } else if (ffd->oti==GPAC_OTI_VIDEO_AVC) {
- ffd->check_h264_isma = GF_TRUE;
- }
-
- /*setup dsi for FFMPEG context BEFORE attaching decoder (otherwise not proper init)*/
- (*ctx)->extradata = ffmpeg_realloc_buffer((*ctx)->extradata, esd->decoderConfig->decoderSpecificInfo->dataLength + 8);
- if ((*ctx)->extradata) {
- memcpy((*ctx)->extradata, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength);
- (*ctx)->extradata_size = esd->decoderConfig->decoderSpecificInfo->dataLength;
- } else {
- /* out of mem ? */
- (*ctx)->extradata_size = 0;
- }
- }
- }
-#if !defined(FF_API_AVFRAME_LAVC)
- *frame = avcodec_alloc_frame();
-#else
- *frame = av_frame_alloc();
-#endif
-
- }
-#ifdef HAS_HEVC
- if (ffd->oti == GPAC_OTI_VIDEO_HEVC) {
- GF_SystemRTInfo rti;
- u32 nb_threads, detected_nb_threads = 1;
- const char *sOpt;
- sOpt = gf_opts_get_key("OpenHEVC", "ThreadingType");
- if (sOpt && !strcmp(sOpt, "wpp")) av_opt_set(*ctx, "thread_type", "slice", 0);
- else if (sOpt && !strcmp(sOpt, "frame+wpp")) av_opt_set(*ctx, "thread_type", "frameslice", 0);
- else {
- av_opt_set(*ctx, "thread_type", "frame", 0);
- if (!sOpt) gf_opts_set_key("OpenHEVC", "ThreadingType", "frame");
- }
- if (gf_sys_get_rti(0, &rti, 0) ) {
- detected_nb_threads = (rti.nb_cores>1) ? rti.nb_cores-1 : 1;
- }
- sOpt = gf_opts_get_key("OpenHEVC", "NumThreads");
- if (!sOpt) {
- char szO[100];
- sprintf(szO, "%d", detected_nb_threads);
- gf_opts_set_key("OpenHEVC", "NumThreads", szO);
- nb_threads = detected_nb_threads;
- } else {
- nb_threads = atoi(sOpt);
- }
- if (nb_threads > detected_nb_threads) {
- GF_LOG(GF_LOG_WARNING, GF_LOG_CODEC, ("[HEVC@ffmpeg] Initializing with %d threads but only %d available cores detected on the system\n", nb_threads, rti.nb_cores));
- } else {
- GF_LOG(GF_LOG_INFO, GF_LOG_CODEC, ("[HEVC@ffmpeg] Initializing with %d threads\n", nb_threads));
- }
- fprintf(stderr, "[HEVC@ffmpeg] Initializing with %d threads\n", nb_threads);
- av_opt_set_int(*ctx, "threads", nb_threads, 0);
-
- /* Set the decoder id */
- //av_opt_set_int(openHevcContext->c->priv_data, "decoder-id", i, 0);
-
- sOpt = gf_opts_get_key("OpenHEVC", "CBUnits");
- if (!sOpt) gf_opts_set_key("OpenHEVC", "CBUnits", "4");
- if (sOpt) ffd->output_cb_size = atoi(sOpt);
- }
-#endif //HAS_HEVC
- if (!ffd->output_cb_size) ffd->output_cb_size = 4;
-
- if (codec_id == CODEC_ID_RAWVIDEO) {
- (*ctx)->codec_id = CODEC_ID_RAWVIDEO;
- (*ctx)->pix_fmt = ffd->raw_pix_fmt;
- if ((*ctx)->extradata && strstr((char *) (*ctx)->extradata, "BottomUp")) ffd->flipped = GF_TRUE;
- } else {
-#ifdef USE_AVCTX3
- if (avcodec_open2((*ctx), (*codec), NULL )<0) return GF_NON_COMPLIANT_BITSTREAM;
-#else
- if (avcodec_open((*ctx), (*codec) )<0) return GF_NON_COMPLIANT_BITSTREAM;
-#endif
- }
-
- /*setup audio streams*/
- if (ffd->st==GF_STREAM_AUDIO) {
- if ((*codec)->id == CODEC_ID_MP2) {
- (*ctx)->frame_size = ((*ctx)->sample_rate > 24000) ? 1152 : 576;
- }
- /*may be 0 (cfg not known yet)*/
- ffd->out_size = (*ctx)->channels * (*ctx)->frame_size * 2 /*16 / 8*/;
- if (!(*ctx)->sample_rate) (*ctx)->sample_rate = 44100;
- if (!(*ctx)->channels) (*ctx)->channels = 2;
-
-#if defined(USE_AVCTX3)
-
-#if !defined(FF_API_AVFRAME_LAVC)
- ffd->audio_frame = avcodec_alloc_frame();
-#else
- ffd->audio_frame = av_frame_alloc();
-#endif
-
-#endif
-
- } else {
- switch ((*codec)->id) {
- case CODEC_ID_MJPEG:
- case CODEC_ID_MJPEGB:
- case CODEC_ID_LJPEG:
-#if (LIBAVCODEC_VERSION_INT > AV_VERSION_INT(51, 20, 0))
- case CODEC_ID_GIF:
-#endif
- case CODEC_ID_PNG:
- case CODEC_ID_RAWVIDEO:
- if ((*ctx)->pix_fmt==PIX_FMT_YUV420P) {
- ffd->pix_fmt = GF_PIXEL_YV12;
- } else {
- ffd->pix_fmt = GF_PIXEL_RGB_24;
- }
- break;
-
- case CODEC_ID_DVD_SUBTITLE:
-#if !defined(FF_API_AVFRAME_LAVC)
- *frame = avcodec_alloc_frame();
-#else
- *frame = av_frame_alloc();
-#endif
-
-#ifdef USE_AVCODEC2
- {
- AVPacket pkt;
- av_init_packet(&pkt);
- pkt.data = (uint8_t *) esd->decoderConfig->decoderSpecificInfo->data;
- pkt.size = esd->decoderConfig->decoderSpecificInfo->dataLength;
- avcodec_decode_video2((*ctx), *frame, &gotpic, &pkt);
- }
-#else
- avcodec_decode_video((*ctx), *frame, &gotpic, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength);
-#endif
- ffd->pix_fmt = GF_PIXEL_YV12;
- break;
- default:
- ffd->pix_fmt = GF_PIXEL_YV12;
- break;
- }
-
- ffd->out_pix_fmt = ffd->pix_fmt;
-
- if (ffd->out_pix_fmt == GF_PIXEL_YV12) {
- ffd->stride = (*ctx)->width;
- if (ffd->depth_codec) {
- ffd->out_size = (*ctx)->width * (*ctx)->height * 5 / 2;
- ffd->out_pix_fmt = GF_PIXEL_YUVD;
- ffd->yuv_size = (*ctx)->width * (*ctx)->height * 3 / 2;
- } else {
- ffd->out_size = (*ctx)->width * (*ctx)->height * 3 / 2;
- }
- } else {
- ffd->out_size = (*ctx)->width * (*ctx)->height * 3;
- }
- }
-
- return GF_OK;
-}
-
-static GF_Err FFDEC_DetachStream(GF_BaseDecoder *plug, u16 ES_ID)
-{
- AVCodecContext **ctx;
- AVCodec **codec;
-#ifdef FFMPEG_SWSCALE
- struct SwsContext **sws;
-#endif
- FFDec *ffd = (FFDec *)plug->privateStack;
-
- if (ffd->base_ES_ID==ES_ID) {
- ffd->base_ES_ID = 0;
- codec = &ffd->base_codec;
- ctx = &ffd->base_ctx;
-#ifdef FFMPEG_SWSCALE
- sws = &ffd->base_sws;
-#endif
- } else if (ffd->depth_ES_ID==ES_ID) {
- ffd->depth_ES_ID = 0;
- codec = &ffd->depth_codec;
- ctx = &ffd->depth_ctx;
-#ifdef FFMPEG_SWSCALE
- sws = &ffd->depth_sws;
-#endif
- } else {
- return GF_OK;
- }
-
- if (*ctx) {
- if ((*ctx)->extradata) gf_free((*ctx)->extradata);
- (*ctx)->extradata = NULL;
- if ((*ctx)->codec) avcodec_close((*ctx));
- *ctx = NULL;
- }
- *codec = NULL;
-
-#if defined(USE_AVCTX3)
- if (ffd->audio_frame) {
- av_free(ffd->audio_frame);
- }
- if (ffd->base_frame) {
- av_free(ffd->base_frame);
- }
- if (ffd->depth_frame) {
- av_free(ffd->depth_frame);
- }
-#endif
-
-#ifdef FFMPEG_SWSCALE
- if (*sws) {
- sws_freeContext(*sws);
- *sws = NULL;
- }
-#endif
-
- return GF_OK;
-}
-
-static GF_Err FFDEC_GetCapabilities(GF_BaseDecoder *plug, GF_CodecCapability *capability)
-{
- FFDec *ffd = (FFDec *)plug->privateStack;
-
- /*base caps*/
- switch (capability->CapCode) {
- /*ffmpeg seems quite reliable*/
- case GF_CODEC_RESILIENT:
- capability->cap.valueInt = 1;
- return GF_OK;
- case GF_CODEC_PADDING_BYTES:
- capability->cap.valueInt = AV_INPUT_BUFFER_PADDING_SIZE;
- return GF_OK;
- case GF_CODEC_REORDER:
- capability->cap.valueInt = 1;
- return GF_OK;
- case GF_CODEC_RAW_MEMORY:
- capability->cap.valueBool = GF_TRUE;
- return GF_OK;
- case GF_CODEC_FRAME_OUTPUT:
-#if defined(USE_AVCTX3) && defined(FFMPEG_DIRECT_DISPATCH)
- //deactivated by default until we have more tests (stride, color formats)
- capability->cap.valueBool = GF_FALSE;
-#endif
- return GF_OK;
- case GF_CODEC_WANTS_THREAD:
- capability->cap.valueBool= GF_TRUE;
- break;
- }
-
- if (!ffd->base_ctx) {
- capability->cap.valueInt = 0;
- return GF_OK;
- }
-
- /*caps valid only if stream attached*/
- switch (capability->CapCode) {
- case GF_CODEC_OUTPUT_SIZE:
- capability->cap.valueInt = ffd->out_size;
- break;
- case GF_CODEC_SAMPLERATE:
- capability->cap.valueInt = ffd->base_ctx->sample_rate;
- break;
- case GF_CODEC_NB_CHAN:
- capability->cap.valueInt = ffd->base_ctx->channels;
- break;
- case GF_CODEC_BITS_PER_SAMPLE:
- capability->cap.valueInt = 16;
- break;
- case GF_CODEC_BUFFER_MIN:
- capability->cap.valueInt = (ffd->st==GF_STREAM_AUDIO) ? 4 : 1;
- break;
- case GF_CODEC_BUFFER_MAX:
- /*for audio let the systems engine decide since we may have very large block size (1 sec with some QT movies)*/
- capability->cap.valueInt = (ffd->st==GF_STREAM_AUDIO) ? 0 : (ffd->is_image ? 1 : ffd->output_cb_size);
- break;
- /*by default AAC access unit lasts num_samples (timescale being sampleRate)*/
- case GF_CODEC_CU_DURATION:
- capability->cap.valueInt = (ffd->st==GF_STREAM_AUDIO) ? ffd->base_ctx->frame_size : 0;
- break;
- case GF_CODEC_WIDTH:
- capability->cap.valueInt = ffd->base_ctx->width;
- break;
- case GF_CODEC_HEIGHT:
- capability->cap.valueInt = ffd->base_ctx->height;
- break;
- case GF_CODEC_STRIDE:
- if (ffd->out_pix_fmt==GF_PIXEL_RGB_24)
- capability->cap.valueInt = ffd->stride*3;
- else if (ffd->out_pix_fmt==GF_PIXEL_RGBA)
- capability->cap.valueInt = ffd->stride*4;
- else
- capability->cap.valueInt = ffd->stride;
- break;
- case GF_CODEC_FPS:
- capability->cap.valueFloat = 30.0f;
- break;
- case GF_CODEC_PAR:
- capability->cap.valueInt = ffd->previous_par;
- break;
- case GF_CODEC_PIXEL_FORMAT:
- if (ffd->base_ctx->width) capability->cap.valueInt = ffd->out_pix_fmt;
- break;
- /*ffmpeg performs frame reordering internally*/
- case GF_CODEC_REORDER:
- capability->cap.valueInt = 1;
- break;
- case GF_CODEC_TRUSTED_CTS:
- capability->cap.valueInt = 1;
- break;
- case GF_CODEC_WAIT_RAP:
- //ffd->ctx->hurry_up = 5;
- break;
- case GF_CODEC_CHANNEL_CONFIG:
- /*currently unused in ffmpeg*/
- if (ffd->base_ctx->channels==1) {
- capability->cap.valueInt = GF_AUDIO_CH_FRONT_CENTER;
- } else {
- capability->cap.valueInt = GF_AUDIO_CH_FRONT_LEFT | GF_AUDIO_CH_FRONT_RIGHT;
- }
- break;
-
- case GF_CODEC_PADDING_BYTES:
- capability->cap.valueInt = AV_INPUT_BUFFER_PADDING_SIZE;
- break;
- default:
- capability->cap.valueInt = 0;
- break;
- }
- return GF_OK;
-}
-
-static GF_Err FFDEC_SetCapabilities(GF_BaseDecoder *plug, GF_CodecCapability capability)
-{
- FFDec *ffd = (FFDec *)plug->privateStack;
- assert(plug);
- assert( ffd );
- switch (capability.CapCode) {
- case GF_CODEC_WAIT_RAP:
- ffd->frame_start = 0;
- if (ffd->st==GF_STREAM_VISUAL) {
- if (ffd->base_ctx && ffd->base_ctx->codec) avcodec_flush_buffers(ffd->base_ctx);
- if (ffd->depth_ctx && ffd->depth_ctx->codec) avcodec_flush_buffers(ffd->depth_ctx);
- }
- return GF_OK;
- case GF_CODEC_RAW_MEMORY:
- ffd->direct_output_mode = capability.cap.valueBool ? 1 : 0;
- return GF_OK;
- case GF_CODEC_FRAME_OUTPUT:
- ffd->direct_output_mode = capability.cap.valueInt ? 2 : 0;
- return GF_OK;
- default:
- /*return unsupported to avoid confusion by the player (like color space changing ...) */
- return GF_NOT_SUPPORTED;
- }
-}
-static GF_Err FFDEC_GetOutputPixelFromat (u32 pix_fmt, u32 * out_pix_fmt, FFDec *ffd)
-{
-
- if (!out_pix_fmt || !ffd) return GF_BAD_PARAM;
-
- switch (pix_fmt) {
- case PIX_FMT_YUV420P:
- *out_pix_fmt = GF_PIXEL_YV12;
- break;
- case PIX_FMT_YUV420P10LE:
- *out_pix_fmt = GF_PIXEL_YV12_10;
- break;
- case PIX_FMT_YUV422P:
- *out_pix_fmt = GF_PIXEL_YUV422;
- break;
- case PIX_FMT_YUV422P10LE:
- *out_pix_fmt = GF_PIXEL_YUV422_10;
- break;
- case PIX_FMT_YUV444P:
- *out_pix_fmt = GF_PIXEL_YUV444;
- break;
- case PIX_FMT_YUV444P10LE:
- *out_pix_fmt = GF_PIXEL_YUV444_10;
- break;
- case PIX_FMT_RGBA:
- *out_pix_fmt = GF_PIXEL_RGBA;
- break;
- case PIX_FMT_RGB24:
- *out_pix_fmt = GF_PIXEL_RGB_24;
- break;
- case PIX_FMT_BGR24:
- *out_pix_fmt = GF_PIXEL_BGR_24;
- break;
-
- default:
- return GF_NOT_SUPPORTED;
-
- }
- return GF_OK;
-
-}
-
-
-static GF_Err FFDEC_ProcessAudio(FFDec *ffd,
- char *inBuffer, u32 inBufferLength,
- u16 ES_ID, u32 *CTS,
- char *outBuffer, u32 *outBufferLength,
- u8 PaddingBits, u32 mmlevel)
-{
-
-#ifdef USE_AVCODEC2
- AVPacket pkt;
-#endif
- s32 gotpic;
- AVCodecContext *ctx = ffd->base_ctx;
- s32 len;
- u32 buf_size = (*outBufferLength);
-
-#ifdef USE_AVCODEC2
- av_init_packet(&pkt);
- pkt.data = (uint8_t *)inBuffer;
- pkt.size = inBufferLength;
-#endif
-
- (*outBufferLength) = 0;
-
- /*seeking don't decode*/
- if (!inBuffer || (mmlevel == GF_CODEC_LEVEL_SEEK)) {
- *outBufferLength = 0;
- ffd->frame_start = 0;
- return GF_OK;
- }
- if (ffd->frame_start>inBufferLength) ffd->frame_start = 0;
- //seek to last byte consumed by the previous decode4()
- else if (ffd->frame_start) {
- pkt.data += ffd->frame_start;
- pkt.size -= ffd->frame_start;
- }
-redecode:
-
-#if defined(USE_AVCTX3)
- len = avcodec_decode_audio4(ctx, ffd->audio_frame, &gotpic, &pkt);
- if (gotpic) {
- //int inputDataSize = av_samples_get_buffer_size(NULL, ctx->channels, ffd->audio_frame->nb_samples, ctx->sample_fmt, 1);
- gotpic = ffd->audio_frame->nb_samples * 2 * ctx->channels;
- }
-#elif defined(USE_AVCODEC2)
- gotpic = 192000;
- len = avcodec_decode_audio3(ctx, (short *)ffd->audio_buf, &gotpic, &pkt);
-#else
- gotpic = AVCODEC_MAX_AUDIO_FRAME_SIZE;
- len = avcodec_decode_audio2(ctx, (short *)ffd->audio_buf, &gotpic, inBuffer + ffd->frame_start, inBufferLength - ffd->frame_start);
-#endif
- if (len<0) {
- ffd->frame_start = 0;
- return GF_NON_COMPLIANT_BITSTREAM;
- }
- if (gotpic<0) {
- ffd->frame_start = 0;
- return GF_OK;
- }
-
- /*first config*/
- if (!ffd->out_size) {
- u32 bpp = 2;
-
- if (ctx->channels * ctx->frame_size * bpp < gotpic) ctx->frame_size = gotpic / (bpp * ctx->channels);
- ffd->out_size = ctx->channels * ctx->frame_size * bpp;
- }
- if (ffd->out_size < (u32) gotpic) {
- /*looks like relying on frame_size is not a good idea for all codecs, so we use gotpic*/
- (*outBufferLength) = ffd->out_size = gotpic;
- return GF_BUFFER_TOO_SMALL;
- }
- if (ffd->out_size > buf_size) {
- /*don't use too small output chunks otherwise we'll never have enough when mixing - we could
- also request more slots in the composition memory but let's not waste mem*/
- if (ffd->out_size < (u32) 576*ctx->channels) ffd->out_size=ctx->channels*576;
- (*outBufferLength) = ffd->out_size;
- return GF_BUFFER_TOO_SMALL;
- }
-
-#if defined(USE_AVCTX3)
- if (ffd->audio_frame->format==AV_SAMPLE_FMT_FLTP) {
- s32 i, j;
- s16 *output = (s16 *) outBuffer;
- for (j=0; j<ctx->channels; j++) {
- Float* inputChannel = (Float*)ffd->audio_frame->extended_data[j];
- for (i=0 ; i<ffd->audio_frame->nb_samples ; i++) {
- Float sample = inputChannel[i];
- if (sample<-1.0f) sample=-1.0f;
- else if (sample>1.0f) sample=1.0f;
-
- output[i*ctx->channels + j] = (int16_t) (sample * GF_SHORT_MAX );
- }
- }
- } else if (ffd->audio_frame->format==AV_SAMPLE_FMT_S16P) {
- s32 i, j;
- s16 *output = (s16 *) outBuffer;
- for (j=0; j<ctx->channels; j++) {
- s16* inputChannel = (s16*)ffd->audio_frame->extended_data[j];
- for (i=0 ; i<ffd->audio_frame->nb_samples ; i++) {
- Float sample = inputChannel[i];
- output[i*ctx->channels + j] = (int16_t) (sample );
- }
- }
- } else if (ffd->audio_frame->format==AV_SAMPLE_FMT_U8) {
- u32 i, size = ffd->audio_frame->nb_samples * ctx->channels;
- s16 *output = (s16 *) outBuffer;
- s8 *input = (s8 *) ffd->audio_frame->data[0];
- for (i=0; i<size; i++) {
- output [i] = input[i] * 128;
- }
- } else if (ffd->audio_frame->format==AV_SAMPLE_FMT_S32) {
- u32 i, shift, size = ffd->audio_frame->nb_samples * ctx->channels;
- s16 *output = (s16 *) outBuffer;
- s32 *input = (s32*) ffd->audio_frame->data[0];
- shift = 1<<31;
- for (i=0; i<size; i++) {
- output [i] = input[i] * shift;
- }
- } else if (ffd->audio_frame->format==AV_SAMPLE_FMT_FLT) {
- u32 i, size = ffd->audio_frame->nb_samples * ctx->channels;
- s16 *output = (s16 *) outBuffer;
- Float *input = (Float *) ffd->audio_frame->data[0];
- for (i=0; i<size; i++) {
- Float sample = input[i];
- if (sample<-1.0f) sample=-1.0f;
- else if (sample>1.0f) sample=1.0f;
- output [i] = (int16_t) (sample * GF_SHORT_MAX);
- }
- } else if (ffd->audio_frame->format==AV_SAMPLE_FMT_S16) {
- memcpy(outBuffer, ffd->audio_frame->data[0], sizeof(char) * ffd->audio_frame->nb_samples * ctx->channels*2);
- } else if (ffd->audio_frame->nb_samples) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[FFMPEG Decoder] Raw Audio format %d not supported\n", ffd->audio_frame->format ));
- }
-#else
- /*we're sure to have at least gotpic bytes available in output*/
- memcpy(outBuffer, ffd->audio_buf, sizeof(char) * gotpic);
-#endif
-
- (*outBufferLength) += gotpic;
- outBuffer += gotpic;
-
-#if defined(USE_AVCTX3)
- ffd->audio_frame->nb_samples = 0;
-#endif
-
- ffd->frame_start += len;
- if (inBufferLength <= ffd->frame_start) {
- ffd->frame_start = 0;
- return GF_OK;
- }
- /*still space go on*/
- if ((*outBufferLength)+ctx->frame_size<ffd->out_size) goto redecode;
-
- /*more frames in the current sample*/
- return GF_PACKED_FRAMES;
-}
-
-//TODO check why we need this one ...
-static GF_Err FFDEC_ProcessRawVideo(FFDec *ffd,
- char *inBuffer, u32 inBufferLength,
- u16 ES_ID, u32 *CTS,
- char *outBuffer, u32 *outBufferLength,
- u8 PaddingBits, u32 mmlevel)
-{
- AVCodecContext *ctx = ffd->base_ctx;
-
- if (*outBufferLength != ffd->out_size) {
- *outBufferLength = ffd->out_size;
- return GF_BUFFER_TOO_SMALL;
- }
- if (inBufferLength) {
- *outBufferLength = ffd->out_size;
-// assert(inBufferLength==ffd->out_size);
-
- if (ffd->raw_pix_fmt==PIX_FMT_BGR24) {
- s32 i, j;
- for (j=0; j<ctx->height; j++) {
- u8 *src = (u8 *) inBuffer + j*3*ctx->width;
- u8 *dst = (u8 *)outBuffer + j*3*ctx->width;
- if (ffd->flipped) {
- dst = (u8 *)outBuffer + (ctx->height-j-1) * 3*ctx->width;
- }
- for (i=0; i<ctx->width; i++) {
- dst[0] = src[2];
- dst[1] = src[1];
- dst[2] = src[2];
- src += 3;
- dst += 3;
- }
- }
- } else {
- memcpy(outBuffer, inBuffer, ffd->out_size);
- }
- } else {
- *outBufferLength = 0;
- }
- return GF_OK;
-}
-
-
-
-static GF_Err FFDEC_ProcessVideo(FFDec *ffd,
- char *inBuffer, u32 inBufferLength,
- u16 ES_ID, u32 *CTS,
- char *outBuffer, u32 *outBufferLength,
- u8 PaddingBits, u32 mmlevel)
-{
-#ifdef USE_AVCODEC2
- AVPacket pkt;
-#endif
- AVPicture pict;
- u32 pix_out=0;
- s32 w, h, gotpic, stride, ret;
- u32 outsize=0, out_pix_fmt;
- AVCodecContext *ctx;
- AVCodec **codec;
- AVFrame *frame;
-#ifdef FFMPEG_SWSCALE
- struct SwsContext **cached_sws = &(ffd->base_sws);
-#endif
-
- if (!ES_ID || (ffd->base_ES_ID==ES_ID)) {
- ctx = ffd->base_ctx;
- codec = &ffd->base_codec;
- frame = ffd->base_frame;
- } else if (ffd->depth_ES_ID==ES_ID) {
- ctx = ffd->depth_ctx;
- codec = &ffd->depth_codec;
- frame = ffd->depth_frame;
- } else {
- return GF_BAD_PARAM;
- }
-
- /*WARNING: this breaks H264 (and maybe others) decoding, disabled for now*/
-#if 0
- if (!ctx->hurry_up) {
- switch (mmlevel) {
- case GF_CODEC_LEVEL_SEEK:
- case GF_CODEC_LEVEL_DROP:
- /*skip as much as possible*/
- ctx->hurry_up = 5;
- break;
- case GF_CODEC_LEVEL_VERY_LATE:
- case GF_CODEC_LEVEL_LATE:
- /*skip B-frames*/
- ctx->hurry_up = 1;
- break;
- default:
- ctx->hurry_up = 0;
- break;
- }
- }
-#endif
-
-#ifdef USE_AVCODEC2
- av_init_packet(&pkt);
- pkt.data = (uint8_t *)inBuffer;
- pkt.size = inBufferLength;
- pkt.dts=0;
- pkt.pts = *CTS;
-#endif
-
- *outBufferLength = 0;
- /*visual stream*/
- w = ctx->width;
- h = ctx->height;
-
- /*we have a valid frame not yet dispatched*/
- if (ffd->had_pic) {
- ffd->had_pic = GF_FALSE;
- gotpic = ffd->needs_output_resize ? 0 : 1;
- ffd->needs_output_resize = 0;
- } else {
- if (ffd->check_h264_isma) {
- /*for AVC bitstreams after ISMA decryption, in case (as we do) the decryption DRM tool
- doesn't put back nalu size, do it ourselves...*/
- if (inBuffer && !inBuffer[0] && !inBuffer[1] && !inBuffer[2] && (inBuffer[3]==0x01)) {
- u32 nalu_size;
- char *start, *end, *bufferEnd;
-
- start = inBuffer;
- end = inBuffer + 4;
- bufferEnd = inBuffer + inBufferLength;
- /* FIXME : SOUCHAY : not sure of exact behaviour, but old one was reading non-allocated memory */
- while ((end+3) < bufferEnd) {
- if (!end[0] && !end[1] && !end[2] && (end[3]==0x01)) {
- nalu_size = (u32) (end - start - 4);
- start[0] = (nalu_size>>24)&0xFF;
- start[1] = (nalu_size>>16)&0xFF;
- start[2] = (nalu_size>>8)&0xFF;
- start[3] = (nalu_size)&0xFF;
- start = end;
- end = start+4;
- continue;
- }
- end++;
- }
- nalu_size = (u32) ((inBuffer+inBufferLength) - start - 4);
- start[0] = (nalu_size>>24)&0xFF;
- start[1] = (nalu_size>>16)&0xFF;
- start[2] = (nalu_size>>8)&0xFF;
- start[3] = (nalu_size)&0xFF;
- ffd->check_h264_isma = 2;
- }
- /*if we had ISMA E&A and lost it this is likely due to a pck loss - do NOT switch back to regular*/
- else if (ffd->check_h264_isma == 1) {
- ffd->check_h264_isma = GF_FALSE;
- }
- }
-
-#ifdef USE_AVCODEC2
- if (avcodec_decode_video2(ctx, frame, &gotpic, &pkt) < 0) {
-#else
- if (avcodec_decode_video(ctx, frame, &gotpic, inBuffer, inBufferLength) < 0) {
-#endif
- if (!ffd->check_short_header) {
- return GF_NON_COMPLIANT_BITSTREAM;
- }
-
- /*switch to H263 (ffmpeg MPEG-4 codec doesn't understand short headers)*/
- {
- u32 old_codec = (*codec)->id;
- ffd->check_short_header = GF_FALSE;
- /*OK we loose the DSI stored in the codec context, but H263 doesn't need any, and if we're
- here this means the DSI was broken, so no big deal*/
- avcodec_close(ctx);
- *codec = avcodec_find_decoder(CODEC_ID_H263);
-
-#ifdef USE_AVCTX3
- if (! (*codec) || (avcodec_open2(ctx, *codec, NULL)<0)) return GF_NON_COMPLIANT_BITSTREAM;
-#else
- if (! (*codec) || (avcodec_open(ctx, *codec)<0)) return GF_NON_COMPLIANT_BITSTREAM;
-#endif
-
-#if USE_AVCODEC2
- if (avcodec_decode_video2(ctx, frame, &gotpic, &pkt) < 0) {
-#else
- if (avcodec_decode_video(ctx, frame, &gotpic, inBuffer, inBufferLength) < 0) {
-#endif
- /*nope, stay in MPEG-4*/
- avcodec_close(ctx);
- *codec = avcodec_find_decoder(old_codec);
- assert(*codec);
-#ifdef USE_AVCTX3
- avcodec_open2(ctx, *codec, NULL);
-#else
- avcodec_open(ctx, *codec);
-#endif
- return GF_NON_COMPLIANT_BITSTREAM;
- }
- }
- }
-
- /*
- if (!gotpic && (!ctx->width || !ctx->height) ) {
- ctx->width = w;
- ctx->height = h;
- return GF_OK;
- }
- */
- /*some streams use odd width/height frame values*/
- if (ffd->out_pix_fmt == GF_PIXEL_YV12) {
- if (ctx->width%2) ctx->width++;
- if (ctx->height%2) ctx->height++;
- }
- }
-
- /*we have a picture and need resize, do it*/
- if (gotpic && ffd->needs_output_resize) {
- ffd->needs_output_resize = GF_FALSE;
- ffd->had_pic = GF_TRUE;
- *outBufferLength = ffd->out_size;
- if (ffd->direct_output_mode) {
- ffd->frame_size_changed = GF_TRUE;
- } else {
- return GF_BUFFER_TOO_SMALL;
- }
- }
-
- stride = frame->linesize[0];
-
- ret = FFDEC_GetOutputPixelFromat(ctx->pix_fmt, &out_pix_fmt, ffd);
- if ( ret < 0)
- {
- return ret;
- }
-
- /*recompute outsize in case on-the-fly change*/
- if ((w != ctx->width) || (h != ctx->height)
- || (ffd->direct_output_mode && (stride != ffd->stride))
- || (ffd->out_pix_fmt != out_pix_fmt)
- //need to realloc the conversion buffer
-
- ) {
-
- ffd->stride = (ffd->direct_output_mode) ? frame->linesize[0] : ctx->width;
- if (ctx->pix_fmt == PIX_FMT_RGBA) {
- ffd->out_pix_fmt = ffd->pix_fmt = GF_PIXEL_RGBA;
- outsize = ctx->width * ctx->height * 4;
- }
- else if (ffd->out_pix_fmt == GF_PIXEL_RGB_24) {
- outsize = ctx->width * ctx->height * 3;
- }
- else if (ctx->pix_fmt == PIX_FMT_YUV420P)
- {
- outsize = ffd->stride * ctx->height * 3 /2 ;
- ffd->out_pix_fmt = GF_PIXEL_YV12;
-
- }
-
- else if (ctx->pix_fmt == PIX_FMT_YUV422P)
- {
- outsize = ffd->stride * ctx->height * 2 ;
- ffd->out_pix_fmt = GF_PIXEL_YUV422;
-
- }
- else if (ctx->pix_fmt == PIX_FMT_YUV444P)
- {
- outsize = ffd->stride * ctx->height * 3 ;
- ffd->out_pix_fmt = GF_PIXEL_YUV444;
- }
-#ifndef NO_10bit
- //this YUV format is handled natively in GPAC
- else if (ctx->pix_fmt == PIX_FMT_YUV420P10LE) {
- ffd->stride = ffd->direct_output_mode ? frame->linesize[0] : ctx->width * 2;
- ffd->out_pix_fmt = GF_PIXEL_YV12_10;
- outsize = 3*ffd->stride * ctx->height / 2;
- }
- else if (ctx->pix_fmt == PIX_FMT_YUV422P10LE) {
- ffd->stride = ffd->direct_output_mode ? frame->linesize[0] : ctx->width * 2;
- ffd->out_pix_fmt = GF_PIXEL_YUV422_10;
- outsize = ffd->stride * ctx->height * 2;
- }
- else if (ctx->pix_fmt == PIX_FMT_YUV444P10LE) {
- ffd->stride = ffd->direct_output_mode ? frame->linesize[0] : ctx->width * 2;
- ffd->out_pix_fmt = GF_PIXEL_YUV444_10;
- outsize = ffd->stride * ctx->height * 3;
- }
-#endif
-
-
-
- if (ffd->depth_codec) {
- outsize = 5 * ctx->width * ctx->height / 2;
- ffd->yuv_size = 3 * ctx->width * ctx->height / 2;
- }
- ffd->out_size = outsize;
-
- if (!ffd->no_par_update && ctx->sample_aspect_ratio.num && ctx->sample_aspect_ratio.den) {
- ffd->previous_par = (ctx->sample_aspect_ratio.num<<16) | ctx->sample_aspect_ratio.den;
- }
-
- /*we didn't get any picture: wait for a picture before resizing output buffer, otherwise we will have no
- video in the output buffer*/
- if (!gotpic) {
- ffd->needs_output_resize = GF_TRUE;
-// return GF_OK;
- }
- *outBufferLength = ffd->out_size;
- if (ffd->check_h264_isma) {
- inBuffer[0] = inBuffer[1] = inBuffer[2] = 0;
- inBuffer[3] = 1;
- }
-#ifdef FFMPEG_SWSCALE
- if (*cached_sws) {
- sws_freeContext(*cached_sws);
- *cached_sws = NULL;
- }
-#endif
- ffd->had_pic = GF_TRUE;
-
- if (ffd->direct_output_mode) {
- ffd->frame_size_changed = GF_TRUE;
-
- } else {
- return GF_BUFFER_TOO_SMALL;
- }
- }
- /*check PAR in case on-the-fly change*/
- if (!ffd->no_par_update && ctx->sample_aspect_ratio.num && ctx->sample_aspect_ratio.den) {
- u32 new_par = (ctx->sample_aspect_ratio.num<<16) | ctx->sample_aspect_ratio.den;
- if (ffd->previous_par && (new_par != ffd->previous_par)) {
- ffd->previous_par = new_par;
-
- if (!gotpic) {
- ffd->needs_output_resize = GF_TRUE;
- return GF_OK;
- }
- *outBufferLength = ffd->out_size;
- ffd->had_pic = GF_TRUE;
- if (ffd->direct_output_mode) {
- ffd->frame_size_changed = GF_TRUE;
- } else {
- return GF_BUFFER_TOO_SMALL;
- }
- }
- }
-
-// if (mmlevel == GF_CODEC_LEVEL_SEEK) return GF_OK;
-
- if (!gotpic) return GF_OK;
-
-#if (LIBAVCODEC_VERSION_MAJOR>52)
- //fixme - investigate this, happens in some dash cases
- if ((frame->width!=ctx->width) || (frame->height!=ctx->height)) {
- *outBufferLength = 0;
- return GF_OK;
- }
-#endif
-
- //copy over CTS of packet passed in decode()
- *CTS = (u32) frame->pkt_pts;
-
- if (ffd->direct_output_mode) {
- *outBufferLength = ffd->out_size;
- return GF_OK;
- }
-
- if (ES_ID && (ES_ID == ffd->depth_ES_ID)) {
- s32 i;
- u8 *pYO, *pYD;
-
- pYO = frame->data[0];
- pYD = (u8 *) outBuffer+ffd->yuv_size;
- for (i=0; i<ctx->height; i++) {
- memcpy(pYD, pYO, sizeof(char) * ctx->width);
- pYD += ctx->width;
- pYO += frame->linesize[0];
- }
- *outBufferLength = ffd->out_size;
- return GF_OK;
- }
-
-#if defined(_WIN32_WCE) || defined(__SYMBIAN32__)
- if (ffd->pix_fmt==GF_PIXEL_RGB_24) {
- memcpy(outBuffer, frame->data[0], sizeof(char)*3*ctx->width);
- } else if (ffd->pix_fmt==GF_PIXEL_RGBA) {
- memcpy(outBuffer, frame->data[0], sizeof(char)*4*ctx->width);
- } else {
- s32 i;
- char *pYO, *pUO, *pVO;
- unsigned char *pYD, *pUD, *pVD;
- pYO = frame->data[0];
- pUO = frame->data[1];
- pVO = frame->data[2];
- pYD = outBuffer;
- pUD = outBuffer + ctx->width * ctx->height;
- pVD = outBuffer + 5 * ctx->width * ctx->height / 4;
-
-
- for (i=0; i<ctx->height; i++) {
- memcpy(pYD, pYO, sizeof(char) * ctx->width);
- pYD += ctx->width;
- pYO += frame->linesize[0];
- if (i%2) continue;
-
- memcpy(pUD, pUO, sizeof(char) * ctx->width/2);
- memcpy(pVD, pVO, sizeof(char) * ctx->width/2);
- pUD += ctx->width/2;
- pVD += ctx->width/2;
- pUO += frame->linesize[1];
- pVO += frame->linesize[2];
- }
- *outBufferLength = ffd->out_size;
- }
-#else
-
- memset(&pict, 0, sizeof(pict));
- if (ffd->out_pix_fmt==GF_PIXEL_RGB_24) {
- pict.data[0] = (uint8_t *)outBuffer;
- pict.linesize[0] = 3*ctx->width;
- pix_out = PIX_FMT_RGB24;
- } else if (ffd->out_pix_fmt==GF_PIXEL_RGBA) {
- pict.data[0] = (uint8_t *)outBuffer;
- pict.linesize[0] = 4*ctx->width;
- pix_out = PIX_FMT_RGBA;
- } else {
- if (ffd->out_pix_fmt == GF_PIXEL_YV12) {
- pict.data[0] = (uint8_t *)outBuffer;
- pict.data[1] = (uint8_t *)outBuffer + ffd->stride * ctx->height;
- pict.data[2] = (uint8_t *)outBuffer + 5 * ffd->stride * ctx->height / 4;
- pict.linesize[0] = ffd->stride;
- pict.linesize[1] = pict.linesize[2] = ffd->stride/2;
- pix_out = PIX_FMT_YUV420P;
- } else if (ffd->out_pix_fmt == GF_PIXEL_YUV422) {
- pict.data[0] = (uint8_t *)outBuffer;
- pict.data[1] = (uint8_t *)outBuffer + ffd->stride * ctx->height;
- pict.data[2] = (uint8_t *)outBuffer + 3*ffd->stride * ctx->height/2;
- pict.linesize[0] = ffd->stride;
- pict.linesize[1] = pict.linesize[2] = ffd->stride/2;
- pix_out = PIX_FMT_YUV422P;
- } else if (ffd->out_pix_fmt == GF_PIXEL_YUV444) {
- pict.data[0] = (uint8_t *)outBuffer;
- pict.data[1] = (uint8_t *)outBuffer + ffd->stride * ctx->height;
- pict.data[2] = (uint8_t *)outBuffer + 2*ffd->stride * ctx->height;
- pict.linesize[0] = pict.linesize[1] = pict.linesize[2] = ffd->stride;
- pix_out = PIX_FMT_YUV444P;
- }
-#ifndef NO_10bit
- //this YUV format is handled natively in GPAC
- if (ctx->pix_fmt==PIX_FMT_YUV420P10LE) {
- pict.data[0] = (uint8_t *)outBuffer;
- pict.data[1] = (uint8_t *)outBuffer + ffd->stride * ctx->height;
- pict.data[2] = (uint8_t *)outBuffer + 5 * ffd->stride * ctx->height / 4;
- pict.linesize[0] = ffd->stride;
- pict.linesize[1] = pict.linesize[2] = ffd->stride/2;
- pix_out = PIX_FMT_YUV420P10LE;
- } else if (ctx->pix_fmt==PIX_FMT_YUV422P10LE) {
- pict.data[0] = (uint8_t *)outBuffer;
- pict.data[1] = (uint8_t *)outBuffer + ffd->stride * ctx->height;
- pict.data[2] = (uint8_t *)outBuffer + 3*ffd->stride * ctx->height/2;
- pict.linesize[0] = ffd->stride;
- pict.linesize[1] = pict.linesize[2] = ffd->stride/2;
- pix_out = PIX_FMT_YUV422P10LE;
- } else if (ctx->pix_fmt==PIX_FMT_YUV444P10LE) {
- pict.data[0] = (uint8_t *)outBuffer;
- pict.data[1] = (uint8_t *)outBuffer + ffd->stride * ctx->height;
- pict.data[2] = (uint8_t *)outBuffer + 2*ffd->stride * ctx->height;
- pict.linesize[0] = pict.linesize[1] = pict.linesize[2] = ffd->stride;
- pix_out = PIX_FMT_YUV444P10LE;
- }
-#endif
-
-#if (LIBAVCODEC_VERSION_MAJOR<56)
- if (!mmlevel && frame->interlaced_frame) {
- avpicture_deinterlace((AVPicture *) frame, (AVPicture *) frame, ctx->pix_fmt, ctx->width, ctx->height);
- }
-#endif
-
- }
- pict.data[3] = 0;
- pict.linesize[3] = 0;
- *CTS = (u32) frame->pkt_pts;
-
-#ifndef FFMPEG_SWSCALE
- img_convert(&pict, pix_out, (AVPicture *) frame, ctx->pix_fmt, ctx->width, ctx->height);
-#else
- *cached_sws = sws_getCachedContext(*cached_sws,
- ctx->width, ctx->height, ctx->pix_fmt,
- ctx->width, ctx->height, pix_out,
- SWS_BICUBIC, NULL, NULL, NULL);
- if ((*cached_sws)) {
-#if LIBSWSCALE_VERSION_INT < AV_VERSION_INT(0, 9, 0)
- sws_scale((*cached_sws), frame->data, frame->linesize, 0, ctx->height, pict.data, pict.linesize);
-#else
- sws_scale((*cached_sws), (const uint8_t * const*)frame->data, frame->linesize, 0, ctx->height, pict.data, pict.linesize);
-#endif
-
- }
-#endif
-
- *outBufferLength = ffd->out_size;
-#endif
-
- return GF_OK;
-}
-
-
-
-static GF_Err FFDEC_ProcessData(GF_MediaDecoder *plug,
- char *inBuffer, u32 inBufferLength,
- u16 ES_ID, u32 *CTS,
- char *outBuffer, u32 *outBufferLength,
- u8 PaddingBits, u32 mmlevel)
-{
- FFDec *ffd = (FFDec*)plug->privateStack;
-
- if (ffd->st==GF_STREAM_AUDIO) {
- return FFDEC_ProcessAudio(ffd, inBuffer, inBufferLength, ES_ID, CTS, outBuffer, outBufferLength, PaddingBits, mmlevel);
- } else if ( ffd->base_ctx->codec_id == CODEC_ID_RAWVIDEO) {
- return FFDEC_ProcessRawVideo(ffd, inBuffer, inBufferLength, ES_ID, CTS, outBuffer, outBufferLength, PaddingBits, mmlevel);
- } else {
- return FFDEC_ProcessVideo(ffd, inBuffer, inBufferLength, ES_ID, CTS, outBuffer, outBufferLength, PaddingBits, mmlevel);
- }
-}
-
-
-static GF_Err FFDEC_GetOutputBuffer(GF_MediaDecoder *ifcg, u16 ES_ID, u8 **pY_or_RGB, u8 **pU, u8 **pV)
-{
- FFDec *ffd = (FFDec*)ifcg->privateStack;
- AVFrame *frame;
-
- if (ffd->direct_output_mode != 1) return GF_BAD_PARAM;
-
- if (ES_ID && (ffd->depth_ES_ID==ES_ID)) {
- frame = ffd->depth_frame;
- *pY_or_RGB = frame->data[0];
- } else {
- frame = ffd->base_frame;
- *pY_or_RGB = frame->data[0];
- *pU = frame->data[1];
- *pV = frame->data[2];
- }
- return GF_OK;
-}
-
-#if defined(USE_AVCTX3) && defined(FFMPEG_DIRECT_DISPATCH)
-
-typedef struct
-{
- FFDec *ctx;
- AVFrame *frame;
-} FF_Frame;
-
-void FFFrame_Release(GF_MediaDecoderFrame *frame)
-{
- FF_Frame *ff_frame = (FF_Frame *)frame->user_data;
-
- av_frame_free(&ff_frame->frame);
-}
-
-GF_Err FFFrame_GetPlane(GF_MediaDecoderFrame *frame, u32 plane_idx, const char **outPlane, u32 *outStride)
-{
- FF_Frame *ff_frame = (FF_Frame *)frame->user_data;
- switch (ff_frame->ctx->out_pix_fmt) {
- case GF_PIXEL_YV12:
- case GF_PIXEL_YV12_10:
- case GF_PIXEL_YUV422:
- case GF_PIXEL_YUV422_10:
- case GF_PIXEL_YUV444:
- case GF_PIXEL_YUV444_10:
- if (plane_idx>2) return GF_BAD_PARAM;
- *outPlane = (const char *) ff_frame->frame->data[plane_idx];
- *outStride = ff_frame->frame->linesize[plane_idx];
- break;
- case GF_PIXEL_RGBA:
- case GF_PIXEL_RGB_24:
- case GF_PIXEL_BGR_24:
- if (plane_idx>0) return GF_BAD_PARAM;
- *outPlane = (const char *) ff_frame->frame->data[plane_idx];
- *outStride = ff_frame->frame->linesize[plane_idx];
- break;
- default:
- return GF_NOT_SUPPORTED;
- }
- return GF_OK;
-}
-
-static GF_Err FFDEC_GetOutputFrame(GF_MediaDecoder *ifcg, u16 ES_ID, GF_MediaDecoderFrame **frame, Bool *needs_resize)
-{
- GF_MediaDecoderFrame *a_frame;
- FF_Frame *ff_frame;
- FFDec *ffd = (FFDec*)ifcg->privateStack;
-
- *needs_resize = GF_FALSE;
-
- if (!ffd->base_frame) return GF_BAD_PARAM;
-
- GF_SAFEALLOC(a_frame, GF_MediaDecoderFrame);
- if (!a_frame) return GF_OUT_OF_MEM;
- GF_SAFEALLOC(ff_frame, FF_Frame);
- if (!ff_frame) {
- gf_free(a_frame);
- return GF_OUT_OF_MEM;
- }
- a_frame->user_data = ff_frame;
- ff_frame->ctx = ffd;
- ff_frame->frame = av_frame_clone(ffd->base_frame);
-
- a_frame->Release = FFFrame_Release;
- a_frame->GetPlane = FFFrame_GetPlane;
-
- *frame = a_frame;
- if (ffd->frame_size_changed) {
- ffd->frame_size_changed = GF_FALSE;
- *needs_resize = GF_TRUE;
- }
-
- return GF_OK;
-}
-#endif //USE_AVCTX3
-
-static u32 FFDEC_CanHandleStream(GF_BaseDecoder *plug, u32 StreamType, GF_ESD *esd, u8 PL)
-{
- GF_BitStream *bs;
- u32 codec_id;
- Bool check_4cc;
- FFDec *ffd = (FFDec*)plug->privateStack;
-
- /*media type query*/
- if (!esd) {
- if ((StreamType==GF_STREAM_VISUAL) || (StreamType==GF_STREAM_AUDIO)) return GF_CODEC_STREAM_TYPE_SUPPORTED;
- return GF_CODEC_NOT_SUPPORTED;
- }
-
- /*store types*/
- ffd->oti = esd->decoderConfig->objectTypeIndication;
- ffd->st = StreamType;
-
- codec_id = 0;
- check_4cc = GF_FALSE;
-
- /*private from FFMPEG input*/
- if (ffd->oti == GPAC_OTI_MEDIA_FFMPEG) {
- bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ);
- codec_id = gf_bs_read_u32(bs);
- gf_bs_del(bs);
- }
- /*private from IsoMedia input*/
- else if (ffd->oti == GPAC_OTI_MEDIA_GENERIC) {
- bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ);
- codec_id = gf_bs_read_u32(bs);
- check_4cc = GF_TRUE;
- gf_bs_del(bs);
-
- if (codec_id == GF_4CC('s','a','m','r')) {
- codec_id = CODEC_ID_AMR_NB;
- }
- else if (codec_id == GF_4CC('s','a','w','b')) {
- codec_id = CODEC_ID_AMR_WB;
- }
- }
- else if (StreamType==GF_STREAM_AUDIO) {
- /*std MPEG-2 audio*/
- switch (ffd->oti) {
- case GPAC_OTI_AUDIO_MPEG2_PART3:
- case GPAC_OTI_AUDIO_MPEG1:
- codec_id = CODEC_ID_MP2;
- break;
- case GPAC_OTI_AUDIO_AC3:
- codec_id = CODEC_ID_AC3;
- break;
- case GPAC_OTI_AUDIO_EAC3:
- codec_id = CODEC_ID_EAC3;
- break;
- case GPAC_OTI_AUDIO_AAC_MPEG2_LCP:
- case GPAC_OTI_AUDIO_AAC_MPEG2_MP:
- case GPAC_OTI_AUDIO_AAC_MPEG2_SSRP:
- case GPAC_OTI_AUDIO_AAC_MPEG4:
- codec_id = CODEC_ID_AAC;
- if (avcodec_find_decoder(codec_id) != NULL)
- return GF_CODEC_MAYBE_SUPPORTED;
- break;
-#ifdef CODEC_ID_OPUS
- case GPAC_OTI_MEDIA_OPUS:
- if (avcodec_find_decoder(CODEC_ID_OPUS) != NULL)
- return GF_CODEC_MAYBE_SUPPORTED;
-#endif
- return GF_CODEC_NOT_SUPPORTED;
- }
- }
-
- /*std MPEG-4 visual*/
- else if (StreamType==GF_STREAM_VISUAL) {
-
- /*fixme - we should use some priority rather than declare ffmpeg can't handle svc*/
- if (esd->decoderConfig->objectTypeIndication == GPAC_OTI_VIDEO_AVC) {
- if (esd->decoderConfig->decoderSpecificInfo && esd->decoderConfig->decoderSpecificInfo->data) {
- Bool is_svc = GF_FALSE;
- u32 i, count;
- GF_AVCConfig *cfg = gf_odf_avc_cfg_read(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength);
- if (!cfg) return GF_CODEC_SUPPORTED;
-
- if (esd->has_scalable_layers)
- is_svc = GF_TRUE;
-
- /*decode all NALUs*/
- count = gf_list_count(cfg->sequenceParameterSets);
- for (i=0; i<count; i++) {
- GF_AVCConfigSlot *slc = (GF_AVCConfigSlot*)gf_list_get(cfg->sequenceParameterSets, i);
- u8 nal_type = slc->data[0] & 0x1F;
-
- if (nal_type==GF_AVC_NALU_SVC_SUBSEQ_PARAM) {
- is_svc = GF_TRUE;
- break;
- }
- }
- gf_odf_avc_cfg_del(cfg);
- return (is_svc || esd->decoderConfig->rvc_config || esd->decoderConfig->predefined_rvc_config) ? GF_CODEC_MAYBE_SUPPORTED : GF_CODEC_SUPPORTED;
- }
- if (esd->decoderConfig->rvc_config || esd->decoderConfig->predefined_rvc_config || esd->has_scalable_layers) return GF_CODEC_MAYBE_SUPPORTED;
- return GF_CODEC_SUPPORTED;
- }
-
- switch (ffd->oti) {
- /*MPEG-4 v1 simple profile*/
- case GPAC_OTI_VIDEO_MPEG4_PART2:
- codec_id = CODEC_ID_MPEG4;
- break;
- /*H264 (not std OTI, just the way we use it internally)*/
- case GPAC_OTI_VIDEO_AVC:
- codec_id = CODEC_ID_H264;
- break;
-#ifdef HAS_HEVC
- case GPAC_OTI_VIDEO_HEVC:
- codec_id = AV_CODEC_ID_HEVC;
- break;
-#endif
- /*MPEG1 video*/
- case GPAC_OTI_VIDEO_MPEG1:
- /*MPEG2 video*/
- case GPAC_OTI_VIDEO_MPEG2_SIMPLE:
- case GPAC_OTI_VIDEO_MPEG2_MAIN:
- case GPAC_OTI_VIDEO_MPEG2_SNR:
- case GPAC_OTI_VIDEO_MPEG2_SPATIAL:
- case GPAC_OTI_VIDEO_MPEG2_HIGH:
- case GPAC_OTI_VIDEO_MPEG2_422:
- codec_id = CODEC_ID_MPEG2VIDEO;
- break;
- /*JPEG*/
- case GPAC_OTI_IMAGE_JPEG:
- codec_id = CODEC_ID_MJPEG;
- /*return maybe supported as FFMPEG JPEG decoder has some issues with many files, so let's use it only if no
- other dec is available*/
- if (avcodec_find_decoder(codec_id) != NULL)
- return GF_CODEC_MAYBE_SUPPORTED;
-
- return GF_CODEC_NOT_SUPPORTED;
- case GPAC_OTI_IMAGE_PNG:
- if (avcodec_find_decoder(CODEC_ID_PNG) != NULL)
- return GF_CODEC_MAYBE_SUPPORTED;
- return GF_CODEC_NOT_SUPPORTED;
-
-#ifdef CODEC_ID_VP9
- case GPAC_OTI_VIDEO_VP9:
- if (avcodec_find_decoder(AV_CODEC_ID_VP9) != NULL)
- return GF_CODEC_MAYBE_SUPPORTED;
- return GF_CODEC_NOT_SUPPORTED;
-#endif
-
-#ifdef CODEC_ID_AV1
- case GPAC_OTI_VIDEO_AV1:
- if (avcodec_find_decoder(CODEC_ID_AV1) != NULL)
- return GF_CODEC_MAYBE_SUPPORTED;
-#endif
- return GF_CODEC_NOT_SUPPORTED;
-
- default:
- return GF_CODEC_NOT_SUPPORTED;
- }
- }
- /*NeroDigital DVD subtitles*/
- else if ((StreamType==GF_STREAM_ND_SUBPIC) && (ffd->oti==0xe0))
- return GF_CODEC_SUPPORTED;
-
- if (!codec_id) return GF_CODEC_NOT_SUPPORTED;
-
- if (check_4cc && (ffmpeg_get_codec(codec_id) != NULL)) {
- if (esd->decoderConfig->rvc_config || esd->decoderConfig->predefined_rvc_config) return GF_CODEC_MAYBE_SUPPORTED;
- return GF_CODEC_SUPPORTED;
- }
-
- if (avcodec_find_decoder(codec_id) != NULL) {
- if (esd->decoderConfig->rvc_config || esd->decoderConfig->predefined_rvc_config) return GF_CODEC_MAYBE_SUPPORTED;
-
- //for HEVC return MAYBE supported to fallback to openHEVC if present (more optimized for now)
-#ifdef HAS_HEVC
- if (codec_id == AV_CODEC_ID_HEVC)
- return GF_CODEC_MAYBE_SUPPORTED;
-#endif
-
- return GF_CODEC_SUPPORTED;
- }
-
- return GF_CODEC_NOT_SUPPORTED;
-}
-
-static const char *FFDEC_GetCodecName(GF_BaseDecoder *dec)
-{
- FFDec *ffd;
- if (!dec)
- return NULL;
- ffd = (FFDec*)dec->privateStack;
- if (ffd && ffd->base_codec) {
- sprintf(ffd->szCodec, "FFMPEG %s - version %s", ffd->base_codec->name ? ffd->base_codec->name : "unknown", LIBAVCODEC_IDENT);
- return ffd->szCodec;
- }
- return NULL;
-}
-
-
-void *FFDEC_Load()
-{
- GF_MediaDecoder *ptr;
- FFDec *priv;
-
- GF_SAFEALLOC(ptr , GF_MediaDecoder);
- if (!ptr) return NULL;
- GF_SAFEALLOC(priv , FFDec);
- if (!priv) {
- gf_free(ptr);
- return NULL;
- }
- ptr->privateStack = priv;
-
- /* Note for valgrind : those two functions cause a leak in valgrind */
- GF_LOG(GF_LOG_INFO, GF_LOG_CONTAINER, ("[FFMPEG Decoder] Registering all ffmpeg codecs...\n") );
-#ifdef FF_API_AVCODE_INIT /*commit ffmpeg 3211932c513338566b31d990d06957e15a644d13*/
- avcodec_init();
-#endif
- avcodec_register_all();
- GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[FFMPEG Decoder] Done registering all ffmpeg codecs.\n") );
-
- ptr->AttachStream = FFDEC_AttachStream;
- ptr->DetachStream = FFDEC_DetachStream;
- ptr->GetCapabilities = FFDEC_GetCapabilities;
- ptr->SetCapabilities = FFDEC_SetCapabilities;
- ptr->CanHandleStream = FFDEC_CanHandleStream;
- ptr->GetName = FFDEC_GetCodecName;
- ptr->ProcessData = FFDEC_ProcessData;
- ptr->GetOutputBuffer = FFDEC_GetOutputBuffer;
-#if defined(USE_AVCTX3) && defined(FFMPEG_DIRECT_DISPATCH)
- ptr->GetOutputFrame = FFDEC_GetOutputFrame;
-#endif
-
- GF_REGISTER_MODULE_INTERFACE(ptr, GF_MEDIA_DECODER_INTERFACE, "FFMPEG decoder", "gpac distribution");
- return (GF_BaseInterface *) ptr;
-}
-
-void FFDEC_Delete(void *ifce)
-{
- GF_BaseDecoder *dec = (GF_BaseDecoder*)ifce;
- FFDec *ffd;
- if (!ifce)
- return;
- ffd = (FFDec*)dec->privateStack;
- dec->privateStack = NULL;
- if (ffd) {
- if (ffd->base_ctx && ffd->base_ctx->codec) avcodec_close(ffd->base_ctx);
- ffd->base_ctx = NULL;
- if (ffd->depth_ctx && ffd->depth_ctx->codec) avcodec_close(ffd->depth_ctx);
- ffd->depth_ctx = NULL;
-#ifdef FFMPEG_SWSCALE
- if (ffd->base_sws) sws_freeContext(ffd->base_sws);
- ffd->base_sws = NULL;
- if (ffd->depth_sws) sws_freeContext(ffd->base_sws);
- ffd->depth_sws = NULL;
-#endif
- gf_free(ffd);
- }
- gf_free(dec);
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / FFMPEG module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "ffmpeg_in.h"
-
-#ifndef DISABLE_FFMPEG_DEMUX
-
-/*default buffer is 200 ms per channel*/
-#define FFD_DATA_BUFFER 800
-
-//#define FFMPEG_DEMUX_ENABLE_MPEG2TS
-
-//#if defined(__DARWIN__) || defined(__APPLE__)
-#if !defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
-#include <errno.h>
-#endif
-
-/**
- * New versions of ffmpeg do not declare AVERROR_NOMEM, AVERROR_IO, AVERROR_NOFMT
- */
-
-#ifndef AVERROR_NOMEM
-#define AVERROR_NOMEM AVERROR(ENOMEM)
-#endif /* AVERROR_NOMEM */
-
-#ifndef AVERROR_IO
-#define AVERROR_IO AVERROR(EIO)
-#endif /* AVERROR_IO */
-
-#ifndef AVERROR_NOFMT
-#define AVERROR_NOFMT AVERROR(EINVAL)
-#endif /* AVERROR_NOFMT */
-
-
-#if ((LIBAVFORMAT_VERSION_MAJOR == 54) && (LIBAVFORMAT_VERSION_MINOR >= 20)) || (LIBAVFORMAT_VERSION_MAJOR > 54)
-
-#define av_find_stream_info(__c) avformat_find_stream_info(__c, NULL)
-#define USE_AVFORMAT_OPEN_INPUT 1
-#endif
-
-
-#if defined(GPAC_CONFIG_ANDROID) && (LIBAVFORMAT_VERSION_MAJOR <= 52)
-
-#ifndef FF_API_CLOSE_INPUT_FILE
-#define FF_API_CLOSE_INPUT_FILE 1
-#endif
-
-#endif
-
-
-
-static u32 FFDemux_Run(void *par)
-{
- AVPacket pkt;
- s64 seek_to;
- GF_NetworkCommand com;
- GF_NetworkCommand map;
- GF_SLHeader slh;
- FFDemux *ffd = (FFDemux *) par;
-
- memset(&map, 0, sizeof(GF_NetworkCommand));
- map.command_type = GF_NET_CHAN_MAP_TIME;
-
- memset(&com, 0, sizeof(GF_NetworkCommand));
- com.command_type = GF_NET_BUFFER_QUERY;
-
- memset(&slh, 0, sizeof(GF_SLHeader));
-
- slh.compositionTimeStampFlag = slh.decodingTimeStampFlag = 1;
-
- while (ffd->is_running) {
- //nothing connected, wait
- if (!ffd->video_ch && !ffd->audio_ch) {
- gf_sleep(100);
- continue;
- }
-
- if ((ffd->seek_time>=0) && ffd->seekable) {
- seek_to = (s64) (AV_TIME_BASE*ffd->seek_time);
- av_seek_frame(ffd->ctx, -1, seek_to, AVSEEK_FLAG_BACKWARD);
- ffd->seek_time = -1;
- }
- pkt.stream_index = -1;
- /*EOF*/
- if (av_read_frame(ffd->ctx, &pkt) <0) break;
- if (pkt.pts == AV_NOPTS_VALUE) pkt.pts = pkt.dts;
- if (!pkt.dts) pkt.dts = pkt.pts;
-
- slh.compositionTimeStamp = pkt.pts;
- slh.decodingTimeStamp = pkt.dts;
-
- gf_mx_p(ffd->mx);
- /*blindly send audio as soon as video is init*/
- if (ffd->audio_ch && (pkt.stream_index == ffd->audio_st) ) {
- slh.compositionTimeStamp *= ffd->audio_tscale.num;
- slh.decodingTimeStamp *= ffd->audio_tscale.num;
-
- gf_service_send_packet(ffd->service, ffd->audio_ch, (char *) pkt.data, pkt.size, &slh, GF_OK);
- }
- else if (ffd->video_ch && (pkt.stream_index == ffd->video_st)) {
- slh.compositionTimeStamp *= ffd->video_tscale.num;
- slh.decodingTimeStamp *= ffd->video_tscale.num;
- slh.randomAccessPointFlag = pkt.flags&AV_PKT_FLAG_KEY ? 1 : 0;
- gf_service_send_packet(ffd->service, ffd->video_ch, (char *) pkt.data, pkt.size, &slh, GF_OK);
- }
- gf_mx_v(ffd->mx);
- av_free_packet(&pkt);
-
- /*sleep untill the buffer occupancy is too low - note that this work because all streams in this
- demuxer are synchronized*/
- while (ffd->audio_run || ffd->video_run) {
- gf_service_command(ffd->service, &com, GF_OK);
- if (com.buffer.occupancy < com.buffer.max)
- break;
-
- gf_sleep(1);
- }
-
- if (!ffd->audio_run && !ffd->video_run) break;
- }
- /*signal EOS*/
- if (ffd->audio_ch) gf_service_send_packet(ffd->service, ffd->audio_ch, NULL, 0, NULL, GF_EOS);
- if (ffd->video_ch) gf_service_send_packet(ffd->service, ffd->video_ch, NULL, 0, NULL, GF_EOS);
- ffd->is_running = 2;
-
- return 0;
-}
-
-static const char * FFD_MIME_TYPES[] = {
- "video/x-mpeg", "mpg mpeg mp2 mpa mpe mpv2", "MPEG 1/2 Movies",
- "video/x-mpeg-systems", "mpg mpeg mp2 mpa mpe mpv2", "MPEG 1/2 Movies",
- "audio/basic", "snd au", "Basic Audio",
- "audio/x-wav", "wav", "WAV Audio",
- "audio/vnd.wave", "wav", "WAV Audio",
- "video/x-ms-asf", "asf wma wmv asx asr", "WindowsMedia Movies",
- "video/x-ms-wmv", "asf wma wmv asx asr", "WindowsMedia Movies",
- "video/x-msvideo", "avi", "AVI Movies",
- "video/x-ms-video", "avi", "AVI Movies",
- "video/avi", "avi", "AVI Movies",
- "video/vnd.avi", "avi", "AVI Movies",
- "video/H263", "h263 263", "H263 Video",
- "video/H264", "h264 264", "H264 Video",
- "video/MPEG4", "cmp", "MPEG-4 Video",
- /* We let ffmpeg handle mov because some QT files with uncompressed or adpcm audio use 1 audio sample
- per MP4 sample which is a killer for our MP4 lib, whereas ffmpeg handles these as complete audio chunks
- moreover ffmpeg handles cmov, we don't */
- "video/quicktime", "mov qt", "QuickTime Movies",
- /* Supported by latest versions of FFMPEG */
- "video/webm", "webm", "Google WebM Movies",
- "audio/webm", "webm", "Google WebM Music",
-#ifdef FFMPEG_DEMUX_ENABLE_MPEG2TS
- "video/mp2t", "ts", "MPEG 2 TS",
-#endif
- NULL
-};
-
-static u32 FFD_RegisterMimeTypes(const GF_InputService *plug) {
- u32 i;
- for (i = 0 ; FFD_MIME_TYPES[i]; i+=3)
- gf_service_register_mime(plug, FFD_MIME_TYPES[i], FFD_MIME_TYPES[i+1], FFD_MIME_TYPES[i+2]);
- return i/3;
-}
-
-static int open_file(AVFormatContext ** ic_ptr, const char * filename, AVInputFormat * fmt, void *ops) {
-#ifdef USE_PRE_0_7
- return av_open_input_file(ic_ptr, filename, fmt, 0, NULL);
-#else
- return avformat_open_input(ic_ptr, filename, fmt, (AVDictionary**)ops);
-#endif
-}
-
-void ffd_parse_options(FFDemux *ffd, const char *url)
-{
-#ifdef USE_AVFORMAT_OPEN_INPUT
- int res;
- char *frag = (char*) strchr(url, '#');
- if (frag) frag = frag+1;
-
- if (ffd->options) return;
-
- while (frag) {
- char *mid, *sep = strchr(frag, ':');
- if (sep) sep[0] = 0;
- mid = strchr(frag, '=');
- if (mid) {
- mid[0] = 0;
- res = av_dict_set(&ffd->options, frag, mid+1, 0);
- if (res<0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMPEG Demuxer] Failed to set option %s:%s\n", frag, mid+1) );
- }
- mid[0] = '=';
- }
- if (!sep) break;
- sep[0] = ':';
- frag = sep+1;
- }
-#endif
-}
-
-
-static Bool FFD_CanHandleURL(GF_InputService *plug, const char *url)
-{
- Bool has_audio, has_video;
- s32 i;
- AVFormatContext *ctx;
- AVOutputFormat *fmt_out;
- Bool ret = GF_FALSE;
- char *ext, szName[1024], szExt[20];
- const char *szExtList;
- FFDemux *ffd;
- if (!plug || !url)
- return GF_FALSE;
- /*disable RTP/RTSP from ffmpeg*/
- if (!strnicmp(url, "rtsp://", 7)) return GF_FALSE;
- if (!strnicmp(url, "rtspu://", 8)) return GF_FALSE;
- if (!strnicmp(url, "rtp://", 6)) return GF_FALSE;
- if (!strnicmp(url, "plato://", 8)) return GF_FALSE;
- if (!strnicmp(url, "udp://", 6)) return GF_FALSE;
- if (!strnicmp(url, "tcp://", 6)) return GF_FALSE;
- if (!strnicmp(url, "data:", 5)) return GF_FALSE;
-
- ffd = (FFDemux*)plug->priv;
-
- if (strlen(url) >= sizeof(szName))
- return GF_FALSE;
-
- strcpy(szName, url);
- ext = strrchr(szName, '#');
- if (ext) ext[0] = 0;
- ext = strrchr(szName, '?');
- if (ext) ext[0] = 0;
-
- ext = strrchr(szName, '.');
- if (ext && strlen(ext) > 19) ext = NULL;
-
- if (ext && strlen(ext) > 1 && strlen(ext) <= sizeof(szExt)) {
- strcpy(szExt, &ext[1]);
- strlwr(szExt);
-#ifndef FFMPEG_DEMUX_ENABLE_MPEG2TS
- if (strstr("ts m2t mts dmb trp", szExt) ) return GF_FALSE;
-#endif
-
- /*note we forbid ffmpeg to handle files we support*/
- if (!strcmp(szExt, "mp4") || !strcmp(szExt, "mpg4") || !strcmp(szExt, "m4a") || !strcmp(szExt, "m21")
- || !strcmp(szExt, "m4v") || !strcmp(szExt, "m4a")
- || !strcmp(szExt, "m4s") || !strcmp(szExt, "3gs")
- || !strcmp(szExt, "3gp") || !strcmp(szExt, "3gpp") || !strcmp(szExt, "3gp2") || !strcmp(szExt, "3g2")
- || !strcmp(szExt, "mp3")
- || !strcmp(szExt, "ac3")
- || !strcmp(szExt, "amr")
- || !strcmp(szExt, "bt") || !strcmp(szExt, "wrl") || !strcmp(szExt, "x3dv")
- || !strcmp(szExt, "xmt") || !strcmp(szExt, "xmta") || !strcmp(szExt, "x3d")
-
- || !strcmp(szExt, "jpg") || !strcmp(szExt, "jpeg") || !strcmp(szExt, "png")
- ) return GF_FALSE;
-
- /*check any default stuff that should work with ffmpeg*/
- {
- u32 i;
- for (i = 0 ; FFD_MIME_TYPES[i]; i+=3) {
- if (gf_service_check_mime_register(plug, FFD_MIME_TYPES[i], FFD_MIME_TYPES[i+1], FFD_MIME_TYPES[i+2], ext))
- return GF_TRUE;
- }
- }
- }
-
- ffd_parse_options(ffd, url);
-
- ctx = NULL;
- if (open_file(&ctx, szName, NULL, ffd->options ? &ffd->options : NULL)<0) {
- AVInputFormat *av_in = NULL;
- /*some extensions not supported by ffmpeg*/
- if (ext && !strcmp(szExt, "cmp")) av_in = av_find_input_format("m4v");
-
- if (open_file(&ctx, szName, av_in, ffd->options ? &ffd->options : NULL)<0) {
- return GF_FALSE;
- }
- }
-
- if (!ctx) goto exit;
- if (av_find_stream_info(ctx) <0) goto exit;
-
- /*figure out if we can use codecs or not*/
- has_video = has_audio = GF_FALSE;
- for(i = 0; i < (s32)ctx->nb_streams; i++) {
- AVCodecContext *enc = ctx->streams[i]->codec;
- switch(enc->codec_type) {
- case AVMEDIA_TYPE_AUDIO:
- if (!has_audio) has_audio = GF_TRUE;
- break;
- case AVMEDIA_TYPE_VIDEO:
- if (!has_video) has_video= GF_TRUE;
- break;
- default:
- break;
- }
- }
- if (!has_audio && !has_video) goto exit;
- ret = GF_TRUE;
-#if ((LIBAVFORMAT_VERSION_MAJOR == 52) && (LIBAVFORMAT_VERSION_MINOR <= 47)) || (LIBAVFORMAT_VERSION_MAJOR < 52)
- fmt_out = guess_stream_format(NULL, url, NULL);
-#else
- fmt_out = av_guess_format(NULL, url, NULL);
-#endif
- if (fmt_out) gf_service_register_mime(plug, fmt_out->mime_type, fmt_out->extensions, fmt_out->name);
- else {
- ext = strrchr(szName, '.');
- if (ext) {
- strcpy(szExt, &ext[1]);
- strlwr(szExt);
-
- szExtList = gf_opts_get_key("MimeTypes", "application/x-ffmpeg");
- if (!szExtList) {
- gf_service_register_mime(plug, "application/x-ffmpeg", szExt, "Other Movies (FFMPEG)");
- } else if (!strstr(szExtList, szExt)) {
- u32 len;
- char *buf;
- len = (u32) (strlen(szExtList) + strlen(szExt) + 10);
- buf = (char*)gf_malloc(sizeof(char)*len);
- sprintf(buf, "\"%s ", szExt);
- strcat(buf, &szExtList[1]);
- gf_opts_set_key("MimeTypes", "application/x-ffmpeg", buf);
- gf_free(buf);
- }
- }
- }
-
-exit:
-#if FF_API_CLOSE_INPUT_FILE
- if (ctx) av_close_input_file(ctx);
-#else
- if (ctx) avformat_close_input(&ctx);
-#endif
- return ret;
-}
-
-static GF_ESD *FFD_GetESDescriptor(FFDemux *ffd, Bool for_audio)
-{
- GF_BitStream *bs;
- Bool dont_use_sl;
- GF_ESD *esd = (GF_ESD *) gf_odf_desc_esd_new(0);
- esd->ESID = 1 + (for_audio ? ffd->audio_st : ffd->video_st);
- esd->decoderConfig->streamType = for_audio ? GF_STREAM_AUDIO : GF_STREAM_VISUAL;
- esd->decoderConfig->avgBitrate = esd->decoderConfig->maxBitrate = 0;
-
- /*remap std object types - depending on input formats, FFMPEG may not have separate DSI from initial frame.
- In this case we have no choice but using FFMPEG decoders*/
- if (for_audio) {
- AVCodecContext *dec = ffd->ctx->streams[ffd->audio_st]->codec;
- esd->slConfig->timestampResolution = ffd->audio_tscale.den;
- switch (dec->codec_id) {
- case CODEC_ID_MP2:
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_AUDIO_MPEG1;
- break;
- case CODEC_ID_MP3:
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_AUDIO_MPEG2_PART3;
- break;
- case CODEC_ID_AAC:
- if (!dec->extradata_size) goto opaque_audio;
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_AUDIO_AAC_MPEG4;
- esd->decoderConfig->decoderSpecificInfo->dataLength = dec->extradata_size;
- esd->decoderConfig->decoderSpecificInfo->data = (char*)gf_malloc(sizeof(char)*dec->extradata_size);
- memcpy(esd->decoderConfig->decoderSpecificInfo->data,
- dec->extradata,
- sizeof(char)*dec->extradata_size);
- break;
- default:
-opaque_audio:
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_MEDIA_FFMPEG;
- bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- gf_bs_write_u32(bs, dec->codec_id);
- gf_bs_write_u32(bs, dec->sample_rate);
- gf_bs_write_u16(bs, dec->channels);
- gf_bs_write_u16(bs, dec->frame_size);
- gf_bs_write_u8(bs, 16);
- gf_bs_write_u8(bs, 0);
- /*ffmpeg specific*/
- gf_bs_write_u16(bs, dec->block_align);
- gf_bs_write_u32(bs, dec->bit_rate);
- gf_bs_write_u32(bs, dec->codec_tag);
- if (dec->extradata_size) {
- gf_bs_write_data(bs, (char *) dec->extradata, dec->extradata_size);
- }
- gf_bs_get_content(bs, (char **) &esd->decoderConfig->decoderSpecificInfo->data, &esd->decoderConfig->decoderSpecificInfo->dataLength);
- gf_bs_del(bs);
- break;
- }
- dont_use_sl = ffd->unreliable_audio_timing;
- } else {
- AVCodecContext *dec = ffd->ctx->streams[ffd->video_st]->codec;
- esd->slConfig->timestampResolution = ffd->video_tscale.den;
- switch (dec->codec_id) {
- case CODEC_ID_MPEG4:
- /*there is a bug in fragmentation of raw H264 in ffmpeg, the NALU startcode (0x00000001) is split across
- two frames - we therefore force internal ffmpeg codec ID to avoid NALU size recompute
- at the decoder level*/
-// case CODEC_ID_H264:
- /*if dsi not detected force use ffmpeg*/
- if (!dec->extradata_size) goto opaque_video;
- /*otherwise use any MPEG-4 Visual*/
- esd->decoderConfig->objectTypeIndication = (dec->codec_id==CODEC_ID_H264) ? GPAC_OTI_VIDEO_AVC : GPAC_OTI_VIDEO_MPEG4_PART2;
- esd->decoderConfig->decoderSpecificInfo->dataLength = dec->extradata_size;
- esd->decoderConfig->decoderSpecificInfo->data = (char*)gf_malloc(sizeof(char)*dec->extradata_size);
- memcpy(esd->decoderConfig->decoderSpecificInfo->data,
- dec->extradata,
- sizeof(char)*dec->extradata_size);
- break;
- case CODEC_ID_MPEG1VIDEO:
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_VIDEO_MPEG1;
- break;
- case CODEC_ID_MPEG2VIDEO:
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_VIDEO_MPEG2_MAIN;
- break;
-
- case CODEC_ID_H263:
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_MEDIA_GENERIC;
- bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- gf_bs_write_u32(bs, GF_4CC('s', '2', '6', '3') );
- gf_bs_write_u16(bs, dec->width);
- gf_bs_write_u16(bs, dec->height);
- gf_bs_get_content(bs, (char **) &esd->decoderConfig->decoderSpecificInfo->data, &esd->decoderConfig->decoderSpecificInfo->dataLength);
- gf_bs_del(bs);
- break;
- default:
-opaque_video:
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_MEDIA_FFMPEG;
- bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- gf_bs_write_u32(bs, dec->codec_id);
- gf_bs_write_u16(bs, dec->width);
- gf_bs_write_u16(bs, dec->height);
- /*ffmpeg specific*/
- gf_bs_write_u32(bs, dec->bit_rate);
- gf_bs_write_u32(bs, dec->codec_tag);
- gf_bs_write_u32(bs, dec->pix_fmt);
-
- if (dec->extradata_size) {
- gf_bs_write_data(bs, (char *) dec->extradata, dec->extradata_size);
- }
- gf_bs_get_content(bs, (char **) &esd->decoderConfig->decoderSpecificInfo->data, &esd->decoderConfig->decoderSpecificInfo->dataLength);
- gf_bs_del(bs);
- break;
- }
- dont_use_sl = GF_FALSE;
- }
-
- if (dont_use_sl) {
- esd->slConfig->predefined = SLPredef_SkipSL;
- } else {
- /*only send full AUs*/
- esd->slConfig->useAccessUnitStartFlag = esd->slConfig->useAccessUnitEndFlag = 0;
- if (for_audio) {
- esd->slConfig->hasRandomAccessUnitsOnlyFlag = 1;
- } else {
- esd->slConfig->useRandomAccessPointFlag = 1;
- }
- esd->slConfig->useTimestampsFlag = 1;
- }
-
- return esd;
-}
-
-
-static void FFD_SetupObjects(FFDemux *ffd)
-{
- GF_ESD *esd;
- GF_ObjectDescriptor *od;
- u32 audio_esid = 0;
-
- if ((ffd->audio_st>=0) && (ffd->service_type != 1)) {
- od = (GF_ObjectDescriptor *) gf_odf_desc_new(GF_ODF_OD_TAG);
- esd = FFD_GetESDescriptor(ffd, GF_TRUE);
- od->objectDescriptorID = esd->ESID;
- audio_esid = esd->ESID;
- gf_list_add(od->ESDescriptors, esd);
- gf_service_declare_media(ffd->service, (GF_Descriptor*)od, (ffd->video_st>=0) ? GF_TRUE : GF_FALSE);
- }
- if ((ffd->video_st>=0) && (ffd->service_type != 2)) {
- od = (GF_ObjectDescriptor *) gf_odf_desc_new(GF_ODF_OD_TAG);
- esd = FFD_GetESDescriptor(ffd, GF_FALSE);
- od->objectDescriptorID = esd->ESID;
- esd->OCRESID = audio_esid;
- gf_list_add(od->ESDescriptors, esd);
- gf_service_declare_media(ffd->service, (GF_Descriptor*)od, GF_FALSE);
- }
-}
-
-#ifdef USE_PRE_0_7
-static int ff_url_read(void *h, unsigned char *buf, int size)
-{
- u32 retry = 10;
- u32 read;
- int full_size;
- FFDemux *ffd = (FFDemux *)h;
-
- full_size = 0;
- if (ffd->buffer_used) {
- if (ffd->buffer_used >= (u32) size) {
- ffd->buffer_used-=size;
- memcpy(ffd->buffer, ffd->buffer+size, sizeof(char)*ffd->buffer_used);
-#ifdef FFMPEG_DUMP_REMOTE
- if (ffd->outdbg) gf_fwrite(buf, size, 1, ffd->outdbg);
-#endif
- return size;
- }
- full_size += ffd->buffer_used;
- buf += ffd->buffer_used;
- size -= ffd->buffer_used;
- ffd->buffer_used = 0;
- }
-
- while (size) {
- GF_Err e = gf_dm_sess_fetch_data(ffd->dnload, buf, size, &read);
- if (e==GF_EOS) break;
- /*we're sync!!*/
- if (e==GF_IP_NETWORK_EMPTY) {
- if (!retry) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMPEG Demuxer] timeout fetching bytes from network\n") );
- return -1;
- }
- retry --;
- gf_sleep(100);
- continue;
- }
- if (e) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMPEG Demuxer] error fetching bytes from network: %s\n", gf_error_to_string(e) ) );
- return -1;
- }
- full_size += read;
- if (read==size) break;
- size -= read;
- buf += read;
- }
-#ifdef FFMPEG_DUMP_REMOTE
- if (ffd->outdbg) gf_fwrite(ffd->buffer, full_size, 1, ffd->outdbg);
-#endif
- return full_size ? (int) full_size : -1;
-}
-#endif /*USE_PRE_0_7*/
-
-
-static GF_Err FFD_ConnectService(GF_InputService *plug, GF_ClientService *serv, const char *url)
-{
- GF_Err e;
- s64 last_aud_pts;
- u32 i;
- s32 res;
- Bool is_local;
- const char *sOpt;
- char *ext, szName[1024];
- FFDemux *ffd = (FFDemux*)plug->priv;
- AVInputFormat *av_in = NULL;
- char szExt[20];
-
- if (ffd->ctx) return GF_SERVICE_ERROR;
-
- assert( url && strlen(url) < 1024);
- strcpy(szName, url);
- ext = strrchr(szName, '#');
- ffd->service_type = 0;
- ffd->service = serv;
-
- if (ext) {
- if (!stricmp(&ext[1], "video")) ffd->service_type = 1;
- else if (!stricmp(&ext[1], "audio")) ffd->service_type = 2;
- ext[0] = 0;
- }
-
- ffd_parse_options(ffd, url);
-
- /*some extensions not supported by ffmpeg, overload input format*/
- ext = strrchr(szName, '.');
- strcpy(szExt, ext ? ext+1 : "");
- strlwr(szExt);
- if (!strcmp(szExt, "cmp")) av_in = av_find_input_format("m4v");
-
- is_local = (strnicmp(url, "file://", 7) && strstr(url, "://")) ? GF_FALSE : GF_TRUE;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[FFMPEG] opening file %s - local %d - av_in %08x\n", url, is_local, av_in));
-
- if (!is_local) {
- AVProbeData pd;
-
- /*setup wraper for FFMPEG I/O*/
- ffd->buffer_size = 8192;
- sOpt = gf_opts_get_key("FFMPEG", "IOBufferSize");
- if (sOpt) ffd->buffer_size = atoi(sOpt);
- ffd->buffer = (char*)gf_malloc(sizeof(char)*ffd->buffer_size);
-#ifdef FFMPEG_DUMP_REMOTE
- ffd->outdbg = gf_fopen("ffdeb.raw", "wb");
-#endif
-#ifdef USE_PRE_0_7
- init_put_byte(&ffd->io, ffd->buffer, ffd->buffer_size, 0, ffd, ff_url_read, NULL, NULL);
- ffd->io.is_streamed = 1;
-#else
- ffd->io.seekable = 1;
-#endif
-
- ffd->dnload = gf_service_download_new(ffd->service, url, GF_NETIO_SESSION_NOT_THREADED | GF_NETIO_SESSION_NOT_CACHED, NULL, ffd);
- if (!ffd->dnload) return GF_URL_ERROR;
- while (1) {
- u32 read;
- e = gf_dm_sess_fetch_data(ffd->dnload, ffd->buffer + ffd->buffer_used, ffd->buffer_size - ffd->buffer_used, &read);
- if (e==GF_EOS) break;
- /*we're sync!!*/
- if (e==GF_IP_NETWORK_EMPTY) continue;
- if (e) goto err_exit;
- ffd->buffer_used += read;
- if (ffd->buffer_used == ffd->buffer_size) break;
- }
- if (e==GF_EOS) {
- const char *cache_file = gf_dm_sess_get_cache_name(ffd->dnload);
- res = open_file(&ffd->ctx, cache_file, av_in, ffd->options ? &ffd->options : NULL);
- } else {
- pd.filename = szName;
- pd.buf_size = ffd->buffer_used;
- pd.buf = (u8 *) ffd->buffer;
- av_in = av_probe_input_format(&pd, 1);
- if (!av_in) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMPEG] error probing file %s - probe start with %c %c %c %c\n", url, ffd->buffer[0], ffd->buffer[1], ffd->buffer[2], ffd->buffer[3]));
- return GF_NOT_SUPPORTED;
- }
- /*setup downloader*/
- av_in->flags |= AVFMT_NOFILE;
-#ifdef USE_AVFORMAT_OPEN_INPUT /*commit ffmpeg 603b8bc2a109978c8499b06d2556f1433306eca7*/
- res = avformat_open_input(&ffd->ctx, szName, av_in, NULL);
-#else
- res = av_open_input_stream(&ffd->ctx, &ffd->io, szName, av_in, NULL);
-#endif
- }
- } else {
- res = open_file(&ffd->ctx, szName, av_in, ffd->options ? &ffd->options : NULL);
- }
-
- switch (res) {
-#ifndef _WIN32_WCE
- case 0:
- e = GF_OK;
- break;
- case AVERROR_IO:
- e = GF_URL_ERROR;
- goto err_exit;
- case AVERROR_INVALIDDATA:
- e = GF_NON_COMPLIANT_BITSTREAM;
- goto err_exit;
- case AVERROR_NOMEM:
- e = GF_OUT_OF_MEM;
- goto err_exit;
- case AVERROR_NOFMT:
- e = GF_NOT_SUPPORTED;
- goto err_exit;
-#endif
- default:
- e = GF_SERVICE_ERROR;
- goto err_exit;
- }
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[FFMPEG] looking for streams in %s - %d streams - type %s\n", ffd->ctx->filename, ffd->ctx->nb_streams, ffd->ctx->iformat->name));
-
-#ifdef USE_AVFORMAT_OPEN_INPUT
- res = avformat_find_stream_info(ffd->ctx, ffd->options ? &ffd->options : NULL);
-#else
- res = av_find_stream_info(ffd->ctx);
-#endif
-
- if (res <0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMPEG] cannot locate streams - error %d\n", res));
- e = GF_NOT_SUPPORTED;
- goto err_exit;
- }
- GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[FFMPEG] file %s opened - %d streams\n", url, ffd->ctx->nb_streams));
-
- /*figure out if we can use codecs or not*/
- ffd->audio_st = ffd->video_st = -1;
- for (i = 0; i < ffd->ctx->nb_streams; i++) {
- AVCodecContext *enc = ffd->ctx->streams[i]->codec;
- switch(enc->codec_type) {
- case AVMEDIA_TYPE_AUDIO:
- if ((ffd->audio_st<0) && (ffd->service_type!=1)) {
- ffd->audio_st = i;
- ffd->audio_tscale = ffd->ctx->streams[i]->time_base;
- }
- break;
- case AVMEDIA_TYPE_VIDEO:
- if ((ffd->video_st<0) && (ffd->service_type!=2)) {
- ffd->video_st = i;
- ffd->video_tscale = ffd->ctx->streams[i]->time_base;
- }
- break;
- default:
- break;
- }
- }
- if ((ffd->service_type==1) && (ffd->video_st<0)) goto err_exit;
- if ((ffd->service_type==2) && (ffd->audio_st<0)) goto err_exit;
- if ((ffd->video_st<0) && (ffd->audio_st<0)) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMPEG] No supported streams in file\n"));
- goto err_exit;
- }
-
-
- sOpt = gf_opts_get_key("FFMPEG", "DataBufferMS");
- ffd->data_buffer_ms = 0;
- if (sOpt) ffd->data_buffer_ms = atoi(sOpt);
- if (!ffd->data_buffer_ms) ffd->data_buffer_ms = FFD_DATA_BUFFER;
-
- /*build seek*/
- if (is_local) {
- /*check we do have increasing pts. If not we can't rely on pts, we must skip SL
- we assume video pts is always present*/
- if (ffd->audio_st>=0) {
- last_aud_pts = 0;
- for (i=0; i<20; i++) {
- AVPacket pkt;
- pkt.stream_index = -1;
- if (av_read_frame(ffd->ctx, &pkt) <0) break;
- if (pkt.pts == AV_NOPTS_VALUE) pkt.pts = pkt.dts;
- if (pkt.stream_index==ffd->audio_st) last_aud_pts = pkt.pts;
- }
- if (last_aud_pts*ffd->audio_tscale.den<10*ffd->audio_tscale.num) ffd->unreliable_audio_timing = GF_TRUE;
- }
-
- ffd->seekable = (av_seek_frame(ffd->ctx, -1, 0, AVSEEK_FLAG_BACKWARD)<0) ? GF_FALSE : GF_TRUE;
- if (!ffd->seekable) {
-#if FF_API_CLOSE_INPUT_FILE
- av_close_input_file(ffd->ctx);
-#else
- avformat_close_input(&ffd->ctx);
-#endif
- ffd->ctx = NULL;
- open_file(&ffd->ctx, szName, av_in, ffd->options ? &ffd->options : NULL);
- av_find_stream_info(ffd->ctx);
- }
- }
-
- /*let's go*/
- gf_service_connect_ack(serv, NULL, GF_OK);
- /*if (!ffd->service_type)*/ FFD_SetupObjects(ffd);
- ffd->service_type = 0;
- return GF_OK;
-
-err_exit:
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMPEG] Error opening file %s: %s\n", url, gf_error_to_string(e)));
-#if FF_API_CLOSE_INPUT_FILE
- if (ffd->ctx) av_close_input_file(ffd->ctx);
-#else
- if (ffd->ctx) avformat_close_input(&ffd->ctx);
-#endif
- ffd->ctx = NULL;
- gf_service_connect_ack(serv, NULL, e);
- return e;
-}
-
-
-static GF_Descriptor *FFD_GetServiceDesc(GF_InputService *plug, u32 expect_type, const char *sub_url)
-{
- GF_ObjectDescriptor *od;
- GF_ESD *esd;
- FFDemux *ffd = (FFDemux*)plug->priv;
-
- if (!ffd->ctx) return NULL;
-
- if (expect_type==GF_MEDIA_OBJECT_UNDEF) {
- if (ffd->video_st>=0) expect_type=GF_MEDIA_OBJECT_VIDEO;
- else if (ffd->audio_st>=0) expect_type=GF_MEDIA_OBJECT_AUDIO;
- }
-
-
- /*since we don't handle multitrack in ffmpeg, we don't need to check sub_url, only use expected type*/
- if (expect_type==GF_MEDIA_OBJECT_AUDIO) {
- if (ffd->audio_st<0) return NULL;
- od = (GF_ObjectDescriptor *) gf_odf_desc_new(GF_ODF_OD_TAG);
- od->objectDescriptorID = 1;
- esd = FFD_GetESDescriptor(ffd, GF_TRUE);
- /*if session join, setup sync*/
- if (ffd->video_ch) esd->OCRESID = ffd->video_st+1;
- gf_list_add(od->ESDescriptors, esd);
- ffd->service_type = 2;
- return (GF_Descriptor *) od;
- }
- if (expect_type==GF_MEDIA_OBJECT_VIDEO) {
- if (ffd->video_st<0) return NULL;
- od = (GF_ObjectDescriptor *) gf_odf_desc_new(GF_ODF_OD_TAG);
- od->objectDescriptorID = 1;
- esd = FFD_GetESDescriptor(ffd, GF_FALSE);
- /*if session join, setup sync*/
- if (ffd->audio_ch) esd->OCRESID = ffd->audio_st+1;
- gf_list_add(od->ESDescriptors, esd);
- ffd->service_type = 1;
- return (GF_Descriptor *) od;
- }
- return NULL;
-}
-
-
-static GF_Err FFD_CloseService(GF_InputService *plug)
-{
- FFDemux *ffd = (FFDemux*)plug->priv;
-
- ffd->is_running = 0;
-
-#if FF_API_CLOSE_INPUT_FILE
- if (ffd->ctx) av_close_input_file(ffd->ctx);
-#else
- if (ffd->ctx) avformat_close_input(&ffd->ctx);
-#endif
-
- ffd->ctx = NULL;
- ffd->audio_ch = ffd->video_ch = NULL;
- ffd->audio_run = ffd->video_run = GF_FALSE;
-
- if (ffd->dnload) {
- if (ffd->is_running) {
- while (!ffd->is_running) gf_sleep(1);
- ffd->is_running = 0;
- }
- gf_service_download_del(ffd->dnload);
- ffd->dnload = NULL;
- }
- if (ffd->buffer) gf_free(ffd->buffer);
- ffd->buffer = NULL;
-
- gf_service_disconnect_ack(ffd->service, NULL, GF_OK);
-#ifdef FFMPEG_DUMP_REMOTE
- if (ffd->outdbg) gf_fclose(ffd->outdbg);
-#endif
- return GF_OK;
-}
-
-static GF_Err FFD_ConnectChannel(GF_InputService *plug, LPNETCHANNEL channel, const char *url, Bool upstream)
-{
- GF_Err e;
- u32 ESID;
- FFDemux *ffd = (FFDemux*)plug->priv;
-
- e = GF_STREAM_NOT_FOUND;
- if (upstream) {
- e = GF_ISOM_INVALID_FILE;
- goto exit;
- }
- if (!strstr(url, "ES_ID=")) {
- e = GF_NOT_SUPPORTED;
- goto exit;
- }
- sscanf(url, "ES_ID=%u", &ESID);
-
- if ((s32) ESID == 1 + ffd->audio_st) {
- if (ffd->audio_ch) {
- e = GF_SERVICE_ERROR;
- goto exit;
- }
- ffd->audio_ch = channel;
- e = GF_OK;
- }
- else if ((s32) ESID == 1 + ffd->video_st) {
- if (ffd->video_ch) {
- e = GF_SERVICE_ERROR;
- goto exit;
- }
- ffd->video_ch = channel;
- e = GF_OK;
- }
-
-exit:
- gf_service_connect_ack(ffd->service, channel, e);
- return GF_OK;
-}
-
-static GF_Err FFD_DisconnectChannel(GF_InputService *plug, LPNETCHANNEL channel)
-{
- GF_Err e;
- FFDemux *ffd = (FFDemux*)plug->priv;
-
- e = GF_STREAM_NOT_FOUND;
- if (ffd->audio_ch == channel) {
- e = GF_OK;
- ffd->audio_ch = NULL;
- ffd->audio_run = GF_FALSE;
- }
- else if (ffd->video_ch == channel) {
- e = GF_OK;
- ffd->video_ch = NULL;
- ffd->video_run = GF_FALSE;
- }
- gf_service_disconnect_ack(ffd->service, channel, e);
- return GF_OK;
-}
-
-static GF_Err FFD_ServiceCommand(GF_InputService *plug, GF_NetworkCommand *com)
-{
- FFDemux *ffd = (FFDemux*)plug->priv;
-
-
- if (com->command_type==GF_NET_SERVICE_HAS_AUDIO) {
- if (ffd->audio_st>=0) return GF_OK;
- return GF_NOT_SUPPORTED;
- }
-
- if (!com->base.on_channel) return GF_NOT_SUPPORTED;
-
- switch (com->command_type) {
- /*only BIFS/OD work in pull mode (cf ffmpeg_in.h)*/
- case GF_NET_CHAN_SET_PULL:
- return GF_NOT_SUPPORTED;
- case GF_NET_CHAN_INTERACTIVE:
- return ffd->seekable ? GF_OK : GF_NOT_SUPPORTED;
- case GF_NET_CHAN_BUFFER:
- return GF_OK;
- case GF_NET_CHAN_DURATION:
- if (ffd->ctx->duration == AV_NOPTS_VALUE)
- com->duration.duration = -1;
- else
- com->duration.duration = (Double) ffd->ctx->duration / AV_TIME_BASE;
- return GF_OK;
- /*fetch start time*/
- case GF_NET_CHAN_PLAY:
- if (com->play.speed<0) return GF_NOT_SUPPORTED;
-
- gf_mx_p(ffd->mx);
- ffd->seek_time = (com->play.start_range>=0) ? com->play.start_range : 0;
-
- if (ffd->audio_ch==com->base.on_channel) ffd->audio_run = GF_TRUE;
- else if (ffd->video_ch==com->base.on_channel) ffd->video_run = GF_TRUE;
-
- /*play on media stream, start thread*/
- if ((ffd->audio_ch==com->base.on_channel) || (ffd->video_ch==com->base.on_channel)) {
- if (ffd->is_running!=1) {
- ffd->is_running = 1;
- gf_th_run(ffd->thread, FFDemux_Run, ffd);
- }
- }
- gf_mx_v(ffd->mx);
- return GF_OK;
- case GF_NET_CHAN_STOP:
- if (ffd->audio_ch==com->base.on_channel) ffd->audio_run = GF_FALSE;
- else if (ffd->video_ch==com->base.on_channel) ffd->video_run = GF_FALSE;
- return GF_OK;
- /*note we don't handle PAUSE/RESUME/SET_SPEED, this is automatically handled by the demuxing thread
- through buffer occupancy queries*/
-
- default:
- return GF_OK;
- }
-
- return GF_OK;
-}
-
-
-static Bool FFD_CanHandleURLInService(GF_InputService *plug, const char *url)
-{
- char szURL[2048], *sep;
- FFDemux *ffd;
- const char *this_url;
- if (!plug || !url)
- return GF_FALSE;
- ffd = (FFDemux *)plug->priv;
- this_url = gf_service_get_url(ffd->service);
- if (!this_url)
- return GF_FALSE;
-
- strcpy(szURL, this_url);
- sep = strrchr(szURL, '#');
- if (sep) sep[0] = 0;
-
- if ((url[0] != '#') && strnicmp(szURL, url, sizeof(char)*strlen(szURL))) return GF_FALSE;
- sep = strrchr(url, '#');
- if (sep && !stricmp(sep, "#video") && (ffd->video_st>=0)) return GF_TRUE;
- if (sep && !stricmp(sep, "#audio") && (ffd->audio_st>=0)) return GF_TRUE;
- return GF_FALSE;
-}
-
-void *New_FFMPEG_Demux()
-{
- GF_InputService *ffd;
- FFDemux *priv;
- GF_SAFEALLOC(ffd, GF_InputService);
- if (!ffd) return NULL;
- GF_SAFEALLOC(priv, FFDemux);
- if (!priv) {
- gf_free(ffd);
- return NULL;
- }
- GF_LOG(GF_LOG_INFO, GF_LOG_CONTAINER, ("[FFMPEG Demuxer] Registering all ffmpeg plugins...\n") );
- /* register all codecs, demux and protocols */
- av_register_all();
- avformat_network_init();
- GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[FFMPEG Demuxer] Registering all ffmpeg plugins DONE.\n") );
-
- ffd->RegisterMimeTypes = FFD_RegisterMimeTypes;
- ffd->CanHandleURL = FFD_CanHandleURL;
- ffd->CloseService = FFD_CloseService;
- ffd->ConnectChannel = FFD_ConnectChannel;
- ffd->ConnectService = FFD_ConnectService;
- ffd->DisconnectChannel = FFD_DisconnectChannel;
- ffd->GetServiceDescriptor = FFD_GetServiceDesc;
- ffd->ServiceCommand = FFD_ServiceCommand;
-
- ffd->CanHandleURLInService = FFD_CanHandleURLInService;
-
- priv->thread = gf_th_new("FFMPEG Demux");
- priv->mx = gf_mx_new("FFMPEG Demux");
- if (!priv->thread || !priv->mx) {
- if (priv->thread) gf_th_del(priv->thread);
- if (priv->mx) gf_mx_del(priv->mx);
- gf_free(priv);
- return NULL;
- }
-
- GF_REGISTER_MODULE_INTERFACE(ffd, GF_NET_CLIENT_INTERFACE, "FFMPEG Demuxer", "gpac distribution");
- ffd->priv = priv;
- return ffd;
-}
-
-void Delete_FFMPEG_Demux(void *ifce)
-{
- FFDemux *ffd;
- GF_InputService *ptr = (GF_InputService *)ifce;
- if (!ptr)
- return;
- ffd = (FFDemux*)ptr->priv;
- if (ffd) {
- if (ffd->thread)
- gf_th_del(ffd->thread);
- ffd->thread = NULL;
- if (ffd->mx)
- gf_mx_del(ffd->mx);
-
-#ifndef USE_PRE_0_7
- if (ffd->options) av_dict_free(&ffd->options);
-#endif
- ffd->mx = NULL;
- gf_free(ffd);
- ptr->priv = NULL;
- }
- gf_free(ptr);
-}
-
-
-#endif
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / MP4 reader module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#ifndef __FFMPEG_IN_H
-#define __FFMPEG_IN_H
-
-
-
-/*include net API*/
-#include <gpac/modules/service.h>
-/*include decoder API*/
-#include <gpac/modules/codec.h>
-#include <gpac/constants.h>
-#include <gpac/thread.h>
-
-
-//#define DISABLE_FFMPEG_DEMUX
-
-#if defined(WIN32) && !defined(__MINGW32__)
-
-#define EMULATE_INTTYPES
-#define EMULATE_FAST_INT
-#ifndef inline
-#define inline __inline
-#endif
-
-#if defined(__SYMBIAN32__)
-#define EMULATE_INTTYPES
-#endif
-
-
-#ifndef __MINGW32__
-#define __attribute__(s)
-#endif
-
-#endif
-
-
-/*include FFMPEG APIs*/
-#ifdef _WIN32_WCE
-#define inline __inline
-#endif
-
-
-#if defined(WIN32)
-# define INT64_C(x) (x ## i64)
-# define UINT64_C(x) (x ## Ui64)
-#endif
-
-
-#ifdef FFMPEG_OLD_HEADERS
-#include <ffmpeg/avformat.h>
-#else
-#include <libavformat/avformat.h>
-#endif
-
-void gf_av_vlog(void* avcl, int level, const char *fmt, va_list vl);
-
-
-#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(52, 0, 0)
-#define FFMPEG_SWSCALE
-#ifdef FFMPEG_OLD_HEADERS
-#include <ffmpeg/swscale.h>
-#else
-#include <libswscale/swscale.h>
-#endif
-#endif
-
-
-
-#if LIBAVUTIL_VERSION_MAJOR<51
-#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
-#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
-#endif
-
-
-#ifndef FFMPEG_OLD_HEADERS
-
-#if ((LIBAVCODEC_VERSION_MAJOR == 52) && (LIBAVCODEC_VERSION_MINOR <= 20)) || (LIBAVCODEC_VERSION_MAJOR < 52)
-#undef USE_AVCODEC2
-#else
-#define USE_AVCODEC2 1
-#endif
-
-#else
-#undef USE_AVCODEC2
-#endif
-
-#if (LIBAVCODEC_VERSION_MAJOR >= 55)
-#define USE_AVCTX3
-#elif (LIBAVCODEC_VERSION_MAJOR >= 54) && (LIBAVCODEC_VERSION_MINOR >= 35)
-#define USE_AVCTX3
-#endif
-
-
-/*FFMPEG decoder module */
-typedef struct
-{
- char szCodec[100];
- u32 out_size;
- u32 oti, st;
- u32 previous_par;
- Bool no_par_update;
- Bool needs_output_resize;
- Bool had_pic;
-
- Bool check_short_header;
- u32 pix_fmt;
- u32 out_pix_fmt;
- Bool is_image;
-
- u32 raw_pix_fmt;
- Bool flipped;
- u32 direct_output_mode;
-
- u32 stride;
-
- u32 output_cb_size;
- /*for audio packed frames*/
- u32 frame_start;
- char audio_buf[192000];
- Bool check_h264_isma;
-
- Bool frame_size_changed;
-
- u32 base_ES_ID;
- AVCodecContext *base_ctx;
- AVCodec *base_codec;
- AVFrame *base_frame;
-#ifdef FFMPEG_SWSCALE
- struct SwsContext *base_sws;
-#endif
-
- u32 depth_ES_ID;
- u32 yuv_size;
- AVCodecContext *depth_ctx;
- AVCodec *depth_codec;
- AVFrame *depth_frame;
-#ifdef FFMPEG_SWSCALE
- struct SwsContext *depth_sws;
-#endif
-
-#ifdef USE_AVCTX3
- AVFrame *audio_frame;
-#endif
-
-} FFDec;
-
-void *FFDEC_Load();
-void FFDEC_Delete(void *ifce);
-
-
-/*
- reader interface
-
-*/
-
-//#define FFMPEG_IO_BUF_SIZE 16384
-
-//#define FFMPEG_DUMP_REMOTE
-
-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 113, 1)
-#define USE_PRE_0_7 1
-#endif
-
-typedef struct
-{
- /*the service we're responsible for*/
- GF_ClientService *service;
-
- /*input file*/
- AVFormatContext *ctx;
-
- Bool seekable;
- Double seek_time;
-
- s32 audio_st, video_st;
- /*app channels (only deal with 1 audio and one video for now)*/
- LPNETCHANNEL audio_ch;
- LPNETCHANNEL video_ch;
- Bool audio_run, video_run;
- AVRational audio_tscale, video_tscale;
- u32 data_buffer_ms;
-
- /*demuxer thread - we cannot use direct fetching because of demultiplex structure of libavformat
- (reading one channel may lock the other)*/
- GF_Thread *thread;
- GF_Mutex *mx;
- u32 is_paused, is_running;
-
- u32 service_type;
- Bool unreliable_audio_timing;
-
- /*IO wrapper*/
- /*file downloader*/
- GF_DownloadSession *dnload;
-
-#ifdef USE_PRE_0_7
- ByteIOContext io;
- void *options;
-#else
- AVIOContext io;
- AVDictionary *options;
-#endif
- char *buffer;
- u32 buffer_size;
-
- u32 buffer_used;
-
-#ifdef FFMPEG_DUMP_REMOTE
- FILE *outdbg;
-#endif
-} FFDemux;
-
-void *New_FFMPEG_Demux();
-void Delete_FFMPEG_Demux(void *ifce);
-
-
-/*The DSI sent is:
-
- u32 codec_id
-
-- for audio -
- u32 sample_rate: sampling rate or 0 if unknown
- u16 nb_channels: num channels or 0 if unknown
- u16 nb_bits_per_sample: nb bits or 0 if unknown
- u16 num_samples: num audio samples per frame or 0 if unknown
- u16 block_align: audio block align
-
-- for video -
- u32 width: video width or 0 if unknown;
- u32 height: video height or 0 if unknown;
-
-- for both -
- u32 codec_tag: ffmpeg ctx codec tag
- u32 bit_rate: ffmpeg ctx bit rate
-
-- till end of DSI bitstream-
- char *data: extra_data
-*/
-
-
-/*TODO - we need to cleanup the ffmpeg code to align with only latest version and remove old compatibility code*/
-
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 25, 0 )
-
-#define CODEC_ID_SVQ3 AV_CODEC_ID_SVQ3
-#define CODEC_ID_MPEG4 AV_CODEC_ID_MPEG4
-#define CODEC_ID_H264 AV_CODEC_ID_H264
-#define CODEC_ID_MPEG2VIDEO AV_CODEC_ID_MPEG2VIDEO
-#define CODEC_ID_MJPEG AV_CODEC_ID_MJPEG
-#define CODEC_ID_MP2 AV_CODEC_ID_MP2
-#define CODEC_ID_AC3 AV_CODEC_ID_AC3
-#define CODEC_ID_EAC3 AV_CODEC_ID_EAC3
-#define CODEC_ID_DVD_SUBTITLE AV_CODEC_ID_DVD_SUBTITLE
-#define CODEC_ID_RAWVIDEO AV_CODEC_ID_RAWVIDEO
-#define CODEC_ID_MJPEGB AV_CODEC_ID_MJPEGB
-#define CODEC_ID_LJPEG AV_CODEC_ID_LJPEG
-#define CODEC_ID_GIF AV_CODEC_ID_GIF
-#define CODEC_ID_H263 AV_CODEC_ID_H263
-#define CODEC_ID_MP3 AV_CODEC_ID_MP3
-#define CODEC_ID_AAC AV_CODEC_ID_AAC
-#define CODEC_ID_MPEG1VIDEO AV_CODEC_ID_MPEG1VIDEO
-#define CODEC_ID_PNG AV_CODEC_ID_PNG
-#define CODEC_ID_AMR_NB AV_CODEC_ID_AMR_NB
-#define CODEC_ID_AMR_WB AV_CODEC_ID_AMR_WB
-
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 92, 100 )
-#define CODEC_ID_VP9 AV_CODEC_ID_VP9
-#endif
-
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 1, 100 )
-#define CODEC_ID_OPUS AV_CODEC_ID_OPUS
-#endif
-
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(58, 0, 0 )
-#define CODEC_ID_AV1 AV_CODEC_ID_AV1
-#endif
-
-#endif
-
-#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 42, 0)
-#define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
-#define PIX_FMT_YUV422P AV_PIX_FMT_YUV422P
-#define PIX_FMT_YUV444P AV_PIX_FMT_YUV444P
-#define PIX_FMT_YUV420P10LE AV_PIX_FMT_YUV420P10LE
-#define PIX_FMT_YUV422P10LE AV_PIX_FMT_YUV422P10LE
-#define PIX_FMT_YUV444P10LE AV_PIX_FMT_YUV444P10LE
-#define PIX_FMT_BGR24 AV_PIX_FMT_BGR24
-#define PIX_FMT_RGB24 AV_PIX_FMT_RGB24
-#define PIX_FMT_RGBA AV_PIX_FMT_RGBA
-#endif
-
-#if (LIBAVCODEC_VERSION_MAJOR>56)
-#ifndef FF_API_AVFRAME_LAVC
-#define FF_API_AVFRAME_LAVC
-#endif
-#endif
-
-
-
-#endif
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / FFMPEG module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "ffmpeg_in.h"
-
-
-#if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(__GNUC__)
-
-#if defined(_WIN32_WCE)
-#pragma comment(lib, "toolhelp")
-#pragma comment(lib, "winsock")
-#endif
-
-#define _TOSTR(_val) #_val
-#define TOSTR(_val) _TOSTR(_val)
-
-#endif
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_MEDIA_DECODER_INTERFACE,
-#ifndef DISABLE_FFMPEG_DEMUX
- GF_NET_CLIENT_INTERFACE,
-#endif
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_MEDIA_DECODER_INTERFACE) return (GF_BaseInterface*)FFDEC_Load();
-#ifndef DISABLE_FFMPEG_DEMUX
- if (InterfaceType == GF_NET_CLIENT_INTERFACE) return (GF_BaseInterface*)New_FFMPEG_Demux();
-#endif
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- switch (ifce->InterfaceType) {
- case GF_MEDIA_DECODER_INTERFACE:
- FFDEC_Delete(ifce);
- break;
-#ifndef DISABLE_FFMPEG_DEMUX
- case GF_NET_CLIENT_INTERFACE:
- Delete_FFMPEG_Demux(ifce);
- break;
-#endif
- }
-}
-
-
-GPAC_MODULE_STATIC_DECLARATION( ffmpeg )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/freenect
-
-CFLAGS= $(CXXFLAGS) -I"$(SRC_PATH)/include" -DGPAC_HAVE_CONFIG_H -I../.. $(FREENECT_CFLAGS)
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-
-LINKLIBS=
-
-ifeq ($(CONFIG_FREENECT),local)
-LINKLIBS+=-L../../extra_lib/lib/gcc
-CFLAGS+= -I"$(LOCAL_INC_PATH)"
-endif
-
-LINKLIBS+=-lfreenect -L../../bin/gcc -lgpac
-
-
-#common objects
-OBJS=freenect.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_freenect$(DYN_LIB_SUFFIX)
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CXX) -w $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(LINKLIBS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CXX) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2011-20XX
- * All rights reserved
- *
- * This file is part of GPAC / Freenect video input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <gpac/modules/service.h>
-#include <gpac/modules/codec.h>
-#include <gpac/constants.h>
-#include <gpac/download.h>
-
-#ifdef FREENECT_FLAT_HEADERS
-#include <libfreenect.h>
-#else
-#include <libfreenect/libfreenect.h>
-#endif
-
-#include <gpac/thread.h>
-
-
-#if !defined(FREENECT_DEVICE_CAMERA) && defined(FREENECT_FRAME_W)
-#define FREENECT_MINIMAL
-#endif
-
-
-typedef struct
-{
- /*the service we're responsible for*/
- GF_ClientService *service;
-
- freenect_context *f_ctx;
- freenect_device *f_dev;
-
- u32 width, height, fps, out_depth_size, out_color_size, color_stride, depth_stride, color_pixel_format, depth_pixel_format;
- u32 depth_format;
-
- u8 *vid_buf;
- u8 *depth_buf;
- u16 gamma[2048];
-
- GF_SLHeader depth_sl_header, color_sl_header;
- LPNETCHANNEL depth_channel, color_channel;
-
- GF_Thread *th;
- u32 nb_running;
- Bool done;
-
-} FreenectIn;
-
-
-void Freenect_DepthCallback_RGBD(freenect_device *dev, void *v_depth, uint32_t timestamp)
-{
- FreenectIn *vcap = freenect_get_user(dev);
- if (vcap->depth_channel) {
- u32 i, j;
- u16 *depth = (u16*)v_depth;
-
- for (i=0; i<vcap->height; i++) {
- for (j=0; j<vcap->width; j++) {
- int idx_col = 3 * (j + i*vcap->width) ;
- int idx_depth = 4*(j + i*vcap->width) ;
- int pval = depth[i*vcap->width + j];
- pval = 255 - (255*pval) / 2048;
-
- vcap->depth_buf[idx_depth ] = vcap->vid_buf[idx_col];
- vcap->depth_buf[idx_depth + 1] = vcap->vid_buf[idx_col+1];
- vcap->depth_buf[idx_depth + 2] = vcap->vid_buf[idx_col+2];
- vcap->depth_buf[idx_depth + 3] = pval;
- }
- }
- vcap->depth_sl_header.compositionTimeStamp = timestamp;
- gf_service_send_packet(vcap->service, vcap->depth_channel, (char *) vcap->depth_buf, vcap->out_depth_size, &vcap->depth_sl_header, GF_OK);
- }
-}
-
-
-void Freenect_DepthCallback_GREY16(freenect_device *dev, void *v_depth, uint32_t timestamp)
-{
- FreenectIn *vcap = freenect_get_user(dev);
- if (vcap->depth_channel) {
- memcpy(vcap->depth_buf, v_depth, vcap->out_depth_size);
-
- vcap->depth_sl_header.compositionTimeStamp = timestamp;
- gf_service_send_packet(vcap->service, vcap->depth_channel, (char *) vcap->depth_buf, vcap->out_depth_size, &vcap->depth_sl_header, GF_OK);
- }
-}
-
-void Freenect_DepthCallback_GREY8(freenect_device *dev, void *v_depth, uint32_t timestamp)
-{
- FreenectIn *vcap = freenect_get_user(dev);
- if (vcap->depth_channel) {
- u32 i, j;
- u16 *depth = (u16*)v_depth;
-
- for (i=0; i<vcap->height; i++) {
- for (j=0; j<vcap->width; j++) {
- int pval = depth[j + i*vcap->width];
- pval = (255*pval) / 2048;
- vcap->depth_buf[j + i*vcap->width] = pval;
- }
- }
-// vcap->depth_sl_header.compositionTimeStamp = timestamp;
- vcap->depth_sl_header.compositionTimeStamp ++;
- gf_service_send_packet(vcap->service, vcap->depth_channel, (char *) vcap->depth_buf, vcap->out_depth_size, &vcap->depth_sl_header, GF_OK);
- }
-}
-
-void Freenect_DepthCallback_ColorGradient(freenect_device *dev, void *v_depth, uint32_t timestamp)
-{
- FreenectIn *vcap = freenect_get_user(dev);
- if (vcap->depth_channel) {
- u32 i;
- u16 *depth = (u16*)v_depth;
- /*remap to color RGB using freenect gamma*/
- for (i=0; i<vcap->width*vcap->height; i++) {
- int pval = vcap->gamma[depth[i]];
- int lb = pval & 0xff;
- switch (pval>>8) {
- case 0:
- vcap->depth_buf[3*i+0] = 255;
- vcap->depth_buf[3*i+1] = 255-lb;
- vcap->depth_buf[3*i+2] = 255-lb;
- break;
- case 1:
- vcap->depth_buf[3*i+0] = 255;
- vcap->depth_buf[3*i+1] = lb;
- vcap->depth_buf[3*i+2] = 0;
- break;
- case 2:
- vcap->depth_buf[3*i+0] = 255-lb;
- vcap->depth_buf[3*i+1] = 255;
- vcap->depth_buf[3*i+2] = 0;
- break;
- case 3:
- vcap->depth_buf[3*i+0] = 0;
- vcap->depth_buf[3*i+1] = 255;
- vcap->depth_buf[3*i+2] = lb;
- break;
- case 4:
- vcap->depth_buf[3*i+0] = 0;
- vcap->depth_buf[3*i+1] = 255-lb;
- vcap->depth_buf[3*i+2] = 255;
- break;
- case 5:
- vcap->depth_buf[3*i+0] = 0;
- vcap->depth_buf[3*i+1] = 0;
- vcap->depth_buf[3*i+2] = 255-lb;
- break;
- default:
- vcap->depth_buf[3*i+0] = 0;
- vcap->depth_buf[3*i+1] = 0;
- vcap->depth_buf[3*i+2] = 0;
- break;
- }
- }
- vcap->depth_sl_header.compositionTimeStamp = timestamp;
- gf_service_send_packet(vcap->service, vcap->depth_channel, (char *) vcap->depth_buf, vcap->out_depth_size, &vcap->depth_sl_header, GF_OK);
- }
-}
-
-void Freenect_RGBCallback(freenect_device *dev, void *rgb, uint32_t timestamp)
-{
- FreenectIn *vcap = freenect_get_user(dev);
- if (vcap->color_channel) {
- vcap->color_sl_header.compositionTimeStamp = timestamp;
- gf_service_send_packet(vcap->service, vcap->color_channel, (char *) rgb, vcap->out_color_size, &vcap->color_sl_header, GF_OK);
- }
-}
-
-
-u32 FreenectRun(void *par)
-{
- FreenectIn *vcap = par;
-
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[Freenect] Starting device thread\n"));
- freenect_start_depth(vcap->f_dev);
- freenect_start_video(vcap->f_dev);
- vcap->done = 0;
- while (vcap->nb_running && (freenect_process_events(vcap->f_ctx)>=0) ) {
- gf_sleep(0);
- }
- freenect_stop_depth(vcap->f_dev);
- freenect_stop_video(vcap->f_dev);
- vcap->done = 1;
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[Freenect] Stoping device thread\n"));
- return 0;
-}
-
-Bool Freenect_CanHandleURL(GF_InputService *plug, const char *url)
-{
- if (!strnicmp(url, "camera://", 9)) return 1;
- if (!strnicmp(url, "video://", 8)) return 1;
- if (!strnicmp(url, "kinect://", 8)) return 1;
- return 0;
-}
-
-void Freenect_Logs(freenect_context *dev, freenect_loglevel level, const char *msg)
-{
- switch (level) {
- case FREENECT_LOG_ERROR:
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[Freenect] %s", msg));
- break;
- case FREENECT_LOG_WARNING:
- GF_LOG(GF_LOG_WARNING, GF_LOG_MODULE, ("[Freenect] %s", msg));
- break;
- case FREENECT_LOG_NOTICE:
- case FREENECT_LOG_INFO:
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[Freenect] %s", msg));
- break;
- case FREENECT_LOG_DEBUG:
- case FREENECT_LOG_SPEW:
- case FREENECT_LOG_FLOOD:
- default:
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[Freenect] %s", msg));
- break;
- }
-}
-
-
-GF_Err Freenect_ConnectService(GF_InputService *plug, GF_ClientService *serv, const char *url)
-{
- GF_ESD *esd;
- GF_BitStream *bs;
- GF_ObjectDescriptor *od;
- FreenectIn *vcap = (FreenectIn *) plug->priv;
-
- if (!vcap || !serv || !url) return GF_BAD_PARAM;
-
- vcap->service = serv;
-
- if (!vcap->f_ctx) {
- int i;
-#ifndef FREENECT_MINIMAL
- freenect_frame_mode frame_mode;
- freenect_resolution frame_format = FREENECT_RESOLUTION_MEDIUM;
-#endif
- char *name, *params;
- int res = freenect_init(&vcap->f_ctx, NULL);
- if (res < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("freenect_init() failed - ret code %d\n", res));
- return GF_IO_ERR;
- }
- freenect_set_log_level(vcap->f_ctx, FREENECT_LOG_DEBUG);
- freenect_set_log_callback(vcap->f_ctx, Freenect_Logs);
-#ifndef FREENECT_MINIMAL
- freenect_select_subdevices(vcap->f_ctx, FREENECT_DEVICE_CAMERA);
-#endif
- res = freenect_num_devices (vcap->f_ctx);
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[Freenect] %d devices found\n", res));
- if (res<1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[Freenect] No device found\n"));
- return GF_URL_ERROR;
- }
-
- res = freenect_open_device(vcap->f_ctx, &vcap->f_dev, 0);
- if (res < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[Freenect] Could not open Kinect - error %d\n", res));
- return GF_SERVICE_ERROR;
- }
-
-
- params = (char *) strchr(url, '?');
- if (params) params[0] = 0;
- name = (char *) strstr(url, "://");
- if (name) name += 3;
-
- if (!stricmp(name, "color")) {
- }
-
- if (params) {
- params[0] = '?';
- params ++;
- }
- while (params) {
- char *sep = (char *) strchr(params, '&');
- if (sep) sep[0] = 0;
-
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[VideoCapture] Set camera option %s\n", params));
-
- if (!strnicmp(params, "resolution=", 11)) {
-#ifndef FREENECT_MINIMAL
- u32 w, h;
- if (sscanf(params+11, "%dx%d", &w, &h)==2) {
- if ((w<=320) || (h<=240)) frame_format = FREENECT_RESOLUTION_LOW;
- else if ((w<=640) || (h<=480)) frame_format = FREENECT_RESOLUTION_MEDIUM;
- else frame_format = FREENECT_RESOLUTION_HIGH;
- }
-#endif
- }
- else if (!strnicmp(params, "format=", 7)) {
- if (!stricmp(params+7, "standard")) vcap->depth_format = 0;
- else if (!stricmp(params+7, "grey")) vcap->depth_format = 1;
- else if (!stricmp(params+7, "rgbd")) vcap->depth_format = 2;
- else if (!stricmp(params+7, "grey16")) vcap->depth_format = 3;
- else {
- GF_LOG(GF_LOG_WARNING, GF_LOG_MODULE, ("[VideoCapture] Unrecognized value %s for parameter \"format\"\n", params+7));
- }
- }
- else {
- GF_LOG(GF_LOG_WARNING, GF_LOG_MODULE, ("[VideoCapture] Unrecognized parameter %s\n", params));
- }
-
- if (!sep) break;
- sep[0] = '&';
- params = sep+1;
- }
-
-#ifndef FREENECT_MINIMAL
- frame_mode = freenect_find_video_mode(frame_format, FREENECT_VIDEO_RGB);
- res = freenect_set_video_mode(vcap->f_dev, frame_mode);
- res = freenect_set_depth_mode(vcap->f_dev, freenect_find_depth_mode(frame_format, FREENECT_DEPTH_11BIT));
- vcap->width = frame_mode.width;
- vcap->height = frame_mode.height;
- vcap->fps = frame_mode.framerate;
-#else
- freenect_set_video_format(vcap->f_dev, FREENECT_VIDEO_RGB);
- res = freenect_set_depth_format(vcap->f_dev, FREENECT_DEPTH_11BIT);
- vcap->width = FREENECT_FRAME_W;
- vcap->height = FREENECT_FRAME_H;
- vcap->fps = 30;
-#endif
- /*currently hardcoded*/
- vcap->color_pixel_format = GF_PIXEL_RGB_24;
- vcap->color_stride = 3*vcap->width;
- vcap->out_color_size = vcap->color_stride * vcap->height;
- vcap->vid_buf = gf_malloc(sizeof(char) * vcap->out_color_size);
- freenect_set_video_callback(vcap->f_dev, Freenect_RGBCallback);
-
- switch (vcap->depth_format) {
- case 1:
- vcap->depth_pixel_format = GF_PIXEL_GREYSCALE;
- vcap->depth_stride = vcap->width;
- freenect_set_depth_callback(vcap->f_dev, Freenect_DepthCallback_GREY8);
- break;
- case 2:
- vcap->depth_pixel_format = GF_PIXEL_RGBD;
- vcap->depth_stride = 4*vcap->width;
- freenect_set_depth_callback(vcap->f_dev, Freenect_DepthCallback_RGBD);
- break;
- case 3:
- vcap->depth_pixel_format = GF_PIXEL_RGB_565;
- vcap->depth_stride = 2*vcap->width;
- freenect_set_depth_callback(vcap->f_dev, Freenect_DepthCallback_GREY16);
- break;
- default:
- vcap->depth_pixel_format = GF_PIXEL_RGB_24;
- vcap->depth_stride = 3*vcap->width;
- freenect_set_depth_callback(vcap->f_dev, Freenect_DepthCallback_ColorGradient);
- }
- vcap->out_depth_size = vcap->depth_stride * vcap->height;
- vcap->depth_buf = gf_malloc(sizeof(char) * vcap->out_depth_size);
-
-
- res = freenect_set_video_buffer(vcap->f_dev, vcap->vid_buf);
-
- GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[Freenect] Device configured - resolution %dx%d - Frame Rate %d - Depth Pixel Format %s\n", vcap->width, vcap->height, vcap->fps, gf_4cc_to_str(vcap->depth_pixel_format) ));
-
-
- for (i=0; i<2048; i++) {
- float v = i/2048.0f;
- v = powf(v, 3)* 6;
- vcap->gamma[i] = (u16) (v*6*256);
- }
-
- freenect_set_user(vcap->f_dev, vcap);
-
- vcap->th = gf_th_new("Freenect");
- }
-
- /*ACK connection is OK*/
- gf_service_connect_ack(serv, NULL, GF_OK);
-
-
- /*setup object descriptor*/
- od = (GF_ObjectDescriptor *) gf_odf_desc_new(GF_ODF_OD_TAG);
-
- esd = gf_odf_desc_esd_new(0);
- esd->slConfig->timestampResolution = 1000;
- if (!strnicmp(url, "camera://", 9) || !strnicmp(url, "video://", 8) || !strnicmp(url, "kinect://", 8)) {
- if (strstr(url, "color") || strstr(url, "COLOR")) {
- od->objectDescriptorID = 2;
- esd->ESID = 2;
- esd->decoderConfig->streamType = GF_STREAM_VISUAL;
- } else {
- od->objectDescriptorID = 1;
- esd->ESID = 1;
- esd->decoderConfig->streamType = GF_STREAM_VISUAL;
- }
- } else {
- od->objectDescriptorID = 3;
- esd->ESID = 3;
- esd->decoderConfig->streamType = GF_STREAM_AUDIO;
- }
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_RAW_MEDIA_STREAM;
-
- bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- gf_bs_write_u32(bs, (esd->ESID==2) ? vcap->color_pixel_format : vcap->depth_pixel_format);
- gf_bs_write_u16(bs, vcap->width);
- gf_bs_write_u16(bs, vcap->height);
- gf_bs_write_u32(bs, (esd->ESID==2) ? vcap->out_color_size : vcap->out_depth_size);
- gf_bs_write_u32(bs, (esd->ESID==2) ? vcap->color_stride : vcap->depth_stride);
- gf_bs_get_content(bs, &esd->decoderConfig->decoderSpecificInfo->data, &esd->decoderConfig->decoderSpecificInfo->dataLength);
- gf_bs_del(bs);
-
- gf_list_add(od->ESDescriptors, esd);
- gf_service_declare_media(vcap->service, (GF_Descriptor*)od, 0);
-
- return GF_OK;
-}
-
-GF_Err Freenect_CloseService(GF_InputService *plug)
-{
- FreenectIn *vcap = (FreenectIn *) plug->priv;
- if (vcap->f_dev) freenect_close_device(vcap->f_dev);
- if (vcap->f_ctx) freenect_shutdown(vcap->f_ctx);
- vcap->f_ctx = NULL;
- vcap->f_dev = NULL;
- gf_service_disconnect_ack(vcap->service, NULL, GF_OK);
- return GF_OK;
-}
-
-/*Dummy input just send a file name, no multitrack to handle so we don't need to check sub_url nor expected type*/
-static GF_Descriptor *Freenect_GetServiceDesc(GF_InputService *plug, u32 expect_type, const char *sub_url)
-{
- return NULL;
-}
-
-
-GF_Err Freenect_ServiceCommand(GF_InputService *plug, GF_NetworkCommand *com)
-{
- FreenectIn *vcap = (FreenectIn *) plug->priv;
-
- if (!com->base.on_channel) return GF_NOT_SUPPORTED;
-
- switch (com->command_type) {
- case GF_NET_CHAN_SET_PULL:
- return GF_NOT_SUPPORTED;
- case GF_NET_CHAN_INTERACTIVE:
- return GF_OK;
- /*since data is file-based, no padding is needed (decoder plugin will handle it itself)*/
- case GF_NET_CHAN_SET_PADDING:
- return GF_OK;
- case GF_NET_CHAN_BUFFER:
- com->buffer.max = com->buffer.min = 500;
- return GF_OK;
- case GF_NET_CHAN_DURATION:
- /*this module is not made for updates, use undefined duration*/
- com->duration.duration = 0;
- return GF_OK;
- case GF_NET_CHAN_PLAY:
- if (!vcap->nb_running) {
- vcap->nb_running++;
- gf_th_run(vcap->th, FreenectRun, vcap);
- }
- return GF_OK;
- case GF_NET_CHAN_STOP:
- if (vcap->nb_running) {
- vcap->nb_running--;
- if (!vcap->nb_running) {
- while (! vcap->done) {
- gf_sleep(10);
- }
- }
- }
- return GF_OK;
- case GF_NET_CHAN_CONFIG:
- return GF_OK;
- case GF_NET_CHAN_GET_DSI:
- com->get_dsi.dsi = NULL;
- com->get_dsi.dsi_len = 0;
- return GF_OK;
- default:
- break;
- }
- return GF_OK;
-}
-
-GF_Err Freenect_ConnectChannel(GF_InputService *plug, LPNETCHANNEL channel, const char *url, Bool upstream)
-{
- u32 ESID;
- FreenectIn *vcap = (FreenectIn *) plug->priv;
-
- sscanf(url, "ES_ID=%u", &ESID);
- if (ESID == 1) {
- vcap->depth_channel = channel;
- memset(&vcap->depth_sl_header, 0, sizeof(GF_SLHeader));
- vcap->depth_sl_header.compositionTimeStampFlag = 1;
- gf_service_connect_ack(vcap->service, channel, GF_OK);
- } else if (ESID == 2) {
- vcap->color_channel = channel;
- memset(&vcap->color_sl_header, 0, sizeof(GF_SLHeader));
- vcap->color_sl_header.compositionTimeStampFlag = 1;
- gf_service_connect_ack(vcap->service, channel, GF_OK);
- } else {
- /*TODO*/
- gf_service_connect_ack(vcap->service, channel, GF_STREAM_NOT_FOUND);
- }
- return GF_OK;
-}
-
-GF_Err Freenect_DisconnectChannel(GF_InputService *plug, LPNETCHANNEL channel)
-{
- FreenectIn *vcap = (FreenectIn *) plug->priv;
- if (vcap->depth_channel == channel) {
- vcap->depth_channel = NULL;
- }
- else if (vcap->color_channel == channel) {
- vcap->color_channel = NULL;
- }
- gf_service_disconnect_ack(vcap->service, channel, GF_OK);
- return GF_OK;
-}
-
-Bool Freenect_CanHandleURLInService(GF_InputService *plug, const char *url)
-{
- return 0;
-}
-
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_NET_CLIENT_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_NET_CLIENT_INTERFACE) {
- FreenectIn *vcap;
- GF_InputService *plug;
- GF_SAFEALLOC(plug, GF_InputService);
- memset(plug, 0, sizeof(GF_InputService));
- GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "Video Capture using libfreenect", "gpac distribution")
-
- plug->RegisterMimeTypes = NULL;
- plug->CanHandleURL = Freenect_CanHandleURL;
- plug->ConnectService = Freenect_ConnectService;
- plug->CloseService = Freenect_CloseService;
- plug->GetServiceDescriptor = Freenect_GetServiceDesc;
- plug->ConnectChannel = Freenect_ConnectChannel;
- plug->DisconnectChannel = Freenect_DisconnectChannel;
- plug->ServiceCommand = Freenect_ServiceCommand;
- plug->CanHandleURLInService = Freenect_CanHandleURLInService;
-
- GF_SAFEALLOC(vcap, FreenectIn);
- plug->priv = vcap;
- return (GF_BaseInterface *)plug;
- }
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *bi)
-{
- if (bi->InterfaceType==GF_NET_CLIENT_INTERFACE) {
- GF_InputService *ifcn = (GF_InputService*)bi;
- FreenectIn *vcap = (FreenectIn*)ifcn->priv;
-
- if (vcap->vid_buf) gf_free(vcap->vid_buf);
- if (vcap->depth_buf) gf_free(vcap->depth_buf);
- if (vcap->th) gf_th_del(vcap->th);
- gf_free(vcap);
- gf_free(bi);
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( freenect )
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / GAPI WinCE-iPaq video render module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <windows.h>
-#include <aygshell.h>
-#include <wingdi.h>
-#include <gx.h>
-
-#include "gapi.h"
-
-#ifdef GPAC_USE_GLES1X
-
-#if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(__GNUC__)
-
-#if 0
-# pragma message("Using OpenGL-ES Common Lite Profile")
-# pragma comment(lib, "libGLES_CL")
-
-#define GLES_NO_PBUFFER
-#define GLES_NO_PIXMAP
-
-#else
-# pragma message("Using OpenGL-ES Common Profile")
-# pragma comment(lib, "libGLES_CM")
-
-//#define GLES_NO_PIXMAP
-
-#endif
-
-#pragma comment(lib, "gx.lib")
-#endif
-
-#endif
-
-static Bool landscape = GF_FALSE;
-
-
-#define PRINT(__str) OutputDebugString(_T(__str))
-
-#define GAPICTX(dr) GAPIPriv *gctx = (GAPIPriv *) dr->opaque;
-
-static GF_Err GAPI_InitBackBuffer(GF_VideoOutput *dr, u32 VideoWidth, u32 VideoHeight);
-
-static GF_VideoOutput *the_video_driver = NULL;
-
-static void GAPI_GetCoordinates(DWORD lParam, GF_Event *evt)
-{
- GAPIPriv *ctx = (GAPIPriv *)the_video_driver->opaque;
- evt->mouse.x = LOWORD(lParam);
- evt->mouse.y = HIWORD(lParam);
-
- if (ctx->scale_coords) {
- evt->mouse.x = evt->mouse.x * the_video_driver->max_screen_width / ctx->sys_w;
- evt->mouse.y = evt->mouse.y * the_video_driver->max_screen_height / ctx->sys_h;
- }
-
-
- if (ctx->fullscreen) {
- POINT pt;
- pt.x = evt->mouse.x;
- pt.y = evt->mouse.y;
- ClientToScreen(ctx->hWnd, &pt);
- if (landscape) {
- evt->mouse.x = ctx->fs_w - pt.y;
- evt->mouse.y = pt.x;
- } else {
- evt->mouse.x = pt.x;
- evt->mouse.y = pt.y;
- }
- }
-}
-
-static void w32_translate_key(u32 wParam, u32 lParam, GF_EventKey *evt)
-{
- evt->flags = 0;
- evt->hw_code = wParam;
- switch (wParam) {
- case VK_BACK:
- evt->key_code = GF_KEY_BACKSPACE;
- break;
- case VK_TAB:
- evt->key_code = GF_KEY_TAB;
- break;
- case VK_CLEAR:
- evt->key_code = GF_KEY_CLEAR;
- break;
- case VK_RETURN:
- evt->key_code = GF_KEY_ENTER;
- break;
- case VK_SHIFT:
- evt->key_code = GF_KEY_SHIFT;
- break;
- case VK_CONTROL:
- evt->key_code = GF_KEY_CONTROL;
- break;
- case VK_MENU:
- evt->key_code = GF_KEY_ALT;
- break;
- case VK_PAUSE:
- evt->key_code = GF_KEY_PAUSE;
- break;
- case VK_CAPITAL:
- evt->key_code = GF_KEY_CAPSLOCK;
- break;
- case VK_KANA:
- evt->key_code = GF_KEY_KANAMODE;
- break;
- case VK_JUNJA:
- evt->key_code = GF_KEY_JUNJAMODE;
- break;
- case VK_FINAL:
- evt->key_code = GF_KEY_FINALMODE;
- break;
- case VK_KANJI:
- evt->key_code = GF_KEY_KANJIMODE;
- break;
- case VK_ESCAPE:
- evt->key_code = GF_KEY_ESCAPE;
- break;
- case VK_CONVERT:
- evt->key_code = GF_KEY_CONVERT;
- break;
- case VK_SPACE:
- evt->key_code = GF_KEY_SPACE;
- break;
- case VK_PRIOR:
- evt->key_code = GF_KEY_PAGEUP;
- break;
- case VK_NEXT:
- evt->key_code = GF_KEY_PAGEDOWN;
- break;
- case VK_END:
- evt->key_code = GF_KEY_END;
- break;
- case VK_HOME:
- evt->key_code = GF_KEY_HOME;
- break;
- case VK_LEFT:
- evt->key_code = GF_KEY_LEFT;
- break;
- case VK_UP:
- evt->key_code = GF_KEY_UP;
- break;
- case VK_RIGHT:
- evt->key_code = GF_KEY_RIGHT;
- break;
- case VK_DOWN:
- evt->key_code = GF_KEY_DOWN;
- break;
- case VK_SELECT:
- evt->key_code = GF_KEY_SELECT;
- break;
- case VK_PRINT:
- case VK_SNAPSHOT:
- evt->key_code = GF_KEY_PRINTSCREEN;
- break;
- case VK_EXECUTE:
- evt->key_code = GF_KEY_EXECUTE;
- break;
- case VK_INSERT:
- evt->key_code = GF_KEY_INSERT;
- break;
- case VK_DELETE:
- evt->key_code = GF_KEY_DEL;
- break;
- case VK_HELP:
- evt->key_code = GF_KEY_HELP;
- break;
-
- /* case VK_LWIN: return ;
- case VK_RWIN: return ;
- case VK_APPS: return ;
- */
- case VK_NUMPAD0:
- evt->key_code = GF_KEY_0;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_NUMPAD1:
- evt->key_code = GF_KEY_1;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_NUMPAD2:
- evt->key_code = GF_KEY_2;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_NUMPAD3:
- evt->key_code = GF_KEY_3;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_NUMPAD4:
- evt->key_code = GF_KEY_4;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_NUMPAD5:
- evt->key_code = GF_KEY_5;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_NUMPAD6:
- evt->key_code = GF_KEY_6;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_NUMPAD7:
- evt->key_code = GF_KEY_7;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_NUMPAD8:
- evt->key_code = GF_KEY_8;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_NUMPAD9:
- evt->key_code = GF_KEY_9;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_MULTIPLY:
- evt->key_code = GF_KEY_STAR;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_ADD:
- evt->key_code = GF_KEY_PLUS;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_SEPARATOR:
- evt->key_code = GF_KEY_FULLSTOP;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_SUBTRACT:
- evt->key_code = GF_KEY_HYPHEN;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_DECIMAL:
- evt->key_code = GF_KEY_COMMA;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_DIVIDE:
- evt->key_code = GF_KEY_SLASH;
- evt->flags = GF_KEY_EXT_NUMPAD;
- break;
- case VK_F1:
- evt->key_code = GF_KEY_F1;
- break;
- case VK_F2:
- evt->key_code = GF_KEY_F2;
- break;
- case VK_F3:
- evt->key_code = GF_KEY_F3;
- break;
- case VK_F4:
- evt->key_code = GF_KEY_F4;
- break;
- case VK_F5:
- evt->key_code = GF_KEY_F5;
- break;
-// case VK_F6: evt->key_code = GF_KEY_F6; break;
-// case VK_F7: evt->key_code = GF_KEY_F7; break;
- case VK_F6:
- evt->key_code = GF_KEY_VOLUMEUP;
- break;
- case VK_F7:
- evt->key_code = GF_KEY_VOLUMEDOWN;
- break;
- case VK_F8:
- evt->key_code = GF_KEY_F8;
- break;
-
- case VK_F9:
- evt->key_code = GF_KEY_F9;
- break;
- case VK_F10:
- evt->key_code = GF_KEY_F10;
- break;
- case VK_F11:
- evt->key_code = GF_KEY_F11;
- break;
- case VK_F12:
- evt->key_code = GF_KEY_F12;
- break;
- case VK_F13:
- evt->key_code = GF_KEY_F13;
- break;
- case VK_F14:
- evt->key_code = GF_KEY_F14;
- break;
- case VK_F15:
- evt->key_code = GF_KEY_F15;
- break;
- case VK_F16:
- evt->key_code = GF_KEY_F16;
- break;
- case VK_F17:
- evt->key_code = GF_KEY_F17;
- break;
- case VK_F18:
- evt->key_code = GF_KEY_F18;
- break;
- case VK_F19:
- evt->key_code = GF_KEY_F19;
- break;
- case VK_F20:
- evt->key_code = GF_KEY_F20;
- break;
- case VK_F21:
- evt->key_code = GF_KEY_F21;
- break;
- case VK_F22:
- evt->key_code = GF_KEY_F22;
- break;
- case VK_F23:
- evt->key_code = GF_KEY_F23;
- break;
- case VK_F24:
- evt->key_code = GF_KEY_F24;
- break;
-
- case VK_NUMLOCK:
- evt->key_code = GF_KEY_NUMLOCK;
- break;
- case VK_SCROLL:
- evt->key_code = GF_KEY_SCROLL;
- break;
-
- /*
- * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
- * Used only as parameters to GetAsyncKeyState() and GetKeyState().
- * No other API or message will distinguish left and right keys in this way.
- */
- case VK_LSHIFT:
- evt->key_code = GF_KEY_SHIFT;
- evt->flags = GF_KEY_EXT_LEFT;
- break;
- case VK_RSHIFT:
- evt->key_code = GF_KEY_SHIFT;
- evt->flags = GF_KEY_EXT_RIGHT;
- break;
- case VK_LCONTROL:
- evt->key_code = GF_KEY_CONTROL;
- evt->flags = GF_KEY_EXT_LEFT;
- break;
- case VK_RCONTROL:
- evt->key_code = GF_KEY_CONTROL;
- evt->flags = GF_KEY_EXT_RIGHT;
- break;
- case VK_LMENU:
- evt->key_code = GF_KEY_ALT;
- evt->flags = GF_KEY_EXT_LEFT;
- break;
- case VK_RMENU:
- evt->key_code = GF_KEY_ALT;
- evt->flags = GF_KEY_EXT_RIGHT;
- break;
-
-#if(WINVER >= 0x0400)
- case VK_PROCESSKEY:
- evt->key_code = GF_KEY_PROCESS;
- break;
-#endif /* WINVER >= 0x0400 */
-
- case VK_ATTN:
- evt->key_code = GF_KEY_ATTN;
- break;
- case VK_CRSEL:
- evt->key_code = GF_KEY_CRSEL;
- break;
- case VK_EXSEL:
- evt->key_code = GF_KEY_EXSEL;
- break;
- case VK_EREOF:
- evt->key_code = GF_KEY_ERASEEOF;
- break;
- case VK_PLAY:
- evt->key_code = GF_KEY_PLAY;
- break;
- case VK_ZOOM:
- evt->key_code = GF_KEY_ZOOM;
- break;
- //case VK_NONAME: evt->key_code = GF_KEY_NONAME; break;
- //case VK_PA1: evt->key_code = GF_KEY_PA1; break;
- case VK_OEM_CLEAR:
- evt->key_code = GF_KEY_CLEAR;
- break;
-
- /*thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */
- /* VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */
- default:
- if ((wParam>=0x30) && (wParam<=0x39)) evt->key_code = GF_KEY_0 + wParam-0x30;
- else if ((wParam>=0x41) && (wParam<=0x5A)) evt->key_code = GF_KEY_A + wParam-0x41;
- else {
- GAPIPriv *ctx = (GAPIPriv *)the_video_driver->opaque;
- short res = (LOWORD(wParam) != 0x5b) ? LOWORD(wParam) : wParam;
-
- if (res==ctx->keys.vkLeft) evt->key_code = landscape ? GF_KEY_UP : GF_KEY_LEFT;
- else if (res==ctx->keys.vkRight) evt->key_code = landscape ? GF_KEY_DOWN : GF_KEY_RIGHT;
- else if (res==ctx->keys.vkDown) evt->key_code = landscape ? GF_KEY_LEFT : GF_KEY_DOWN;
- else if (res==ctx->keys.vkUp) evt->key_code = landscape ? GF_KEY_RIGHT : GF_KEY_UP;
- else if (res==ctx->keys.vkStart) evt->key_code = GF_KEY_ENTER;
- else if (res==ctx->keys.vkA)
- evt->key_code = GF_KEY_MEDIAPREVIOUSTRACK;
- else if (res==ctx->keys.vkB)
- evt->key_code = GF_KEY_MEDIANEXTTRACK;
- else if (res==ctx->keys.vkC)
- evt->key_code = GF_KEY_SHIFT;
- else if (res==0xc1)
- evt->key_code = GF_KEY_ALT;
- else if (res==0xc2)
- evt->key_code = GF_KEY_CONTROL;
- else if (res==0xc5)
- evt->key_code = GF_KEY_VOLUMEDOWN;
- else {
- evt->key_code = GF_KEY_UNIDENTIFIED;
- }
- }
- break;
- }
-}
-
-//#define DIRECT_BITBLT
-
-LRESULT APIENTRY GAPI_WindowProc(HWND hWnd, UINT msg, UINT wParam, LONG lParam)
-{
- GF_Event evt;
- switch (msg) {
- case WM_SIZE:
- {
- GAPIPriv *ctx = (GAPIPriv *)the_video_driver->opaque;
- evt.type = GF_EVENT_SIZE;
- evt.size.width = LOWORD(lParam);
- evt.size.height = HIWORD(lParam);
- the_video_driver->on_event(the_video_driver->evt_cbk_hdl, &evt);
- }
- break;
- case WM_CLOSE:
- memset(&evt, 0, sizeof(GF_Event));
- evt.type = GF_EVENT_QUIT;
- the_video_driver->on_event(the_video_driver->evt_cbk_hdl, &evt);
- return 1;
- case WM_DESTROY:
- {
- GAPIPriv *ctx = (GAPIPriv *)the_video_driver->opaque;
- if (ctx->owns_hwnd ) {
- PostQuitMessage (0);
- } else if (ctx->orig_wnd_proc) {
- /*restore window proc*/
- SetWindowLong(ctx->hWnd, GWL_WNDPROC, ctx->orig_wnd_proc);
- ctx->orig_wnd_proc = 0L;
- }
- }
- break;
-
- case WM_ERASEBKGND:
- evt.type = GF_EVENT_REFRESH;
- the_video_driver->on_event(the_video_driver->evt_cbk_hdl, &evt);
- break;
- case WM_PAINT:
-#ifndef DIRECT_BITBLT
- {
- GAPIPriv *gctx = (GAPIPriv *)the_video_driver->opaque;
- if (gctx->gx_mode || !gctx->bitmap) break;
- HDC dc = GetDC(gctx->hWnd);
- BitBlt(dc, gctx->dst_blt.x, gctx->dst_blt.y, gctx->bb_width, gctx->bb_height, gctx->hdcBitmap, 0, 0, SRCCOPY);
- ReleaseDC(gctx->hWnd, dc);
- }
-#endif
- break;
-
- case WM_MOUSEMOVE:
- GAPI_GetCoordinates(lParam, &evt);
- evt.type = GF_EVENT_MOUSEMOVE;
- the_video_driver->on_event(the_video_driver->evt_cbk_hdl, &evt);
- break;
- case WM_LBUTTONDOWN:
- case WM_LBUTTONDBLCLK:
- GAPI_GetCoordinates(lParam, &evt);
- evt.type = GF_EVENT_MOUSEDOWN;
- evt.mouse.button = GF_MOUSE_LEFT;
- the_video_driver->on_event(the_video_driver->evt_cbk_hdl, &evt);
- break;
- case WM_LBUTTONUP:
- GAPI_GetCoordinates(lParam, &evt);
- evt.type = GF_EVENT_MOUSEUP;
- evt.mouse.button = GF_MOUSE_LEFT;
- the_video_driver->on_event(the_video_driver->evt_cbk_hdl, &evt);
- break;
-
- /*FIXME - there's a bug on alt state (we miss one event)*/
- case WM_SYSKEYDOWN:
- case WM_SYSKEYUP:
- case WM_KEYDOWN:
- case WM_KEYUP:
- w32_translate_key(wParam, lParam, &evt.key);
- evt.type = ((msg==WM_SYSKEYDOWN) || (msg==WM_KEYDOWN)) ? GF_EVENT_KEYDOWN : GF_EVENT_KEYUP;
- the_video_driver->on_event(the_video_driver->evt_cbk_hdl, &evt);
- break;
- case WM_CHAR:
- evt.type = GF_EVENT_TEXTINPUT;
- evt.character.unicode_char = wParam;
- break;
- }
- return DefWindowProc (hWnd, msg, wParam, lParam);
-}
-
-void GAPI_WindowThread(void *par)
-{
- MSG msg;
- WNDCLASS wc;
- GAPIPriv *ctx = (GAPIPriv *)the_video_driver->opaque;
-
- memset(&wc, 0, sizeof(WNDCLASS));
- wc.hInstance = GetModuleHandle(_T("gm_gapi.dll"));
- wc.lpfnWndProc = GAPI_WindowProc;
- wc.hCursor = LoadCursor (NULL, IDC_ARROW);
- wc.hbrBackground = (HBRUSH)GetStockObject (BLACK_BRUSH);
- wc.lpszClassName = _T("GPAC GAPI Output");
- RegisterClass (&wc);
-
- ctx->hWnd = CreateWindow(_T("GPAC GAPI Output"), NULL, WS_POPUP, 0, 0, 120, 100, NULL, NULL, wc.hInstance, NULL);
- if (ctx->hWnd == NULL) {
- ctx->ThreadID = 0;
- ExitThread(1);
- }
- ShowWindow(ctx->hWnd, SW_SHOWNORMAL);
-
- while (GetMessage (&(msg), NULL, 0, 0)) {
- TranslateMessage (&(msg));
- DispatchMessage (&(msg));
- }
- ctx->ThreadID = 0;
- ExitThread (0);
-}
-
-
-void GAPI_SetupWindow(GF_VideoOutput *dr)
-{
-#ifdef GPAC_USE_GLES1X
- GF_Err e;
-#endif
- GAPIPriv *ctx = (GAPIPriv *)dr->opaque;
- if (the_video_driver) return;
- the_video_driver = dr;
-
- if (!ctx->hWnd) {
- ctx->hThread = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) GAPI_WindowThread, (LPVOID) dr, 0, &(ctx->ThreadID) );
- while (!ctx->hWnd && ctx->hThread) gf_sleep(10);
- if (!ctx->hThread) return;
- ctx->owns_hwnd = GF_TRUE;
- } else {
- ctx->orig_wnd_proc = GetWindowLong(ctx->hWnd, GWL_WNDPROC);
- /*override window proc*/
- SetWindowLong(ctx->hWnd, GWL_WNDPROC, (DWORD) GAPI_WindowProc);
- }
-
- {
- HDC hdc;
- hdc = GetDC(ctx->hWnd);
- dr->dpi_x = GetDeviceCaps(hdc, LOGPIXELSX);
- dr->dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
- ReleaseDC(ctx->hWnd, hdc);
- }
-
-
-#ifdef GPAC_USE_GLES1X
- ctx->use_pbuffer = GF_TRUE;
- dr->hw_caps |= GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;
- e = GAPI_SetupOGL_ES_Offscreen(dr, 20, 20);
- if (e!=GF_OK) {
- dr->hw_caps &= ~GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;
-#ifndef GLES_NO_PIXMAP
- e = GAPI_SetupOGL_ES_Offscreen(dr, 20, 20);
-#endif
- }
- if (!e) {
- dr->hw_caps |= GF_VIDEO_HW_OPENGL_OFFSCREEN;
- return;
- }
- ctx->use_pbuffer = GF_FALSE;
-
- WNDCLASS wc;
- HINSTANCE hInst;
- hInst = GetModuleHandle(_T("gm_gapi.dll") );
- memset(&wc, 0, sizeof(WNDCLASS));
- wc.hInstance = hInst;
- wc.lpfnWndProc = GAPI_WindowProc;
- wc.lpszClassName = _T("GPAC GAPI Offscreen");
- RegisterClass (&wc);
-
- ctx->gl_hwnd = CreateWindow(_T("GPAC GAPI Offscreen"), _T("GPAC GAPI Offscreen"), WS_POPUP, 0, 0, 120, 100, NULL, NULL, hInst, NULL);
- if (!ctx->gl_hwnd) return;
- ShowWindow(ctx->gl_hwnd, SW_HIDE);
-
- dr->hw_caps |= GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;
- e = GAPI_SetupOGL_ES_Offscreen(dr, 20, 20);
-
- if (e!=GF_OK) {
- dr->hw_caps &= ~GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;
- e = GAPI_SetupOGL_ES_Offscreen(dr, 20, 20);
- }
- if (e==GF_OK) dr->hw_caps |= GF_VIDEO_HW_OPENGL_OFFSCREEN;
-#endif
-
-}
-
-void GAPI_ShutdownWindow(GF_VideoOutput *dr)
-{
- GAPIPriv *ctx = (GAPIPriv *)dr->opaque;
-
- if (ctx->owns_hwnd) {
- PostMessage(ctx->hWnd, WM_DESTROY, 0, 0);
- while (ctx->ThreadID) gf_sleep(10);
- UnregisterClass(_T("GPAC GAPI Output"), GetModuleHandle(_T("gapi.dll")));
- CloseHandle(ctx->hThread);
- ctx->hThread = NULL;
- } else if (ctx->orig_wnd_proc) {
- /*restore window proc*/
- SetWindowLong(ctx->hWnd, GWL_WNDPROC, ctx->orig_wnd_proc);
- ctx->orig_wnd_proc = 0L;
- }
- ctx->hWnd = NULL;
-#ifdef GPAC_USE_GLES1X
- PostMessage(ctx->gl_hwnd, WM_DESTROY, 0, 0);
- ctx->gl_hwnd = NULL;
- UnregisterClass(_T("GPAC GAPI Offscreen"), GetModuleHandle(_T("gm_gapi.dll") ));
-#endif
-
- the_video_driver = NULL;
-}
-
-
-GF_Err GAPI_Clear(GF_VideoOutput *dr, u32 color)
-{
- GAPICTX(dr);
- gctx->erase_dest = GF_TRUE;
- return GF_OK;
-}
-
-
-static void createPixmap(GAPIPriv *ctx, u32 pix_type)
-{
- const size_t bmiSize = sizeof(BITMAPINFO) + 256U*sizeof(RGBQUAD);
- BITMAPINFO* bmi;
- DWORD* p;
- u32 bpel = 0;
-
- if (ctx->bmi) gf_free(ctx->bmi);
-
- bmi = (BITMAPINFO*)gf_malloc(bmiSize);
- memset(bmi, 0, bmiSize);
-
- bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bmi->bmiHeader.biWidth = ctx->bb_width;
- bmi->bmiHeader.biHeight = -1 * (s32) ctx->bb_height; /*top-down image*/
- bmi->bmiHeader.biPlanes = (short)1;
- bmi->bmiHeader.biBitCount = (unsigned int) ctx->bits_per_pixel;
- bmi->bmiHeader.biCompression = BI_BITFIELDS;
- bmi->bmiHeader.biClrUsed = 3;
-
- p = (DWORD*)bmi->bmiColors;
- switch (ctx->pixel_format) {
- case GF_PIXEL_RGB_555:
- p[0] = 0x00007c00;
- p[1] = 0x000003e0;
- p[2] = 0x0000001f;
- bpel = 16;
- break;
- case GF_PIXEL_RGB_565:
- p[0] = 0x0000f800;
- p[1] = 0x000007e0;
- p[2] = 0x0000001f;
- bpel = 16;
- break;
- case GF_PIXEL_RGB_24:
- p[0] = 0x00ff0000;
- p[1] = 0x0000ff00;
- p[2] = 0x000000ff;
- bpel = 24;
- break;
- }
- ctx->hdc = GetDC(NULL/*ctx->hWnd*/);
-
- if (pix_type==2) {
-#ifdef GPAC_USE_GLES1X
- ctx->gl_bitmap = CreateDIBSection(ctx->hdc, bmi, DIB_RGB_COLORS, (void **) &ctx->gl_bits, NULL, 0);
-#endif
- } else if (pix_type==1) {
- ctx->hdcBitmap = CreateCompatibleDC(ctx->hdc);
- ctx->bitmap = CreateDIBSection(ctx->hdc, bmi, DIB_RGB_COLORS, (void **) &ctx->bits, NULL, 0);
- ctx->old_bitmap = (HBITMAP) SelectObject(ctx->hdcBitmap, ctx->bitmap);
- } else {
- ctx->hdcBitmap = CreateCompatibleDC(ctx->hdc);
- ctx->bitmap = CreateDIBSection(ctx->hdc, bmi, DIB_RGB_COLORS, (void **) &ctx->backbuffer, NULL, 0);
- ctx->old_bitmap = (HBITMAP) SelectObject(ctx->hdcBitmap, ctx->bitmap);
-
- /*watchout - win32 always create DWORD align memory, so align our pitch*/
- while ((ctx->bb_pitch % 4) != 0) ctx->bb_pitch ++;
- }
- ReleaseDC(NULL/*ctx->hWnd*/, ctx->hdc);
-
- ctx->bmi = bmi;
-// gf_free(bmi);
-}
-
-
-#ifdef GPAC_USE_GLES1X
-
-void GAPI_ReleaseOGL_ES(GAPIPriv *ctx, Bool offscreen_only)
-{
- if (ctx->egldpy) {
- eglMakeCurrent(ctx->egldpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-
- if (ctx->eglctx) eglDestroyContext(ctx->egldpy, ctx->eglctx);
- ctx->eglctx = 0;
- if (ctx->surface) eglDestroySurface(ctx->egldpy, ctx->surface);
- ctx->surface = 0;
- if (ctx->egldpy) eglTerminate(ctx->egldpy);
- ctx->egldpy = 0;
- }
- if (ctx->gl_bitmap) DeleteObject(ctx->gl_bitmap);
- ctx->gl_bitmap = NULL;
-
- if (offscreen_only) return;
-
- if (ctx->bitmap) DeleteObject(ctx->bitmap);
- ctx->bitmap = NULL;
-}
-
-GF_Err GAPI_SetupOGL_ES(GF_VideoOutput *dr)
-{
- EGLint n, maj, min;
- u32 i;
- GF_Event evt;
- GAPICTX(dr)
- static int atts[32];
- const char *opt;
-
- i=0;
- atts[i++] = EGL_RED_SIZE;
- atts[i++] = (gctx->pixel_format==GF_PIXEL_RGB_24) ? 8 : 5;
- atts[i++] = EGL_GREEN_SIZE;
- atts[i++] = (gctx->pixel_format==GF_PIXEL_RGB_24) ? 8 : (gctx->pixel_format==GF_PIXEL_RGB_565) ? 6 : 5;
- atts[i++] = EGL_BLUE_SIZE;
- atts[i++] = (gctx->pixel_format==GF_PIXEL_RGB_24) ? 8 : 5;
- opt = gf_opts_get_key("core", "gl-bits-depth");
- atts[i++] = EGL_DEPTH_SIZE;
- atts[i++] = opt ? atoi(opt) : 16;
- atts[i++] = EGL_SURFACE_TYPE;
-
-#ifdef GLES_NO_PIXMAP
- atts[i++] = EGL_WINDOW_BIT;
-#else
- atts[i++] = EGL_PIXMAP_BIT;
-// atts[i++] = gctx->fullscreen ? EGL_WINDOW_BIT : EGL_PIXMAP_BIT;
-#endif
- atts[i++] = EGL_ALPHA_SIZE;
- atts[i++] = EGL_DONT_CARE;
- atts[i++] = EGL_STENCIL_SIZE;
- atts[i++] = EGL_DONT_CARE;
- atts[i++] = EGL_NONE;
-
- /*whenever window is resized we must reinit OGL-ES*/
- GAPI_ReleaseOGL_ES(gctx, GF_FALSE);
-
- if (!gctx->fullscreen) {
- RECT rc;
- ::GetClientRect(gctx->hWnd, &rc);
- gctx->bb_width = rc.right-rc.left;
- gctx->bb_height = rc.bottom-rc.top;
-
-#ifndef GLES_NO_PIXMAP
- createPixmap(gctx, 1);
-#endif
- }
-
- gctx->egldpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- if (!gctx->egldpy) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[GAPI] Cannot get OpenGL display\n"));
- return GF_IO_ERR;
- }
- if (!eglInitialize(gctx->egldpy, &maj, &min)) {
- gctx->egldpy = NULL;
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[GAPI] Cannot initialize OpenGL layer\n"));
- return GF_IO_ERR;
- }
-
- if (!eglChooseConfig(gctx->egldpy, atts, &gctx->eglconfig, 1, &n) || (eglGetError() != EGL_SUCCESS)) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[GAPI] Cannot choose OpenGL config\n"));
- return GF_IO_ERR;
- }
-
- if (gctx->fullscreen
-#ifdef GLES_NO_PIXMAP
- || 1
-#endif
- ) {
- gctx->surface = eglCreateWindowSurface(gctx->egldpy, gctx->eglconfig, gctx->hWnd, 0);
- } else {
- gctx->surface = eglCreatePixmapSurface(gctx->egldpy, gctx->eglconfig, gctx->bitmap, 0);
- }
-
- if (!gctx->surface) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[GAPI] Cannot create OpenGL surface - error %d\n", eglGetError()));
- return GF_IO_ERR;
- }
- gctx->eglctx = eglCreateContext(gctx->egldpy, gctx->eglconfig, NULL, NULL);
- if (!gctx->eglctx) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[GAPI] Cannot create OpenGL context\n"));
- eglDestroySurface(gctx->egldpy, gctx->surface);
- gctx->surface = 0L;
- return GF_IO_ERR;
- }
- if (!eglMakeCurrent(gctx->egldpy, gctx->surface, gctx->surface, gctx->eglctx)) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[GAPI] Cannot bind OpenGL context\n"));
- eglDestroyContext(gctx->egldpy, gctx->eglctx);
- gctx->eglctx = 0L;
- eglDestroySurface(gctx->egldpy, gctx->surface);
- gctx->surface = 0L;
- return GF_IO_ERR;
- }
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[GAPI] OpenGL initialize - %d x %d \n", gctx->bb_width, gctx->bb_height));
- memset(&evt, 0, sizeof(GF_Event));
- evt.type = GF_EVENT_VIDEO_SETUP;
- evt.hw_reset = 1;
- dr->on_event(dr->evt_cbk_hdl, &evt);
- return GF_OK;
-}
-
-
-
-GF_Err GAPI_SetupOGL_ES_Offscreen(GF_VideoOutput *dr, u32 width, u32 height)
-{
- int atts[15];
- const char *opt;
- EGLint n, maj, min;
-
- GAPICTX(dr)
-
- GAPI_ReleaseOGL_ES(gctx, GF_TRUE);
-
- if (!gctx->use_pbuffer) {
- SetWindowPos(gctx->gl_hwnd, NULL, 0, 0, width, height, SWP_NOZORDER | SWP_NOMOVE);
- createPixmap(gctx, 2);
- }
-
- gctx->egldpy = eglGetDisplay(/*gctx->dpy*/EGL_DEFAULT_DISPLAY);
- if (!eglInitialize(gctx->egldpy, &maj, &min)) {
- gctx->egldpy = NULL;
- return GF_IO_ERR;
- }
- atts[0] = EGL_RED_SIZE;
- atts[1] = 8;
- atts[2] = EGL_GREEN_SIZE;
- atts[3] = 8;
- atts[4] = EGL_BLUE_SIZE;
- atts[5] = 8;
- atts[6] = EGL_ALPHA_SIZE;
- atts[7] = (dr->hw_caps & GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA) ? 8 : EGL_DONT_CARE;
- opt = gf_opts_get_key("core", "gl-bits-depth");
- atts[8] = EGL_DEPTH_SIZE;
- atts[9] = opt ? atoi(opt) : 16;
-
- atts[10] = EGL_STENCIL_SIZE;
- atts[11] = EGL_DONT_CARE;
- atts[12] = EGL_SURFACE_TYPE;
- atts[13] = gctx->use_pbuffer ? EGL_PBUFFER_BIT : EGL_PIXMAP_BIT;
- atts[14] = EGL_NONE;
-
- eglGetConfigs(gctx->egldpy, NULL, 0, &n);
- if (!eglChooseConfig(gctx->egldpy, atts, &gctx->eglconfig, 1, &n)) {
- return GF_IO_ERR;
- }
-
- if (!gctx->use_pbuffer) {
- gctx->surface = eglCreatePixmapSurface(gctx->egldpy, gctx->eglconfig, gctx->gl_bitmap, 0);
- } else {
- atts[0] = EGL_WIDTH;
- atts[1] = width;
- atts[2] = EGL_HEIGHT;
- atts[3] = height;
- atts[4] = EGL_NONE;
-
- gctx->surface = eglCreatePbufferSurface(gctx->egldpy, gctx->eglconfig, atts);
- }
-
- if (!gctx->surface) {
- return GF_IO_ERR;
- }
- gctx->eglctx = eglCreateContext(gctx->egldpy, gctx->eglconfig, NULL, NULL);
- if (!gctx->eglctx) {
- eglDestroySurface(gctx->egldpy, gctx->surface);
- gctx->surface = 0L;
- return GF_IO_ERR;
- }
- if (!eglMakeCurrent(gctx->egldpy, gctx->surface, gctx->surface, gctx->eglctx)) {
- eglDestroyContext(gctx->egldpy, gctx->eglctx);
- gctx->eglctx = 0L;
- eglDestroySurface(gctx->egldpy, gctx->surface);
- gctx->surface = 0L;
- return GF_IO_ERR;
- }
- return GF_OK;
-}
-
-#endif
-
-
-void GAPI_ReleaseObjects(GAPIPriv *ctx)
-{
- ctx->raw_ptr = NULL;
-
-#ifdef GPAC_USE_GLES1X
- if (ctx->output_3d_type) GAPI_ReleaseOGL_ES(ctx, GF_FALSE);
- else
-#endif
- if (ctx->bitmap) DeleteObject(ctx->bitmap);
- else if (ctx->backbuffer) gf_free(ctx->backbuffer);
- ctx->backbuffer = NULL;
- ctx->bitmap = NULL;
-
- if (ctx->hdcBitmap) {
- if (ctx->old_bitmap) SelectObject(ctx->hdcBitmap, ctx->old_bitmap);
- ctx->old_bitmap = NULL;
- DeleteDC(ctx->hdcBitmap);
- ctx->hdcBitmap = NULL;
- }
- if (ctx->hdc) ReleaseDC(NULL/*ctx->hWnd*/, ctx->hdc);
- ctx->hdc = NULL;
-}
-
-GF_Err GAPI_Setup(GF_VideoOutput *dr, void *os_handle, void *os_display, u32 noover)
-{
- struct GXDisplayProperties gx = GXGetDisplayProperties();
- RECT rc;
- GAPICTX(dr);
- gctx->hWnd = (HWND) os_handle;
-
- /*get keys in both 2D and 3D modes*/
- gctx->keys = GXGetDefaultKeys(GX_NORMALKEYS);
-
-#if 0
- /*FIXME - not supported in rasterizer*/
- if (gx.ffFormat & kfDirect444) {
- gctx->pixel_format = GF_PIXEL_RGB_444;
- gctx->BPP = 2;
- gctx->bitsPP = 12;
- }
- else
-#endif
- if (gx.ffFormat & kfDirect555) {
- gctx->pixel_format = GF_PIXEL_RGB_555;
- gctx->BPP = 2;
- gctx->bits_per_pixel = 15;
- }
- else if (gx.ffFormat & kfDirect565) {
- gctx->pixel_format = GF_PIXEL_RGB_565;
- gctx->BPP = 2;
- gctx->bits_per_pixel = 16;
- }
- else if (gx.ffFormat & kfDirect888) {
- gctx->pixel_format = GF_PIXEL_RGB_24;
- gctx->BPP = 3;
- gctx->bits_per_pixel = 24;
- } else {
- return GF_NOT_SUPPORTED;
- }
-
- GAPI_SetupWindow(dr);
- if (!gctx->hWnd) return GF_IO_ERR;
-
- /*setup GX*/
- if (!GXOpenDisplay(gctx->hWnd, 0L)) {
- MessageBox(NULL, _T("Cannot open display"), _T("GAPI Error"), MB_OK);
- return GF_IO_ERR;
- }
- GetClientRect(gctx->hWnd, &rc);
- gctx->backup_w = rc.right - rc.left;
- gctx->backup_h = rc.bottom - rc.top;
-
- return GAPI_InitBackBuffer(dr, gctx->backup_w, gctx->backup_h);
-}
-
-static void GAPI_Shutdown(GF_VideoOutput *dr)
-{
- GAPICTX(dr);
-
- gf_mx_p(gctx->mx);
- GAPI_ReleaseObjects(gctx);
-
- GXCloseDisplay();
- GAPI_ShutdownWindow(dr);
- gf_mx_v(gctx->mx);
-}
-
-static GF_Err GAPI_SetFullScreen(GF_VideoOutput *dr, Bool bOn, u32 *outWidth, u32 *outHeight)
-{
- Bool is_wide_scene = (bOn==2) ? GF_TRUE : GF_FALSE;
- GF_Err e;
- GAPICTX(dr);
-
- if (!gctx) return GF_BAD_PARAM;
- if (is_wide_scene) bOn = GF_TRUE;
- if (bOn == gctx->fullscreen) return GF_OK;
-
-#ifdef GPAC_USE_GLES1X
- if (gctx->output_3d_type==1) {
- gctx->fullscreen = bOn;
- return GAPI_SetupOGL_ES(dr);
- }
-#endif
-
- gf_mx_p(gctx->mx);
- GAPI_ReleaseObjects(gctx);
- GXCloseDisplay();
- e = GF_OK;
- if (bOn) {
- if (!GXOpenDisplay(GetParent(gctx->hWnd), 0L/*GX_FULLSCREEN*/)) {
- GXOpenDisplay(gctx->hWnd, 0L);
- gctx->fullscreen = GF_FALSE;
- e = GF_IO_ERR;
- } else {
- gctx->fullscreen = GF_TRUE;
- }
- } else {
- GXOpenDisplay(gctx->hWnd, 0L);
- gctx->fullscreen = GF_FALSE;
- }
-
- landscape = GF_FALSE;
- if (!e) {
- if (gctx->fullscreen) {
- gctx->backup_w = *outWidth;
- gctx->backup_h = *outHeight;
-
- if (is_wide_scene && (gctx->screen_w < gctx->screen_h)) landscape = GF_TRUE;
- else if (!is_wide_scene && (gctx->screen_w > gctx->screen_h)) landscape = GF_TRUE;
- else landscape = GF_FALSE;
-
- if (landscape) {
- gctx->fs_w = gctx->screen_h;
- gctx->fs_h = gctx->screen_w;
- } else {
- gctx->fs_w = gctx->screen_w;
- gctx->fs_h = gctx->screen_h;
- }
-
- *outWidth = gctx->fs_w;
- *outHeight = gctx->fs_h;
- } else {
- *outWidth = gctx->backup_w;
- *outHeight = gctx->backup_h;
- }
- }
- gf_mx_v(gctx->mx);
-
- return e;
-}
-
-GF_Err GAPI_ClearFS(GAPIPriv *gctx, unsigned char *ptr)
-{
- gf_mx_p(gctx->mx);
- memset(ptr, 0, sizeof(char) * gctx->screen_w*gctx->screen_h*gctx->BPP);
- gf_mx_v(gctx->mx);
- return GF_OK;
-}
-
-
-static GF_Err GAPI_FlipBackBuffer(GF_VideoOutput *dr)
-{
- GF_VideoSurface src, dst;
- unsigned char *ptr;
- GAPICTX(dr);
- if (!gctx || !gctx->gx_mode) return GF_BAD_PARAM;
-
- /*get a pointer to video memory*/
- if (gctx->gx_mode==1) {
- ptr = (unsigned char *) GXBeginDraw();
- } else {
- ptr = (unsigned char *) gctx->raw_ptr;
- }
- if (!ptr) return GF_IO_ERR;
-
- src.video_buffer = gctx->backbuffer;
- src.width = gctx->bb_width;
- src.height = gctx->bb_height;
- src.pitch_x = gctx->BPP;
- src.pitch_y = gctx->y_pitch;
- src.pixel_format = gctx->pixel_format;
- src.is_hardware_memory = GF_FALSE;
-
-
- dst.width = gctx->dst_blt.w;
- dst.height = gctx->dst_blt.h;
- dst.pixel_format = gctx->pixel_format;
- dst.is_hardware_memory = GF_TRUE;
- dst.video_buffer = (char*)ptr;
- dst.pitch_x = gctx->x_pitch;
- dst.pitch_y = gctx->y_pitch;
-
- if (gctx->fullscreen) {
- if (gctx->erase_dest) {
- gctx->erase_dest = GF_FALSE;
- GAPI_ClearFS(gctx, ptr);
- }
- } else {
- gctx->dst_blt.x += gctx->off_x;
- gctx->dst_blt.y += gctx->off_y;
- }
-
- /*apply x/y offset*/
- if (!gctx->fullscreen)
- dst.video_buffer += gctx->dst_blt.x * gctx->x_pitch + gctx->y_pitch * gctx->dst_blt.y;
-
- if (gctx->contiguous_mem) {
- memcpy(dst.video_buffer, src.video_buffer, src.width*gctx->BPP*src.height );
- } else if (landscape) {
- u32 y, lsize = dst.height*gctx->x_pitch;
- for (y=0; y<dst.width; y++) {
- char *s = src.video_buffer + y*gctx->y_pitch;
- char *d = dst.video_buffer + y*gctx->y_pitch;
- memcpy(d, s, lsize);
- }
- } else {
- u32 y, lsize = dst.width*gctx->x_pitch;
- for (y=0; y<dst.height; y++) {
- char *s = src.video_buffer + y*gctx->y_pitch;
- char *d = dst.video_buffer + y*gctx->y_pitch;
- memcpy(d, s, lsize);
- }
- }
-
- if (gctx->gx_mode==1) GXEndDraw();
- return GF_OK;
-}
-
-
-
-static GF_Err GAPI_Flush(GF_VideoOutput *dr, GF_Window *dest)
-{
- GF_Err e;
- GAPICTX(dr);
-
- if (!gctx) return GF_BAD_PARAM;
-
- gf_mx_p(gctx->mx);
-
-#ifdef GPAC_USE_GLES1X
- if (gctx->output_3d_type==1) {
-#ifndef GLES_NO_PIXMAP
- if (gctx->fullscreen && gctx->surface && gctx->egldpy) {
-#endif
- if (gctx->erase_dest) {
- InvalidateRect(gctx->hWnd, NULL, TRUE);
- gctx->erase_dest = GF_FALSE;
- }
- eglSwapBuffers(gctx->egldpy, gctx->surface);
-#ifndef GLES_NO_PIXMAP
- } else {
- InvalidateRect(gctx->hWnd, NULL, gctx->erase_dest);
- gctx->erase_dest = GF_FALSE;
- }
-#endif
- gf_mx_v(gctx->mx);
- return GF_OK;
- }
-#endif
- e = GF_OK;
- if (gctx->backbuffer) {
- if (dest) {
- gctx->dst_blt = *dest;
- } else {
- assert(0);
- gctx->dst_blt.x = gctx->dst_blt.y = 0;
- gctx->dst_blt.w = gctx->bb_width;
- gctx->dst_blt.h = gctx->bb_height;
- }
- if (gctx->gx_mode) {
- if (!gctx->fullscreen && gctx->erase_dest) {
- InvalidateRect(gctx->hWnd, NULL, TRUE);
- gctx->erase_dest = GF_FALSE;
- }
- e = GAPI_FlipBackBuffer(dr);
- } else {
-#ifndef DIRECT_BITBLT
- InvalidateRect(gctx->hWnd, NULL, gctx->erase_dest);
-#else
-// BitBlt(gctx->hdc, gctx->dst_blt.x, gctx->dst_blt.y, gctx->bb_width, gctx->bb_height, gctx->hdcBitmap, 0, 0, SRCCOPY);
- HDC dc = GetDC(NULL);
- BitBlt(dc, gctx->dst_blt.x, gctx->dst_blt.y, gctx->bb_width, gctx->bb_height, gctx->hdcBitmap, 0, 0, SRCCOPY);
- ReleaseDC(NULL, dc);
-#endif
- gctx->erase_dest = GF_FALSE;
- }
- }
- gf_mx_v(gctx->mx);
- return e;
-}
-
-u32 get_sys_col(int idx)
-{
- u32 res;
- DWORD val = GetSysColor(idx);
- res = (val)&0xFF;
- res<<=8;
- res |= (val>>8)&0xFF;
- res<<=8;
- res |= (val>>16)&0xFF;
- return res;
-}
-
-static GF_Err GAPI_ProcessEvent(GF_VideoOutput *dr, GF_Event *evt)
-{
- GAPICTX(dr);
- if (!evt) return GF_OK;
- switch (evt->type) {
- case GF_EVENT_SHOWHIDE:
- if (gctx->hWnd) ShowWindow(gctx->hWnd, evt->show.show_type ? SW_SHOW : SW_HIDE);
- break;
- case GF_EVENT_SIZE:
- /*nothing to do since we don't own the window*/
- break;
- case GF_EVENT_VIDEO_SETUP:
- switch (evt->setup.opengl_mode) {
- case 0:
-#ifdef GPAC_USE_GLES1X
- gctx->output_3d_type = 0;
-#endif
- return GAPI_InitBackBuffer(dr, evt->setup.width, evt->setup.height);
-#ifdef GPAC_USE_GLES1X
- case 1:
- gctx->output_3d_type = 1;
- return GAPI_SetupOGL_ES(the_video_driver);
- case 2:
- gctx->output_3d_type = 2;
- return GAPI_SetupOGL_ES_Offscreen(the_video_driver, evt->setup.width, evt->setup.height);
-#else
- default:
- return GF_NOT_SUPPORTED;
-#endif
- }
- case GF_EVENT_SYS_COLORS:
- evt->sys_cols.sys_colors[0] = get_sys_col(COLOR_ACTIVEBORDER);
- evt->sys_cols.sys_colors[1] = get_sys_col(COLOR_ACTIVECAPTION);
- evt->sys_cols.sys_colors[2] = get_sys_col(COLOR_APPWORKSPACE);
- evt->sys_cols.sys_colors[3] = get_sys_col(COLOR_BACKGROUND);
- evt->sys_cols.sys_colors[4] = get_sys_col(COLOR_BTNFACE);
- evt->sys_cols.sys_colors[5] = get_sys_col(COLOR_BTNHIGHLIGHT);
- evt->sys_cols.sys_colors[6] = get_sys_col(COLOR_BTNSHADOW);
- evt->sys_cols.sys_colors[7] = get_sys_col(COLOR_BTNTEXT);
- evt->sys_cols.sys_colors[8] = get_sys_col(COLOR_CAPTIONTEXT);
- evt->sys_cols.sys_colors[9] = get_sys_col(COLOR_GRAYTEXT);
- evt->sys_cols.sys_colors[10] = get_sys_col(COLOR_HIGHLIGHT);
- evt->sys_cols.sys_colors[11] = get_sys_col(COLOR_HIGHLIGHTTEXT);
- evt->sys_cols.sys_colors[12] = get_sys_col(COLOR_INACTIVEBORDER);
- evt->sys_cols.sys_colors[13] = get_sys_col(COLOR_INACTIVECAPTION);
- evt->sys_cols.sys_colors[14] = get_sys_col(COLOR_INACTIVECAPTIONTEXT);
- evt->sys_cols.sys_colors[15] = get_sys_col(COLOR_INFOBK);
- evt->sys_cols.sys_colors[16] = get_sys_col(COLOR_INFOTEXT);
- evt->sys_cols.sys_colors[17] = get_sys_col(COLOR_MENU);
- evt->sys_cols.sys_colors[18] = get_sys_col(COLOR_MENUTEXT);
- evt->sys_cols.sys_colors[19] = get_sys_col(COLOR_SCROLLBAR);
- evt->sys_cols.sys_colors[20] = get_sys_col(COLOR_3DDKSHADOW);
- evt->sys_cols.sys_colors[21] = get_sys_col(COLOR_3DFACE);
- evt->sys_cols.sys_colors[22] = get_sys_col(COLOR_3DHIGHLIGHT);
- evt->sys_cols.sys_colors[23] = get_sys_col(COLOR_3DLIGHT);
- evt->sys_cols.sys_colors[24] = get_sys_col(COLOR_3DSHADOW);
- evt->sys_cols.sys_colors[25] = get_sys_col(COLOR_WINDOW);
- evt->sys_cols.sys_colors[26] = get_sys_col(COLOR_WINDOWFRAME);
- evt->sys_cols.sys_colors[27] = get_sys_col(COLOR_WINDOWTEXT);
- return GF_OK;
- }
- return GF_OK;
-}
-
-#if 1
-
-
-
-#define ESC_QUERYESCSUPPORT 8
-#define GETGXINFO 0x00020000
-
-typedef struct GXDeviceInfo
-{
- long Version; //00
- void * pvFrameBuffer; //04
- unsigned long cbStride; //08
- unsigned long cxWidth; //0c
- unsigned long cyHeight; //10
- unsigned long cBPP; //14
- unsigned long ffFormat; //18
- char Unused[0x84-7*4];
-} GXDeviceInfo;
-
-
-static Bool check_resolution_switch(GF_VideoOutput *dr, u32 width, u32 height)
-{
- GAPICTX(dr);
-
- gctx->sys_w = GetSystemMetrics(SM_CXSCREEN);
- gctx->sys_h = GetSystemMetrics(SM_CYSCREEN);
- gctx->scale_coords = GF_FALSE;
- if (gctx->sys_w != width) gctx->scale_coords = GF_TRUE;
- else if (gctx->sys_h != height) gctx->scale_coords = GF_TRUE;
-
- if (gctx->scale_coords) {
- gctx->off_x = gctx->off_x * width / gctx->sys_w;
- gctx->off_y = gctx->off_y * height / gctx->sys_h;
- }
-
- HDC hdc = GetDC(gctx->hWnd);
- dr->dpi_x = (u32) (width * 25.4 / GetDeviceCaps(hdc, HORZSIZE) );
- dr->dpi_y = (u32) (height * 25.4 / GetDeviceCaps(hdc, VERTSIZE) );
- ReleaseDC(gctx->hWnd, hdc);
-
- if ((gctx->screen_w==width) && (gctx->screen_h==height)) return GF_FALSE;
-
- GF_Event evt;
- dr->max_screen_width = gctx->screen_w = width;
- dr->max_screen_height = gctx->screen_h = height;
- dr->max_screen_bpp = 8;//we don't filter for bpp less than 8
-
- evt.type = GF_EVENT_RESOLUTION;
- evt.size.width = dr->max_screen_width;
- evt.size.height = dr->max_screen_height;
- dr->on_event(the_video_driver->evt_cbk_hdl, &evt);
-
- return GF_TRUE;
-}
-
-#ifndef GETRAWFRAMEBUFFER
-#define GETRAWFRAMEBUFFER 0x00020001
-typedef struct _RawFrameBufferInfo
-{
- WORD wFormat;
- WORD wBPP;
- VOID *pFramePointer;
- int cxStride;
- int cyStride;
- int cxPixels;
- int cyPixels;
-} RawFrameBufferInfo;
-
-#define FORMAT_565 1
-#define FORMAT_555 2
-#define FORMAT_OTHER 3
-#endif
-
-static GF_Err gapi_get_raw_fb(GF_VideoOutput *dr)
-{
- long tmp;
- RawFrameBufferInfo Info;
- GAPICTX(dr);
- HDC DC = GetDC(NULL);
- memset(&Info,0,sizeof(RawFrameBufferInfo));
-
- ExtEscape(DC, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char*)&Info);
- if (!Info.pFramePointer /* && QueryPlatform(PLATFORM_VER) >= 421*/ )
- {
- //try gxinfo
- DWORD Code = GETGXINFO;
- if (ExtEscape(DC, ESC_QUERYESCSUPPORT, sizeof(DWORD), (char*)&Code, 0, NULL) > 0)
- {
- DWORD DCWidth = GetDeviceCaps(DC,HORZRES);
- DWORD DCHeight = GetDeviceCaps(DC,VERTRES);
- GXDeviceInfo GXInfo;
- memset(&GXInfo,0,sizeof(GXInfo));
- GXInfo.Version = 100;
- ExtEscape(DC, GETGXINFO, 0, NULL, sizeof(GXInfo), (char*)&GXInfo);
-
- // avoid VGA devices (or QVGA smartphones emulating 176x220)
- if (GXInfo.cbStride>0 && !(GXInfo.ffFormat & kfLandscape) &&
- ((DCWidth == GXInfo.cxWidth && DCHeight == GXInfo.cyHeight) ||
- (DCWidth == GXInfo.cyHeight && DCHeight == GXInfo.cxWidth)))
- {
- Bool Detect = GF_FALSE;
- int* p = (int*)GXInfo.pvFrameBuffer;
- COLORREF Old = GetPixel(DC,0,0);
- *p ^= -1;
- Detect = (Bool) ( GetPixel(DC,0,0) != Old );
- *p ^= -1;
-
- if (Detect)
- {
- Info.pFramePointer = GXInfo.pvFrameBuffer;
- Info.cxPixels = GXInfo.cxWidth;
- Info.cyPixels = GXInfo.cyHeight;
- Info.cxStride = GXInfo.cBPP/8;
- Info.cyStride = GXInfo.cbStride;
- Info.wBPP = (WORD)GXInfo.cBPP;
- Info.wFormat = (WORD)GXInfo.ffFormat;
- }
- }
- }
- }
-
- ReleaseDC(NULL,DC);
-
- if (!Info.pFramePointer) return GF_NOT_SUPPORTED;
-
- gctx->x_pitch = Info.cxStride;
- gctx->y_pitch = Info.cyStride;
-
- if (abs(Info.cyStride) < abs(Info.cxStride))
- {
- if (abs(Info.cxStride)*8 < Info.cyPixels*Info.wBPP &&
- abs(Info.cxStride)*8 >= Info.cxPixels*Info.wBPP) { //swapped resolution
- tmp = Info.cxPixels;
- Info.cxPixels = Info.cyPixels;
- Info.cyPixels = tmp;
- }
- }
- else
- {
- if (abs(Info.cyStride)*8 < Info.cxPixels*Info.wBPP &&
- abs(Info.cyStride)*8 >= Info.cyPixels*Info.wBPP) {//swapped resolution
- tmp = Info.cxPixels;
- Info.cxPixels = Info.cyPixels;
- Info.cyPixels = tmp;
- }
- }
-
- gctx->raw_ptr = (unsigned char *)Info.pFramePointer;
-
- if (Info.cxStride<0)
- gctx->raw_ptr += (Info.cxStride * (Info.cxPixels-1));
- if (Info.cyStride<0)
- gctx->raw_ptr += (Info.cyStride * (Info.cyPixels-1));
-
- if (check_resolution_switch(dr, Info.cxPixels, Info.cyPixels))
- return GF_EOS;
-
- return GF_OK;
-}
-
-#endif
-
-
-static GF_Err GAPI_InitBackBuffer(GF_VideoOutput *dr, u32 VideoWidth, u32 VideoHeight)
-{
- u32 gx_mode;
- GAPICTX(dr);
-
- if (!gctx || !VideoWidth || !VideoHeight) return GF_BAD_PARAM;
-
- gf_mx_p(gctx->mx);
-
- GAPI_ReleaseObjects(gctx);
-
- /*flip W&H in landscape mode*/
- if (landscape) {
- u32 t = VideoWidth;
- VideoWidth = VideoHeight;
- VideoHeight = t;
- }
-
- RECT rc;
- GetWindowRect(gctx->hWnd, &rc);
- gctx->off_x = rc.left;
- gctx->off_y = rc.top;
- gctx->erase_dest = GF_TRUE;
-
- const char *opt = gf_opts_get_key("core", "gapi-fbaccess");
- if (!opt || !strcmp(opt, "raw")) gx_mode = 2;
- else if (opt && !strcmp(opt, "gx")) gx_mode = 1;
- else gx_mode = 0;
-
- if ((gx_mode != gctx->gx_mode) || !gctx->screen_w) {
- struct GXDisplayProperties gx = GXGetDisplayProperties();
-
- gctx->x_pitch = gx.cbxPitch;
- gctx->y_pitch = gx.cbyPitch;
-
- gctx->gx_mode = gx_mode;
- if (gctx->gx_mode==2) {
- if (gapi_get_raw_fb(dr) == GF_EOS) {
- gf_mx_v(gctx->mx);
- return GF_OK;
- }
- } else if (check_resolution_switch(dr, gx.cxWidth, gx.cyHeight)) {
- gf_mx_v(gctx->mx);
- return GF_OK;
- }
- }
- if (gctx->gx_mode==2) {
- GF_Err e = gapi_get_raw_fb(dr);
- if (e) {
- gf_mx_v(gctx->mx);
- if (e==GF_EOS) return GF_OK;
- else return e;
- }
- }
-
-
- gctx->bb_size = VideoWidth * VideoHeight * gctx->BPP;
- gctx->bb_width = VideoWidth;
- gctx->bb_height = VideoHeight;
- gctx->bb_pitch = VideoWidth * gctx->BPP;
-
-
- if (gctx->gx_mode) {
- gctx->backbuffer = (char *) gf_malloc(sizeof(unsigned char) * gctx->bb_size);
-
- gctx->contiguous_mem = ((gctx->x_pitch==gctx->BPP) && (gctx->y_pitch==gctx->screen_w*gctx->BPP)) ? GF_TRUE : GF_FALSE;
- } else {
- createPixmap(gctx, 0);
- }
-
- gf_mx_v(gctx->mx);
- return GF_OK;
-}
-
-
-static void GAPI_AdjustLandscape(GAPIPriv *gctx, GF_VideoSurface *dst, s32 x_pitch, s32 y_pitch)
-{
- if (y_pitch>0) {
-#if 1
- dst->pitch_x = -y_pitch;
- /*start of frame-buffer is top-left corner*/
- if (x_pitch>0) {
- dst->video_buffer += dst->height * y_pitch;
- dst->pitch_y = x_pitch;
- }
- /*start of frame-buffer is top-right corner*/
- else {
- dst->video_buffer += dst->height * y_pitch + dst->width * x_pitch;
- dst->pitch_y = -x_pitch;
- }
-#else
- dst->pitch_x = y_pitch;
- /*start of frame-buffer is top-left corner*/
- if (x_pitch>0) {
- dst->video_buffer += y_pitch - x_pitch;
- dst->pitch_y = -x_pitch;
- }
- /*start of frame-buffer is top-right corner*/
- else {
- dst->video_buffer += dst->height * y_pitch + dst->width * x_pitch;
- dst->pitch_y = -x_pitch;
- }
-#endif
- } else {
- dst->pitch_x = y_pitch;
- /*start of frame-buffer is bottom-left corner*/
- if (x_pitch>0) {
- dst->pitch_y = x_pitch;
- }
- /*start of frame-buffer is bottom-right corner*/
- else {
- dst->video_buffer += dst->width * x_pitch;
- dst->pitch_y = x_pitch;
- }
- }
- u32 t = dst->width;
- dst->width = dst->height;
- dst->height = t;
-}
-
-static GF_Err GAPI_LockBackBuffer(GF_VideoOutput *dr, GF_VideoSurface *vi, Bool do_lock)
-{
- GAPICTX(dr);
-
- if (do_lock) {
- if (!vi) return GF_BAD_PARAM;
- memset(vi, 0, sizeof(GF_VideoSurface));
- vi->width = gctx->bb_width;
- vi->height = gctx->bb_height;
- vi->video_buffer = gctx->backbuffer;
- vi->pixel_format = gctx->pixel_format;
- vi->is_hardware_memory = GF_FALSE;
- vi->pitch_x = gctx->x_pitch;
- vi->pitch_y = gctx->y_pitch;
-
- if (landscape)
- GAPI_AdjustLandscape(gctx, vi, gctx->x_pitch, gctx->y_pitch);
- }
- return GF_OK;
-}
-
-
-static void *NewGAPIVideoOutput()
-{
- GAPIPriv *priv;
- GF_VideoOutput *driv = (GF_VideoOutput *) gf_malloc(sizeof(GF_VideoOutput));
- memset(driv, 0, sizeof(GF_VideoOutput));
- GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "GAPI Video Output", "gpac distribution")
-
- priv = (GAPIPriv *) gf_malloc(sizeof(GAPIPriv));
- memset(priv, 0, sizeof(GAPIPriv));
- priv->mx = gf_mx_new("GAPI");
- driv->opaque = priv;
-
-#ifdef GPAC_USE_GLES1X
- driv->hw_caps = GF_VIDEO_HW_OPENGL | GF_VIDEO_HW_OPENGL_OFFSCREEN | GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;
-#endif
- /*rgb, yuv to do*/
-
- driv->Setup = GAPI_Setup;
- driv->Shutdown = GAPI_Shutdown;
- driv->Flush = GAPI_Flush;
- driv->ProcessEvent = GAPI_ProcessEvent;
- driv->Blit = NULL;
- driv->LockBackBuffer = GAPI_LockBackBuffer;
- driv->SetFullScreen = GAPI_SetFullScreen;
- return (void *)driv;
-}
-
-static void DeleteVideoOutput(void *ifce)
-{
- GF_VideoOutput *driv = (GF_VideoOutput *) ifce;
- GAPICTX(driv);
- GAPI_Shutdown(driv);
- gf_mx_del(gctx->mx);
- gf_free(gctx);
- gf_free(driv);
-}
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*interface query*/
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_VIDEO_OUTPUT_INTERFACE,
- 0
- };
- return si;
-}
-
-/*interface create*/
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_VIDEO_OUTPUT_INTERFACE) return (GF_BaseInterface *) NewGAPIVideoOutput();
- return NULL;
-}
-
-/*interface destroy*/
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- GF_VideoOutput *dd = (GF_VideoOutput *)ifce;
- switch (dd->InterfaceType) {
- case GF_VIDEO_OUTPUT_INTERFACE:
- DeleteVideoOutput(dd);
- break;
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( gapi )
-
-#ifdef __cplusplus
-}
-#endif
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / DirectX audio and video render module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#ifndef _GAPI_H
-#define _GAPI_H
-
-#include <gpac/list.h>
-#include <gpac/thread.h>
-/*driver interface*/
-#include <gpac/modules/video_out.h>
-
-#ifdef GPAC_USE_GLES1X
-#include "GLES/egl.h"
-#endif
-
-/*driver interface*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct
-{
- HWND hWnd;
- DWORD orig_wnd_proc;
- GF_Mutex *mx;
-
- unsigned char *raw_ptr;
- Bool contiguous_mem;
-
- GXKeyList keys;
-
- u32 screen_w, screen_h;
- u32 fs_w, fs_h;
- /*store w and h for fullscreen*/
- u32 backup_w, backup_h;
- s32 x_pitch, y_pitch;
- Bool fullscreen;
- u32 gx_mode;
-
- u32 sys_w, sys_h;
- Bool scale_coords;
-
- /*main surface info*/
- char *backbuffer;
- u32 bb_size, bb_width, bb_height, bb_pitch;
- u32 pixel_format;
- u32 BPP, bits_per_pixel;
-
- GF_Window dst_blt;
- DWORD ThreadID;
- HANDLE hThread;
- Bool owns_hwnd;
-
- Bool erase_dest;
- u32 off_x, off_y;
-
- HBITMAP bitmap, old_bitmap;
- DWORD * bits;
- HDC hdcBitmap, hdc;
- BITMAPINFO* bmi;
-
-#ifdef GPAC_USE_GLES1X
- u32 output_3d_type;
- EGLDisplay egldpy;
- EGLSurface surface;
- EGLConfig eglconfig;
- EGLContext eglctx;
-
- HBITMAP gl_bitmap;
- DWORD *gl_bits;
- HWND gl_hwnd;
- Bool use_pbuffer;
-#endif
-
-} GAPIPriv;
-
-GF_Err GAPI_SetupOGL_ES_Offscreen(GF_VideoOutput *dr, u32 width, u32 height) ;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / GDIplus rasterizer module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "gdip_priv.h"
-#include <gpac/utf.h>
-
-
-
-#ifndef GDIP_MAX_STRING_SIZE
-#define GDIP_MAX_STRING_SIZE 5000
-#endif
-
-
-GF_Err gdip_init_font_engine(GF_FontReader *dr)
-{
- const char *sOpt;
- FontPriv *ctx = (FontPriv *)dr->udta;
-
- sOpt = gf_opts_get_key("FontCache", "FontSerif");
- strcpy(ctx->font_serif, sOpt ? sOpt : "Times New Roman");
- sOpt = gf_opts_get_key("FontCache", "FontSans");
- strcpy(ctx->font_sans, sOpt ? sOpt : "Arial");
- sOpt = gf_opts_get_key("FontCache", "FontFixed");
- strcpy(ctx->font_fixed, sOpt ? sOpt : "Courier New");
-
- return GF_OK;
-}
-GF_Err gdip_shutdown_font_engine(GF_FontReader *dr)
-{
- FontPriv *ctx = (FontPriv *)dr->udta;
-
- if (ctx->font) GdipDeleteFontFamily(ctx->font);
- ctx->font = NULL;
-
- /*nothing to do*/
- return GF_OK;
-}
-
-
-
-static GF_Err gdip_get_glyphs(GF_FontReader *dr, const char *utf_string, u32 *glyph_buffer, u32 *io_glyph_buffer_size, const char *xml_lang, Bool *is_rtl)
-{
- size_t _len;
- u32 len;
- u32 i;
- u16 *conv;
- char *utf8 = (char*) utf_string;
- FontPriv *priv = (FontPriv*)dr->udta;
-
- len = utf_string ? (u32) strlen(utf_string) : 0;
- if (!len) {
- *io_glyph_buffer_size = 0;
- return GF_OK;
- }
- if (*io_glyph_buffer_size < len+1) {
- *io_glyph_buffer_size = len+1;
- return GF_BUFFER_TOO_SMALL;
- }
- _len = gf_utf8_mbstowcs((u16*) glyph_buffer, *io_glyph_buffer_size, (const char **) &utf8);
- if (_len==(size_t)-1) return GF_IO_ERR;
- len = (u32) _len;
- if (utf8) return GF_IO_ERR;
-
- /*perform bidi relayout*/
- conv = (u16*) glyph_buffer;
- *is_rtl = gf_utf8_reorder_bidi(conv, len);
- /*move 16bit buffer to 32bit*/
- for (i=len; i>0; i--) {
- glyph_buffer[i-1] = (u32) conv[i-1];
- }
- *io_glyph_buffer_size = (u32) len;
- return GF_OK;
-}
-
-
-static void adjust_white_space(const unsigned short *string, Float *width, Float whiteSpaceWidth)
-{
- u32 len , i=0;
- while (string[i] == (unsigned short) ' ') {
- *width += whiteSpaceWidth;
- i++;
- }
- if (whiteSpaceWidth<0) return;
- len = (u32) gf_utf8_wcslen(string);
- if (i != len) {
- i = len - 1;
- while (string[i] == (unsigned short) ' ') {
- *width += whiteSpaceWidth;
- i--;
- }
- }
-}
-
-static GF_Err gdip_get_text_size(GF_FontReader *dr, const unsigned short *string, Fixed *width, Fixed *height)
-{
- GpPath *path_tmp;
- GpStringFormat *fmt;
- FontPriv *ctx = (FontPriv *)dr->udta;
- *width = *height = 0;
- if (!ctx->font) return GF_BAD_PARAM;
-
- GdipCreateStringFormat(StringFormatFlagsNoWrap, LANG_NEUTRAL, &fmt);
- GdipCreatePath(FillModeAlternate, &path_tmp);
- RectF rc;
- rc.X = rc.Y = 0;
- rc.Width = rc.Height = 0;
- GdipAddPathString(path_tmp, (const WCHAR *)string, -1, ctx->font, ctx->font_style, ctx->em_size, &rc, fmt);
-
- GdipGetPathWorldBounds(path_tmp, &rc, NULL, NULL);
-
- adjust_white_space(string, &rc.Width, ctx->whitespace_width);
- *width = FLT2FIX(rc.Width);
- *height = FLT2FIX(rc.Height);
-
- GdipDeleteStringFormat(fmt);
- GdipDeletePath(path_tmp);
-
- return GF_OK;
-}
-
-static GF_Err gdip_set_font(GF_FontReader *dr, const char *fontName, u32 styles)
-{
- WCHAR wcFontName[GDIP_MAX_STRING_SIZE];
- FontPriv *ctx = (FontPriv *)dr->udta;
-
- if (ctx->font) GdipDeleteFontFamily(ctx->font);
- ctx->font = NULL;
-
- if (fontName && strlen(fontName) >= GDIP_MAX_STRING_SIZE) fontName = NULL;
-
- if (!fontName || !strlen(fontName) ) fontName = ctx->font_serif;
- else if (!stricmp(fontName, "SANS") || !stricmp(fontName, "sans-serif")) fontName = ctx->font_sans;
- else if (!stricmp(fontName, "SERIF")) fontName = ctx->font_serif;
- else if (!stricmp(fontName, "TYPEWRITER") || !stricmp(fontName, "monospace")) fontName = ctx->font_fixed;
-
- MultiByteToWideChar(CP_ACP, 0, fontName, (u32)strlen(fontName)+1,
- wcFontName, sizeof(wcFontName)/sizeof(wcFontName[0]) );
-
-
- GdipCreateFontFamilyFromName(wcFontName, NULL, &ctx->font);
- if (!ctx->font) return GF_NOT_SUPPORTED;
-
- //setup styles
- ctx->font_style = 0;
- if (styles & GF_FONT_WEIGHT_BOLD ) ctx->font_style |= FontStyleBold;
- if (styles & GF_FONT_ITALIC) ctx->font_style |= FontStyleItalic;
-
- if (styles & GF_FONT_UNDERLINED) ctx->font_style |= FontStyleUnderline;
- if (styles & GF_FONT_STRIKEOUT) ctx->font_style |= FontStyleStrikeout;
- return GF_OK;
-}
-
-static GF_Err gdip_get_font_info(GF_FontReader *dr, char **font_name, u32 *em_size, s32 *ascent, s32 *descent, s32 *underline, s32 *line_spacing, s32 *max_advance_h, s32 *max_advance_v)
-{
- UINT16 val, em;
- FontPriv *ctx = (FontPriv *)dr->udta;
-
- *font_name = NULL;
- *em_size = *ascent = *descent = *line_spacing = *max_advance_h = *max_advance_v = 0;
- if (!ctx->font) return GF_BAD_PARAM;
-
- GdipGetEmHeight(ctx->font, ctx->font_style, &em);
- *em_size = (s32) em;
- GdipGetCellAscent(ctx->font, ctx->font_style, &val);
- ctx->ascent = (Float) val;
- *ascent = (s32) val;
- GdipGetCellDescent(ctx->font, ctx->font_style, &val);
- *descent = (s32) val;
- *descent *= -1;
- ctx->descent = -1 * (Float) val;
- *underline = *descent / 2;
- GdipGetLineSpacing(ctx->font, ctx->font_style, &val);
- *line_spacing = (s32) val;
- *max_advance_v = *ascent - *descent;
-
-
- unsigned short test_str[4];
- Fixed w, h, w2;
- ctx->em_size = (Float) *em_size;
- test_str[0] = (unsigned short) '_';
- test_str[1] = (unsigned short) '\0';
- gdip_get_text_size(dr, test_str, &w, &h);
- ctx->underscore_width = FIX2FLT(w);
-
- test_str[0] = (unsigned short) '_';
- test_str[1] = (unsigned short) ' ';
- test_str[2] = (unsigned short) '_';
- test_str[3] = (unsigned short) '\0';
- gdip_get_text_size(dr, test_str, &w2, &h);
- ctx->whitespace_width = FIX2FLT(w2 - 2*w);
-
- *max_advance_h = (s32) MAX(ctx->underscore_width, ctx->whitespace_width);
- return GF_OK;
-}
-
-
-
-static GF_Glyph *gdip_load_glyph(GF_FontReader *dr, u32 glyph_name)
-{
- GF_Rect bounds;
- GF_Glyph *glyph;
- GpPath *path_tmp;
- GpStringFormat *fmt;
- GpMatrix *mat;
- Float est_advance_h;
- unsigned short str[4];
- int i;
- FontPriv *ctx = (FontPriv *)dr->udta;
-
- if (!ctx->font) return NULL;
-
- RectF rc;
- rc.X = rc.Y = 0;
- rc.Width = rc.Height = 0;
-
- GdipCreateStringFormat(StringFormatFlagsNoWrap | StringFormatFlagsNoFitBlackBox | StringFormatFlagsMeasureTrailingSpaces, LANG_NEUTRAL, &fmt);
- GdipSetStringFormatAlign(fmt, StringAlignmentNear);
- GdipCreatePath(FillModeAlternate, &path_tmp);
-
- if (glyph_name==0x20) {
- est_advance_h = ctx->whitespace_width;
- } else {
- /*to compute first glyph alignment (say 'x', we figure out its bounding full box by using the '_' char as wrapper (eg, "_x_")
- then the bounding box starting from xMin of the glyph ('x_'). The difference between both will give us a good approx
- of the glyph alignment*/
- str[0] = glyph_name;
- str[1] = (unsigned short) '_';
- str[2] = (unsigned short) 0;
- GdipAddPathString(path_tmp, (const WCHAR *)str, -1, ctx->font, ctx->font_style, ctx->em_size, &rc, fmt);
- GdipGetPathWorldBounds(path_tmp, &rc, NULL, NULL);
- est_advance_h = rc.Width - ctx->underscore_width;
- }
-
- GdipResetPath(path_tmp);
-
- str[0] = glyph_name;
- str[1] = (unsigned short) 0;
- rc.X = rc.Y = 0;
- rc.Width = rc.Height = 0;
- GdipAddPathString(path_tmp, (const WCHAR *)str, -1, ctx->font, ctx->font_style, ctx->em_size, &rc, fmt);
-
- GdipGetPathWorldBounds(path_tmp, &rc, NULL, NULL);
-
- /*flip so that we are in a font coordinate system - also move back the glyph to x=0 and y=baseline, GdiPlus doesn't do so*/
- GdipCreateMatrix(&mat);
- GdipTranslateMatrix(mat, - rc.X, -ctx->ascent, MatrixOrderAppend);
- GdipScaleMatrix(mat, 1, -1, MatrixOrderAppend);
- GdipTransformPath(path_tmp, mat);
- GdipDeleteMatrix(mat);
-
-
- /*start enum*/
- s32 count;
- GdipGetPointCount(path_tmp, &count);
- GpPointF *pts = new GpPointF[count];
- BYTE *types = new BYTE[count];
- GdipGetPathTypes(path_tmp, types, count);
- GdipGetPathPoints(path_tmp, pts, count);
-
- GF_SAFEALLOC(glyph, GF_Glyph);
- GF_SAFEALLOC(glyph->path, GF_Path);
-
- for (i=0; i<count; ) {
- BOOL closed = 0;
- s32 sub_type;
-
- sub_type = types[i] & PathPointTypePathTypeMask;
-
- if (sub_type == PathPointTypeStart) {
- gf_path_add_move_to(glyph->path, FLT2FIX(pts[i].X), FLT2FIX(pts[i].Y));
- i++;
- }
- else if (sub_type == PathPointTypeLine) {
- gf_path_add_line_to(glyph->path, FLT2FIX(pts[i].X), FLT2FIX(pts[i].Y));
-
- if (types[i] & PathPointTypeCloseSubpath) gf_path_close(glyph->path);
-
- i++;
- }
- else if (sub_type == PathPointTypeBezier) {
- assert(i+2<=count);
- gf_path_add_cubic_to(glyph->path, FLT2FIX(pts[i].X), FLT2FIX(pts[i].Y), FLT2FIX(pts[i+1].X), FLT2FIX(pts[i+1].Y), FLT2FIX(pts[i+2].X), FLT2FIX(pts[i+2].Y));
-
- if (types[i+2] & PathPointTypeCloseSubpath) gf_path_close(glyph->path);
-
- i += 3;
- } else {
- assert(0);
- break;
- }
- }
-
- delete [] pts;
- delete [] types;
- GdipDeleteStringFormat(fmt);
- GdipDeletePath(path_tmp);
-
- glyph->ID = glyph_name;
- glyph->utf_name = glyph_name;
- glyph->vert_advance = (s32) (ctx->ascent-ctx->descent);
- glyph->horiz_advance = (s32) est_advance_h;
- gf_path_get_bounds(glyph->path, &bounds);
- glyph->width = FIX2INT(bounds.width);
- glyph->height = FIX2INT(bounds.height);
- return glyph;
-}
-
-
-
-
-GF_FontReader *gdip_new_font_driver()
-{
- GdiplusStartupInput startupInput;
- GF_FontReader *dr;
- FontPriv *ctx;
-
- SAFEALLOC(ctx, FontPriv);
- SAFEALLOC(dr, GF_FontReader);
- GdiplusStartup(&ctx->gdiToken, &startupInput, NULL);
-
- GF_REGISTER_MODULE_INTERFACE(dr, GF_FONT_READER_INTERFACE, "GDIplus Font Reader", "gpac distribution")
- dr->init_font_engine = gdip_init_font_engine;
- dr->shutdown_font_engine = gdip_shutdown_font_engine;
- dr->set_font = gdip_set_font;
- dr->get_font_info = gdip_get_font_info;
- dr->get_glyphs = gdip_get_glyphs;
- dr->load_glyph = gdip_load_glyph;
-
- dr->udta = ctx;
- return dr;
-}
-
-void gdip_delete_font_driver(GF_FontReader *dr)
-{
- FontPriv *ctx = (FontPriv *)dr->udta;
- GdiplusShutdown(ctx->gdiToken);
-
- if (ctx->font) GdipDeleteFontFamily(ctx->font);
- ctx->font = NULL;
-
- gf_free(dr->udta);
- gf_free(dr);
-}
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_FONT_READER_INTERFACE,
- GF_RASTER_2D_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType==GF_FONT_READER_INTERFACE) return (GF_BaseInterface *)gdip_new_font_driver();
- if (InterfaceType==GF_RASTER_2D_INTERFACE) return (GF_BaseInterface *)gdip_LoadRenderer();
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- switch (ifce->InterfaceType) {
- case GF_FONT_READER_INTERFACE:
- gdip_delete_font_driver((GF_FontReader *)ifce);
- break;
- case GF_RASTER_2D_INTERFACE:
- gdip_ShutdownRenderer((GF_Raster2D *)ifce);
- break;
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( gdiplus )
-
-#ifdef __cplusplus
-}
-#endif
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / GDIplus rasterizer module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "gdip_priv.h"
-
-
-GF_STENCIL gdip_new_stencil(GF_Raster2D *, GF_StencilType type)
-{
- struct _stencil *sten;
-
- switch (type) {
- case GF_STENCIL_SOLID:
- case GF_STENCIL_LINEAR_GRADIENT:
- case GF_STENCIL_RADIAL_GRADIENT:
- case GF_STENCIL_VERTEX_GRADIENT:
- case GF_STENCIL_TEXTURE:
- break;
- default:
- return NULL;
- }
- SAFEALLOC(sten, struct _stencil);
- sten->type = type;
- sten->alpha = 255;
- return (GF_STENCIL) sten;
-}
-
-static
-void gdip_delete_stencil(GF_STENCIL _this)
-{
- GPSTEN();
- if (_sten->pSolid) GdipDeleteBrush(_sten->pSolid);
- if (_sten->pTexture) GdipDeleteBrush(_sten->pTexture);
- if (_sten->pLinear) GdipDeleteBrush(_sten->pLinear);
- if (_sten->pRadial) GdipDeleteBrush(_sten->pRadial);
- if (_sten->circle) GdipDeletePath(_sten->circle);
- if (_sten->pMat) GdipDeleteMatrix(_sten->pMat);
- if (_sten->pLinearMat) GdipDeleteMatrix(_sten->pLinearMat);
- if (_sten->pBitmap) GdipDisposeImage(_sten->pBitmap);
- if (_sten->conv_buf) gf_free(_sten->conv_buf);
-
- if (_sten->cols) delete [] _sten->cols;
- if (_sten->pos) delete [] _sten->pos;
-
- gf_free(_sten);
-}
-static
-GF_Err gdip_stencil_set_matrix(GF_STENCIL _this, GF_Matrix2D *mat)
-{
- GPSTEN();
- GPMATRIX();
- if (_sten->pMat) GdipDeleteMatrix(_sten->pMat);
- _sten->pMat = _mat;
- return GF_OK;
-}
-
-static
-GF_Err gdip_set_brush_color(GF_STENCIL _this, GF_Color c)
-{
- GPSTEN();
- CHECK_RET(GF_STENCIL_SOLID);
- if (!_sten->pSolid)
- GdipCreateSolidFill(c, &_sten->pSolid);
- else
- GdipSetSolidFillColor(_sten->pSolid, c);
-
- return GF_OK;
-}
-
-
-static
-GF_Err gdip_set_gradient_mode(GF_STENCIL _this, GF_GradientMode mode)
-{
- GPSTEN();
- CHECK2_RET(GF_STENCIL_LINEAR_GRADIENT, GF_STENCIL_RADIAL_GRADIENT);
- _sten->spread = mode;
- _sten->needs_rebuild = GF_TRUE;
- return GF_OK;
-}
-
-static
-GF_Err gdip_set_linear_gradient (GF_STENCIL _this, Fixed start_x, Fixed start_y, Fixed end_x, Fixed end_y)
-{
- GPSTEN();
- CHECK_RET(GF_STENCIL_LINEAR_GRADIENT);
- if (_sten->pLinear) GdipDeleteBrush(_sten->pLinear);
-
- _sten->start.X = FIX2FLT(start_x);
- _sten->start.Y = FIX2FLT(start_y);
- _sten->end.X = FIX2FLT(end_x);
- _sten->end.Y = FIX2FLT(end_y);
-
- GdipCreateLineBrush(&_sten->start, &_sten->end, 0xFF000000, 0xFFFFFFFF, WrapModeTile, &_sten->pLinear);
- if (!_sten->pLinearMat) GdipCreateMatrix(&_sten->pLinearMat);
- GdipGetLineTransform(_sten->pLinear, _sten->pLinearMat);
- _sten->needs_rebuild = GF_TRUE;
- return GF_OK;
-}
-
-void gdip_recompute_line_gradient(GF_STENCIL _this)
-{
- GpPointF start, end;
- u32 i, k;
- REAL w, h;
- GPSTEN();
-
- if (!_sten->needs_rebuild) return;
- _sten->needs_rebuild = GF_FALSE;
-
- if (_sten->pLinear) GdipDeleteBrush(_sten->pLinear);
- GdipCreateLineBrush(&_sten->start, &_sten->end, 0xFFFF0000, 0xFFFF00FF, WrapModeTile, &_sten->pLinear);
- switch (_sten->spread) {
- case GF_GRADIENT_MODE_PAD:
- break;
- case GF_GRADIENT_MODE_SPREAD:
- GdipSetLineWrapMode(_sten->pLinear, WrapModeTileFlipXY);
- GdipSetLinePresetBlend(_sten->pLinear, (ARGB *) _sten->cols, _sten->pos, _sten->num_pos);
- return;
- case GF_GRADIENT_MODE_REPEAT:
- GdipSetLineWrapMode(_sten->pLinear, WrapModeTile);
- GdipSetLinePresetBlend(_sten->pLinear, (ARGB *) _sten->cols, _sten->pos, _sten->num_pos);
- return;
- }
- /*currently gdiplus doesn't support padded mode on gradients, so update the line gradient by
- using a line 3 times longer*/
- w = _sten->end.X - _sten->start.X;
- h = _sten->end.Y - _sten->start.Y;
- start.X = _sten->start.X - w;
- start.Y = _sten->start.Y - h;
- end.X = _sten->end.X + w;
- end.Y = _sten->end.Y + h;
- GdipCreateLineBrush(&start, &end, 0xFFFF0000, 0xFFFF00FF, WrapModeTile, &_sten->pLinear);
- ARGB *cols = new ARGB[_sten->num_pos+2];
- REAL *pos = new REAL[_sten->num_pos+2];
-
- k=0;
- for (i=0; i<_sten->num_pos; i++) {
- cols[i+k] = _sten->cols[i];
- pos[i+k] = (1 + _sten->pos[i])/3;
-
- if (!i) {
- pos[1] = pos[0];
- cols[1] = cols[0];
- k=1;
- pos[0] = 0;
- }
- }
- pos[_sten->num_pos+1] = 1.0;
- cols[_sten->num_pos+1] = cols[_sten->num_pos];
-
- /*since depending on gradient transform the padding is likely to be not big enough, use flipXY to assure that in most
- cases the x3 dilatation is enough*/
- GdipSetLineWrapMode(_sten->pLinear, WrapModeTileFlipXY);
- GdipSetLinePresetBlend(_sten->pLinear, cols, pos, 2+_sten->num_pos);
-
- delete [] cols;
- delete [] pos;
-}
-
-
-/*GDIplus is completely bugged here, we MUST build the gradient in local coord system and apply translation
-after, otherwise performances are just horrible*/
-void gdip_recompute_radial_gradient(GF_STENCIL _this)
-{
- s32 repeat, k;
- u32 i;
- GpPointF pt;
- GpMatrix *mat;
- GPSTEN();
-
-
- if (!_sten->needs_rebuild) return;
- _sten->needs_rebuild = GF_FALSE;
-
-
- if (_sten->pRadial) {
- GdipDeleteBrush(_sten->pRadial);
- _sten->pRadial = NULL;
- }
- if (_sten->pSolid) {
- GdipDeleteBrush(_sten->pSolid);
- _sten->pSolid = NULL;
- }
- if (_sten->circle) {
- GdipDeletePath(_sten->circle);
- _sten->circle = NULL;
- }
-
- GdipCreatePath(FillModeAlternate, &_sten->circle);
- /*get number of repeats*/
- if (_sten->spread == GF_GRADIENT_MODE_PAD) {
-
-
- GdipAddPathEllipse(_sten->circle, - _sten->radius.X, -_sten->radius.Y,
- 2*_sten->radius.X, 2*_sten->radius.Y);
-
- GdipCreatePathGradientFromPath(_sten->circle, &_sten->pRadial);
-
- ARGB *blends = new ARGB[_sten->num_pos + 1];
-
- /*radial blend pos are from bounds to center in gdiplus*/
- blends[0] = _sten->cols[_sten->num_pos - 1];
- for (i=0; i<_sten->num_pos; i++) {
- blends[i+1] = _sten->cols[_sten->num_pos - i - 1];
- }
-
- REAL *pos = new REAL[_sten->num_pos + 1];
- pos[0] = 0;
- for (i=0; i<_sten->num_pos; i++) {
- pos[i+1] = _sten->pos[i];
- }
-
- GdipSetPathGradientPresetBlend(_sten->pRadial, blends, pos, _sten->num_pos + 1);
- delete [] blends;
- delete [] pos;
-
- /*set focal*/
- pt = _sten->focal;
- pt.X -= _sten->center.X;
- pt.Y -= _sten->center.Y;
- GdipSetPathGradientCenterPoint(_sten->pRadial, &pt);
-
- /*set transform*/
- GdipCreateMatrix(&mat);
- GdipTranslateMatrix(mat, _sten->center.X, _sten->center.Y, MatrixOrderAppend);
- if (_sten->pMat) GdipMultiplyMatrix(mat, _sten->pMat, MatrixOrderAppend);
- GdipSetTextureTransform((GpTexture*)_sten->pRadial, mat);
- GdipDeleteMatrix(mat);
-
- /*create back brush*/
- GdipCreateSolidFill(_sten->cols[_sten->num_pos - 1], &_sten->pSolid);
- GdipResetPath(_sten->circle);
- GdipAddPathEllipse(_sten->circle, - _sten->radius.X + _sten->center.X, -_sten->radius.Y + _sten->center.Y,
- 2*_sten->radius.X, 2*_sten->radius.Y);
-
- } else {
- repeat = 10;
-
- GdipAddPathEllipse(_sten->circle, - repeat * _sten->radius.X, - repeat*_sten->radius.Y,
- 2*repeat*_sten->radius.X, 2*repeat*_sten->radius.Y);
-
- GdipCreatePathGradientFromPath(_sten->circle, &_sten->pRadial);
- GdipDeletePath(_sten->circle);
- _sten->circle = NULL;
-
- ARGB *blends = new ARGB[_sten->num_pos*repeat];
- REAL *pos = new REAL[_sten->num_pos*repeat];
-
- if (_sten->spread == GF_GRADIENT_MODE_REPEAT) {
- for (k=0; k<repeat; k++) {
- for (i=0; i<_sten->num_pos; i++) {
- blends[k*_sten->num_pos + i] = _sten->cols[_sten->num_pos - i - 1];
- pos[k*_sten->num_pos + i] = (k + _sten->pos[i]) / repeat;
- }
- }
- } else {
- for (k=0; k<repeat; k++) {
- for (i=0; i<_sten->num_pos; i++) {
- u32 index = (k%2) ? (_sten->num_pos-i-1) : i;
- blends[k*_sten->num_pos + i] = _sten->cols[index];
- if (k%2) {
- pos[k*_sten->num_pos + i] = (k + (1 - _sten->pos[index]) ) / repeat;
- } else {
- pos[k*_sten->num_pos + i] = ( k + _sten->pos[i] ) / repeat;
- }
- }
- }
- }
- GdipSetPathGradientPresetBlend(_sten->pRadial, blends, pos, _sten->num_pos*repeat);
- delete [] pos;
- delete [] blends;
-
-
- /*set focal*/
- pt = _sten->focal;
- pt.X -= (1 - repeat) * (_sten->focal.X - _sten->center.X) + _sten->center.X;
- pt.Y -= (1 - repeat) * (_sten->focal.Y - _sten->center.Y) + _sten->center.Y;
- GdipSetPathGradientCenterPoint(_sten->pRadial, &pt);
-
- /*set transform*/
- GdipCreateMatrix(&mat);
- GdipTranslateMatrix(mat, (1 - repeat) * (_sten->focal.X - _sten->center.X) + _sten->center.X,
- (1 - repeat) * (_sten->focal.Y - _sten->center.Y) + _sten->center.Y,
- MatrixOrderAppend);
- if (_sten->pMat) GdipMultiplyMatrix(mat, _sten->pMat, MatrixOrderAppend);
- GdipSetTextureTransform((GpTexture*)_sten->pRadial, mat);
- GdipDeleteMatrix(mat);
-
- GdipSetPathGradientWrapMode(_sten->pRadial, WrapModeTileFlipXY);
- }
-}
-
-static
-GF_Err gdip_set_radial_gradient(GF_STENCIL _this, Fixed cx, Fixed cy, Fixed fx, Fixed fy, Fixed x_radius, Fixed y_radius)
-{
- GPSTEN();
- CHECK_RET(GF_STENCIL_RADIAL_GRADIENT);
-
- /*store focal info*/
- _sten->radius.X = FIX2FLT(x_radius);
- _sten->radius.Y = FIX2FLT(y_radius);
- _sten->center.X = FIX2FLT(cx);
- _sten->center.Y = FIX2FLT(cy);
- _sten->focal.X = FIX2FLT(fx);
- _sten->focal.Y = FIX2FLT(fy);
- _sten->needs_rebuild = GF_TRUE;
- return GF_OK;
-}
-
-static
-GF_Err gdip_set_gradient_interpolation(GF_STENCIL _this, Fixed *pos, GF_Color *col, u32 count)
-{
- u32 i;
- GPSTEN();
-
- if (_sten->cols) delete [] _sten->cols;
- if (_sten->pos) delete [] _sten->pos;
-
- /*handle padding internally*/
- _sten->cols = new ARGB[count];
- _sten->pos = new REAL[count];
- for (i=0; i<count; i++) _sten->pos[i] = FIX2FLT(pos[i]);
- memcpy(_sten->cols, col, sizeof(ARGB)*count);
- _sten->num_pos = count;
- _sten->needs_rebuild = GF_TRUE;
- return GF_OK;
-}
-
-
-static
-GF_Err gdip_set_vertex_path(GF_STENCIL _this, GF_Path *path)
-{
- GPSTEN();
- GpPath *p;
- CHECK_RET(GF_STENCIL_VERTEX_GRADIENT);
- p = gdip_create_path(path);
- if (_sten->pRadial) GdipDeleteBrush(_sten->pRadial);
- GdipCreatePathGradientFromPath(p, &_sten->pRadial);
- GdipDeletePath(p);
- return GF_OK;
-}
-
-static
-GF_Err gdip_set_vertex_center (GF_STENCIL _this, Fixed cx, Fixed cy, u32 color)
-{
- GpStatus ret;
- GPSTEN();
- CHECK_RET(GF_STENCIL_VERTEX_GRADIENT);
-
- if (!_sten->pRadial) return GF_BAD_PARAM;
- _sten->center.X = FIX2FLT(cx);
- _sten->center.Y = FIX2FLT(cy);
-
- ret = GdipSetPathGradientCenterPoint(_sten->pRadial, &_sten->center);
- ret = GdipSetPathGradientCenterColor(_sten->pRadial, (ARGB) color);
- return GF_OK;
-}
-
-static
-GF_Err gdip_set_vertex_colors (GF_STENCIL _this, u32 *colors, u32 nbCol)
-{
- int col = nbCol;
- GPSTEN();
- CHECK_RET(GF_STENCIL_VERTEX_GRADIENT);
-
- GpStatus ret;
- if (!_sten->pRadial) return GF_BAD_PARAM;
- ret = GdipSetPathGradientSurroundColorsWithCount(_sten->pRadial, (ARGB *) colors, &col);
- return GF_OK;
-}
-
-
-void gdip_init_driver_grad(GF_Raster2D *driver)
-{
- driver->stencil_new = gdip_new_stencil;
- driver->stencil_delete = gdip_delete_stencil;
- driver->stencil_set_matrix = gdip_stencil_set_matrix;
- driver->stencil_set_brush_color = gdip_set_brush_color;
- driver->stencil_set_gradient_mode = gdip_set_gradient_mode;
- driver->stencil_set_linear_gradient = gdip_set_linear_gradient;
- driver->stencil_set_radial_gradient = gdip_set_radial_gradient;
- driver->stencil_set_gradient_interpolation = gdip_set_gradient_interpolation;
- driver->stencil_set_vertex_path = gdip_set_vertex_path;
- driver->stencil_set_vertex_center = gdip_set_vertex_center;
- driver->stencil_set_vertex_colors = gdip_set_vertex_colors;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / GDIplus rasterizer module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#ifndef __GDIP_PRIV_H
-#define __GDIP_PRIV_H
-
-#include <math.h>
-#include <gpac/modules/raster2d.h>
-#include <gpac/modules/font.h>
-#include <windows.h>
-
-
-#define SAFEALLOC(__ptr, __struc) __ptr = (__struc*)gf_malloc(sizeof(__struc)); if (__ptr) memset(__ptr, 0, sizeof(__struc));
-
-/*all GDIPLUS includes for C api*/
-
-struct IDirectDrawSurface7;
-
-#include "GdiplusMem.h"
-#include "GdiplusEnums.h"
-#include "GdiplusTypes.h"
-#include "GdiplusInit.h"
-#include "GdiplusPixelFormats.h"
-#include "GdiplusColor.h"
-#include "GdiplusMetaHeader.h"
-#include "GdiplusImaging.h"
-#include "GdiplusColorMatrix.h"
-#include "GdiplusGpStubs.h"
-#include "GdiplusColor.h"
-#include "GdiplusFlat.h"
-
-#include <math.h>
-
-#define GD_PI 3.1415926536f
-
-/* default resolution for N-bezier curves*/
-#define GDIP_DEFAULT_RESOLUTION 64
-
-struct _gdip_context
-{
- ULONG_PTR gdiToken;
-};
-
-
-/*struct translators*/
-
-GFINLINE GpMatrix *mat_gpac_to_gdip(GF_Matrix2D *mat)
-{
- GpMatrix *ret;
- if (!mat) return NULL;
- GdipCreateMatrix(&ret);
- GdipSetMatrixElements(ret, FIX2FLT(mat->m[0]), FIX2FLT(mat->m[3]), FIX2FLT(mat->m[1]), FIX2FLT(mat->m[4]), FIX2FLT(mat->m[2]), FIX2FLT(mat->m[5]));
- return ret;
-}
-
-
-GFINLINE void cmat_gpac_to_gdip(GF_ColorMatrix *mat, ColorMatrix *matrix)
-{
- memset(matrix->m, 0, sizeof(Float)*5*5);
- matrix->m[0][0] = FIX2FLT(mat->m[0]);
- matrix->m[1][0] = FIX2FLT(mat->m[1]);
- matrix->m[2][0] = FIX2FLT(mat->m[2]);
- matrix->m[3][0] = FIX2FLT(mat->m[3]);
- matrix->m[4][0] = FIX2FLT(mat->m[4]);
- matrix->m[0][1] = FIX2FLT(mat->m[5]);
- matrix->m[1][1] = FIX2FLT(mat->m[6]);
- matrix->m[2][1] = FIX2FLT(mat->m[7]);
- matrix->m[3][1] = FIX2FLT(mat->m[8]);
- matrix->m[4][1] = FIX2FLT(mat->m[9]);
- matrix->m[0][2] = FIX2FLT(mat->m[10]);
- matrix->m[1][2] = FIX2FLT(mat->m[11]);
- matrix->m[2][2] = FIX2FLT(mat->m[12]);
- matrix->m[3][2] = FIX2FLT(mat->m[13]);
- matrix->m[4][2] = FIX2FLT(mat->m[14]);
- matrix->m[0][3] = FIX2FLT(mat->m[15]);
- matrix->m[1][3] = FIX2FLT(mat->m[16]);
- matrix->m[2][3] = FIX2FLT(mat->m[17]);
- matrix->m[3][3] = FIX2FLT(mat->m[18]);
- matrix->m[4][3] = FIX2FLT(mat->m[19]);
-}
-
-
-GFINLINE void gdip_cmat_reset(ColorMatrix *matrix)
-{
- memset(matrix->m, 0, sizeof(Float)*5*5);
- matrix->m[0][0] = matrix->m[1][1] = matrix->m[2][2] = matrix->m[3][3] = matrix->m[4][4] = 1.0;
-}
-
-#define GPMATRIX() GpMatrix * _mat = mat_gpac_to_gdip(mat);
-
-GpPath *gdip_create_path(GF_Path * _this);
-
-struct _stencil
-{
- GF_StencilType type;
- GF_GradientMode spread;
- GF_TextureTiling tiling;
-
- GpSolidFill *pSolid;
-
- GpMatrix *pMat;
-
- /*Linear gradient vars*/
- GpLineGradient *pLinear;
- GpMatrix *pLinearMat;
- GpPointF start, end;
-
- /*Radial gradient vars*/
- GpPathGradient *pRadial;
- GpPointF center, radius, focal;
- GpPath *circle;
-
- /*interpolation colors storage*/
- REAL *pos;
- ARGB *cols;
- u32 num_pos;
- Bool needs_rebuild;
-
- /*texture specific*/
- GpTexture *pTexture;
- GpBitmap *pBitmap;
- u32 width, height;
- ColorMatrix cmat;
- Bool has_cmat;
- PixelFormat format;
- /*GDIplus is expecting ABGR when creating a bitmap with GdipCreateBitmapFromScan0.
- Since we don't want to rewrite by hand the full image when loading textures, we
- force R->B switching */
- Bool invert_br;
- GF_TextureFilter tFilter;
-
- Bool texture_invalid;
- GF_Rect wnd;
- u8 alpha;
-
- unsigned char *conv_buf;
- u32 conv_size;
- unsigned char *orig_buf;
- u32 orig_stride, orig_format;
- Bool is_converted;
- /*not used yet, we only convert to RGB or ARGB*/
- u32 destination_format;
-};
-#define GPSTEN() struct _stencil *_sten = (struct _stencil *) _this; assert(_this);
-#define CHECK(_type) if (_sten->type!=_type) return;
-#define CHECK_RET(_type) if (_sten->type!=_type) return GF_BAD_PARAM;
-#define CHECK2(_t1, _t2) if ((_sten->type!=_t1) && (_sten->type!=_t2)) return;
-#define CHECK2_RET(_t1, _t2) if ((_sten->type!=_t1) && (_sten->type!=_t2)) return GF_BAD_PARAM;
-
-void gdip_recompute_line_gradient(GF_STENCIL _this);
-void gdip_recompute_radial_gradient(GF_STENCIL _this);
-
-void gdip_load_texture(struct _stencil *sten);
-
-void gdip_init_driver_texture(GF_Raster2D *driver);
-void gdip_init_driver_common(GF_Raster2D *driver);
-void gdip_init_driver_grad(GF_Raster2D *driver);
-
-typedef struct
-{
- ULONG_PTR gdiToken;
-
- /*text stuff*/
- Float em_size, descent, ascent;
- s32 font_style;
- Float whitespace_width;
- Float underscore_width;
- GpFontFamily *font;
-
- char font_serif[1024];
- char font_sans[1024];
- char font_fixed[1024];
-} FontPriv;
-
-GF_FontReader *gdip_new_font_driver();
-void gdip_delete_font_driver(GF_FontReader *dr);
-
-
-GF_Raster2D *gdip_LoadRenderer();
-void gdip_ShutdownRenderer(GF_Raster2D *driver);
-
-#endif //__GDIP_PRIV_H
\ No newline at end of file
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / GDIplus rasterizer module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <windows.h>
-#include "gdip_priv.h"
-
-/*all GDIPLUS includes for C api*/
-
-struct IDirectDrawSurface7;
-
-#include "GdiplusMem.h"
-#include "GdiplusEnums.h"
-#include "GdiplusTypes.h"
-#include "GdiplusInit.h"
-#include "GdiplusPixelFormats.h"
-#include "GdiplusColor.h"
-#include "GdiplusMetaHeader.h"
-#include "GdiplusImaging.h"
-#include "GdiplusColorMatrix.h"
-#include "GdiplusGpStubs.h"
-#include "GdiplusColor.h"
-#include "GdiplusFlat.h"
-
-struct _graphics
-{
- GpGraphics *graph;
- GpMatrix *mat;
- GpPath *clip;
- GpPath *current;
- u32 w, h;
- Bool center_coords;
-
- /*offscreen buffer handling*/
- GpBitmap *pBitmap;
-};
-
-GpPath *gdip_create_path(GF_Path *_this)
-{
- GpPath *p;
- u32 j, i, nb_pts, cur;
- if (!_this || !_this->n_points) return NULL;
- GdipCreatePath(FillModeAlternate, &p);
-
- GdipSetPathFillMode(p, (_this->flags & GF_PATH_FILL_ZERO_NONZERO) ? FillModeWinding : FillModeAlternate);
-
- cur = 0;
- for (i=0; i<_this->n_contours; i++) {
- nb_pts = 1+_this->contours[i] - cur;
- GdipStartPathFigure(p);
- for (j=cur+1; j<cur+nb_pts; ) {
- switch (_this->tags[j]) {
- case GF_PATH_CURVE_ON:
- GdipAddPathLine(p, FIX2FLT(_this->points[j-1].x), FIX2FLT(_this->points[j-1].y), FIX2FLT(_this->points[j].x), FIX2FLT(_this->points[j].y));
- j++;
- break;
- case GF_PATH_CLOSE:
- GdipAddPathLine(p, FIX2FLT(_this->points[j].x), FIX2FLT(_this->points[j].y), FIX2FLT(_this->points[cur].x), FIX2FLT(_this->points[cur].y));
- j++;
- break;
- case GF_PATH_CURVE_CUBIC:
- GdipAddPathBezier(p,
- FIX2FLT(_this->points[j-1].x), FIX2FLT(_this->points[j-1].y),
- FIX2FLT(_this->points[j].x), FIX2FLT(_this->points[j].y),
- FIX2FLT(_this->points[j+1].x), FIX2FLT(_this->points[j+1].y),
- FIX2FLT(_this->points[j+2].x), FIX2FLT(_this->points[j+2].y)
- );
- j+=3;
- break;
- case GF_PATH_CURVE_CONIC:
- {
- GF_Point2D ctl, end, c1, c2, start;
- start = _this->points[j-1];
- ctl = _this->points[j];
- end = _this->points[j+1];
- c1.x = start.x + 2*(ctl.x - start.x) / 3;
- c1.y = start.y + 2*(ctl.y - start.y) / 3;
- c2.x = c1.x + (end.x - start.x) / 3;
- c2.y = c1.y + (end.y - start.y) / 3;
- GdipAddPathBezier(p,
- FIX2FLT(start.x), FIX2FLT(start.y),
- FIX2FLT(c1.x), FIX2FLT(c1.y),
- FIX2FLT(c2.x), FIX2FLT(c2.y),
- FIX2FLT(end.x), FIX2FLT(end.y)
- );
- j+=2;
- }
- break;
- }
- }
- GdipClosePathFigure(p);
- cur += nb_pts;
- }
- return p;
-}
-
-#define GPGRAPH() struct _graphics *_graph = (struct _graphics *)_this;
-
-static
-GF_SURFACE gdip_new_surface(GF_Raster2D *, Bool center_coords)
-{
- struct _graphics *graph;
- SAFEALLOC(graph, struct _graphics);
- graph->center_coords = center_coords;
- return graph;
-}
-
-static
-void gdip_delete_surface(GF_SURFACE _this)
-{
- GPGRAPH();
- gf_free(_graph);
-}
-
-/*should give the best results with the clippers*/
-#define GDIP_PIXEL_MODE PixelOffsetModeHighQuality
-
-static
-GF_Err gdip_attach_surface_to_device(GF_SURFACE _this, void *os_handle, u32 width, u32 height)
-{
- GpMatrix *mat;
- HDC handle = (HDC) os_handle;
- GPGRAPH();
- if (!_graph || !handle) return GF_BAD_PARAM;
- if (_graph->graph) return GF_BAD_PARAM;
- GdipCreateFromHDC(handle, &_graph->graph);
-
- GdipCreateMatrix(&mat);
- if ( _graph->center_coords) {
- GdipScaleMatrix(mat, 1.0, -1.0, MatrixOrderAppend);
- GdipTranslateMatrix(mat, (Float) width/2, (Float) height/2, MatrixOrderAppend);
- }
- GdipSetWorldTransform(_graph->graph, mat);
- GdipDeleteMatrix(mat);
- _graph->w = width;
- _graph->h = height;
- GdipSetPixelOffsetMode(_graph->graph, GDIP_PIXEL_MODE);
- return GF_OK;
-}
-static
-GF_Err gdip_attach_surface_to_texture(GF_SURFACE _this, GF_STENCIL sten)
-{
- GpMatrix *mat;
- struct _stencil *_sten = (struct _stencil *)sten;
- GPGRAPH();
- if (!_graph || !_sten || !_sten->pBitmap) return GF_BAD_PARAM;
-
- GdipGetImageGraphicsContext(_sten->pBitmap, &_graph->graph);
-
- if (_graph->center_coords) {
- GdipCreateMatrix(&mat);
- GdipScaleMatrix(mat, 1.0, -1.0, MatrixOrderAppend);
- GdipTranslateMatrix(mat, (Float) _sten->width/2, (Float) _sten->height/2, MatrixOrderAppend);
- GdipSetWorldTransform(_graph->graph, mat);
- GdipDeleteMatrix(mat);
- }
- _graph->w = _sten->width;
- _graph->h = _sten->height;
- GdipSetPixelOffsetMode(_graph->graph, GDIP_PIXEL_MODE);
- return GF_OK;
-}
-static
-GF_Err gdip_attach_surface_to_buffer(GF_SURFACE _this, char *pixels, u32 width, u32 height, s32 pitch_x, s32 pitch_y, GF_PixelFormat pixelFormat)
-{
- GpMatrix *mat;
- u32 pFormat;
- GPGRAPH();
-
- if (pitch_y%4) return GF_NOT_SUPPORTED;
-
- switch (pixelFormat) {
- case GF_PIXEL_ALPHAGREY:
- pFormat = PixelFormat16bppGrayScale;
- if (pitch_x != 2) return GF_NOT_SUPPORTED;
- break;
- case GF_PIXEL_RGB_555:
- pFormat = PixelFormat16bppRGB555;
- if (pitch_x != 2) return GF_NOT_SUPPORTED;
- break;
- case GF_PIXEL_RGB_565:
- pFormat = PixelFormat16bppRGB565;
- if (pitch_x != 2) return GF_NOT_SUPPORTED;
- break;
- case GF_PIXEL_RGB:
- pFormat = PixelFormat24bppRGB;
- if (pitch_x != 3) return GF_NOT_SUPPORTED;
- break;
- case GF_PIXEL_RGBX:
- pFormat = PixelFormat32bppRGB;
- if (pitch_x != 4) return GF_NOT_SUPPORTED;
- break;
- case GF_PIXEL_ARGB:
- pFormat = PixelFormat32bppARGB;
- if (pitch_x != 4) return GF_NOT_SUPPORTED;
- break;
- default:
- return GF_NOT_SUPPORTED;
- }
- GdipCreateBitmapFromScan0(width, height, pitch_y, pFormat, (unsigned char*)pixels, &_graph->pBitmap);
- GdipGetImageGraphicsContext(_graph->pBitmap, &_graph->graph);
-
- _graph->w = width;
- _graph->h = height;
- if (_graph->center_coords) {
- GdipCreateMatrix(&mat);
- GdipScaleMatrix(mat, 1.0, -1.0, MatrixOrderAppend);
- GdipTranslateMatrix(mat, (Float) width/2, (Float) height/2, MatrixOrderAppend);
- GdipSetWorldTransform(_graph->graph, mat);
- GdipDeleteMatrix(mat);
- }
- GdipSetPixelOffsetMode(_graph->graph, GDIP_PIXEL_MODE);
- return GF_OK;
-}
-
-static
-void gdip_detach_surface(GF_SURFACE _this)
-{
- GPGRAPH();
- if (_graph->graph) GdipDeleteGraphics(_graph->graph);
- _graph->graph = NULL;
- if (_graph->clip) GdipDeletePath(_graph->clip);
- _graph->clip = NULL;
- if (_graph->pBitmap) GdipDisposeImage(_graph->pBitmap);
- _graph->pBitmap = NULL;
- if (_graph->current) GdipDeletePath(_graph->current);
- _graph->current = NULL;
-}
-
-
-static
-GF_Err gdip_surface_set_raster_level(GF_SURFACE _this, GF_RasterLevel RasterSetting)
-{
- GPGRAPH();
- switch (RasterSetting) {
- case GF_RASTER_HIGH_SPEED:
- GdipSetSmoothingMode(_graph->graph, SmoothingModeHighSpeed);
- GdipSetCompositingQuality(_graph->graph, CompositingQualityHighSpeed);
- break;
- case GF_RASTER_MID:
- GdipSetSmoothingMode(_graph->graph, SmoothingModeDefault);
- GdipSetCompositingQuality(_graph->graph, CompositingQualityDefault);
- break;
- case GF_RASTER_HIGH_QUALITY:
- GdipSetSmoothingMode(_graph->graph, SmoothingModeHighQuality);
- GdipSetCompositingQuality(_graph->graph, CompositingQualityDefault);
- /*THIS IS HORRIBLY SLOW DON'T EVEN THINK ABOUT IT*/
- /*GdipSetCompositingQuality(_graph->graph, CompositingQualityHighQuality);*/
- break;
- }
- return GF_OK;
-}
-static
-GF_Err gdip_surface_set_matrix(GF_SURFACE _this, GF_Matrix2D * mat)
-{
- GPGRAPH();
- if (_graph->mat) GdipDeleteMatrix(_graph->mat);
-
- _graph->mat = mat_gpac_to_gdip(mat);
- return GF_OK;
-}
-static
-GF_Err gdip_surface_set_clipper(GF_SURFACE _this, GF_IRect *rc)
-{
- GPGRAPH();
- if (_graph->clip) GdipDeletePath(_graph->clip);
- _graph->clip = 0L;
- if (!rc) return GF_OK;
-
- GdipCreatePath(FillModeAlternate, &_graph->clip);
- GdipAddPathRectangleI(_graph->clip, rc->x, rc->y - rc->height, rc->width, rc->height);
- return GF_OK;
-}
-
-static
-GpBrush *gdip_get_brush(struct _stencil *_sten)
-{
- if (_sten->pSolid) return _sten->pSolid;
- if (_sten->pLinear) return _sten->pLinear;
- if (_sten->pRadial) return _sten->pRadial;
- if (_sten->pTexture) return _sten->pTexture;
- return NULL;
-}
-
-static GpPath *gdip_setup_path(struct _graphics *_this, GF_Path *path)
-{
- GpPath *tr = gdip_create_path(path);
- /*append current matrix*/
- if (_this->mat) GdipTransformPath(tr, _this->mat);
- return tr;
-}
-
-static
-GF_Err gdip_surface_set_path(GF_SURFACE _this, GF_Path *path)
-{
- struct _storepath *_path;
- GPGRAPH();
- if (!_graph) return GF_BAD_PARAM;
- if (_graph->current) GdipDeletePath(_graph->current);
- _graph->current = NULL;
- if (!path) return GF_OK;
-
- _path = (struct _storepath *)path;
- _graph->current = gdip_setup_path(_graph, path);
- return GF_OK;
-}
-
-//#define NODRAW
-
-static
-GF_Err gdip_surface_fill(GF_SURFACE _this, GF_STENCIL stencil)
-{
- GpStatus ret;
- GpMatrix *newmat;
- struct _stencil *_sten;
- GPGRAPH();
- if (!_this) return GF_BAD_PARAM;
- if (!_graph->current) return GF_OK;
- _sten = (struct _stencil *)stencil;
- assert(_sten);
-
-#ifdef NODRAW
- return GF_OK;
-#endif
-
-
- if (_graph->clip) GdipSetClipPath(_graph->graph, _graph->clip, CombineModeReplace);
-
- switch (_sten->type) {
- case GF_STENCIL_SOLID:
- assert(_sten->pSolid);
- GdipFillPath(_graph->graph, _sten->pSolid, _graph->current);
- break;
- case GF_STENCIL_LINEAR_GRADIENT:
- if (_sten->pMat) {
- /*rebuild gradient*/
- gdip_recompute_line_gradient(_sten);
-
- GdipResetTextureTransform((GpTexture*)_sten->pLinear);
- if (_sten->pMat) {
- GdipCloneMatrix(_sten->pMat, &newmat);
- } else {
- GdipCreateMatrix(&newmat);
- }
- GdipMultiplyMatrix(newmat, _sten->pLinearMat, MatrixOrderPrepend);
- GdipSetTextureTransform((GpTexture*)_sten->pLinear, newmat);
- GdipDeleteMatrix(newmat);
- }
- GdipFillPath(_graph->graph, _sten->pLinear, _graph->current);
- break;
- case GF_STENCIL_RADIAL_GRADIENT:
- /*build gradient*/
- gdip_recompute_radial_gradient(_sten);
-
- GdipSetCompositingQuality(_graph->graph, CompositingQualityHighSpeed);
- GdipSetInterpolationMode(_graph->graph, InterpolationModeLowQuality);
- GdipSetSmoothingMode(_graph->graph, SmoothingModeHighSpeed);
-
- /*check if we need to draw solid background (GDIplus doesn't implement padded mode on path gradients)*/
- if (_sten->pSolid) {
- GpPath *tr;
- GdipClonePath(_sten->circle, &tr);
- GdipTransformPath(tr, _sten->pMat);
- GdipSetClipPath(_graph->graph, tr, CombineModeExclude);
- GdipFillPath(_graph->graph, _sten->pSolid, _graph->current);
- GdipDeletePath(tr);
- GdipResetClip(_graph->graph);
- if (_graph->clip) GdipSetClipPath(_graph->graph, _graph->clip, CombineModeReplace);
- }
- GdipFillPath(_graph->graph, _sten->pRadial, _graph->current);
- break;
- case GF_STENCIL_VERTEX_GRADIENT:
- assert(_sten->pRadial);
- if (_sten->pMat) GdipSetTextureTransform((GpTexture*)_sten->pRadial, _sten->pMat);
- ret = GdipFillPath(_graph->graph, _sten->pRadial, _graph->current);
- break;
- case GF_STENCIL_TEXTURE:
- gdip_load_texture(_sten);
- if (_sten->pTexture) {
- GpMatrix *newmat;
- GdipResetTextureTransform((GpTexture*)_sten->pTexture);
- if (_sten->pMat) {
- GdipCloneMatrix(_sten->pMat, &newmat);
- } else {
- GdipCreateMatrix(&newmat);
- }
- /*gdip flip*/
- if (_graph->center_coords && !(_sten->tiling&GF_TEXTURE_FLIP) )
- GdipScaleMatrix(newmat, 1, -1, MatrixOrderPrepend);
- else if (!_graph->center_coords && (_sten->tiling&GF_TEXTURE_FLIP) )
- GdipScaleMatrix(newmat, 1, -1, MatrixOrderPrepend);
-
- GdipSetTextureTransform((GpTexture*)_sten->pTexture, newmat);
- GdipDeleteMatrix(newmat);
-
- GdipSetInterpolationMode(_graph->graph, (_sten->tFilter==GF_TEXTURE_FILTER_HIGH_QUALITY) ? InterpolationModeHighQuality : InterpolationModeLowQuality);
- GdipFillPath(_graph->graph, _sten->pTexture, _graph->current);
- }
- break;
- }
- return GF_OK;
-}
-
-
-static
-GF_Err gdip_surface_flush(GF_SURFACE _this)
-{
- GPGRAPH();
- GdipFlush(_graph->graph, FlushIntentionSync);
- return GF_OK;
-}
-
-static
-GF_Err gdip_surface_clear(GF_SURFACE _this, GF_IRect *rc, u32 color)
-{
- GpPath *path;
- GPGRAPH();
-
- GdipCreatePath(FillModeAlternate, &path);
- if (rc) {
- /*luckily enough this maps well for both flipped and unflipped coords*/
- GdipAddPathRectangleI(path, rc->x, rc->y - rc->height, rc->width, rc->height);
- } else {
- /* if (_graph->center_coords) {
- GdipAddPathRectangleI(path, -1 * (s32)_graph->w / 2, -1 * (s32)_graph->h / 2, _graph->w, _graph->h);
- } else {
- */ GdipAddPathRectangleI(path, 0, 0, _graph->w, _graph->h);
-// }
- }
- /*we MUST use clear otherwise ARGB surfaces are not cleared correctly*/
- GdipSetClipPath(_graph->graph, path, CombineModeReplace);
- GdipGraphicsClear(_graph->graph, color);
- GdipDeletePath(path);
- return GF_OK;
-}
-
-void gdip_init_driver_surface(GF_Raster2D *driver)
-{
- driver->surface_new = gdip_new_surface;
- driver->surface_delete = gdip_delete_surface;
- driver->surface_attach_to_device = gdip_attach_surface_to_device;
- driver->surface_attach_to_texture = gdip_attach_surface_to_texture;
- driver->surface_attach_to_buffer = gdip_attach_surface_to_buffer;
- driver->surface_detach = gdip_detach_surface;
- driver->surface_set_raster_level = gdip_surface_set_raster_level;
- driver->surface_set_matrix = gdip_surface_set_matrix;
- driver->surface_set_clipper = gdip_surface_set_clipper;
- driver->surface_set_path = gdip_surface_set_path;
- driver->surface_fill = gdip_surface_fill;
- driver->surface_flush = gdip_surface_flush;
- driver->surface_clear = gdip_surface_clear;
-}
-
-
-GF_Raster2D *gdip_LoadRenderer()
-{
- GdiplusStartupInput startupInput;
- GF_Raster2D *driver;
- struct _gdip_context *ctx;
- SAFEALLOC(ctx, struct _gdip_context);
- SAFEALLOC(driver, GF_Raster2D);
- GdiplusStartup(&ctx->gdiToken, &startupInput, NULL);
- driver->internal = ctx;
- GF_REGISTER_MODULE_INTERFACE(driver, GF_RASTER_2D_INTERFACE, "GDIplus 2D Raster", "gpac distribution")
- gdip_init_driver_texture(driver);
- gdip_init_driver_surface(driver);
- gdip_init_driver_grad(driver);
- return driver;
-}
-
-void gdip_ShutdownRenderer(GF_Raster2D *driver)
-{
- struct _gdip_context *ctx = (struct _gdip_context *)driver->internal;
-
- GdiplusShutdown(ctx->gdiToken);
- gf_free(ctx);
- gf_free(driver);
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / GDIplus rasterizer module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include "gdip_priv.h"
-
-#define COL_565(c) GF_COL_ARGB(0xFF, (u8) ( (val >> 7) & 0xf8), (u8) ( (val >> 2) & 0xf8), (u8) ( (val << 3) & 0xf8) )
-#define COL_555(c) GF_COL_ARGB(0xFF, (u8) ( (val >> 8) & 0xf8), (u8) ( (val >> 3) & 0xfc), (u8) ( (val << 3) & 0xf8) )
-
-static
-GF_Err gdip_set_texture(GF_STENCIL _this, char *pixels, u32 width, u32 height, u32 stride, GF_PixelFormat pixelFormat, GF_PixelFormat destination_format_hint, Bool no_copy)
-{
- char *ptr;
- Bool is_yuv;
- u32 pFormat, isBGR, BPP, i, j, col;
- unsigned char a, r, g, b;
- unsigned short val;
- Bool copy;
- GPSTEN();
- CHECK_RET(GF_STENCIL_TEXTURE);
-
- gdip_cmat_reset(&_sten->cmat);
- isBGR = 0;
- BPP = 4;
- copy = GF_FALSE;
- is_yuv = GF_FALSE;
- /*is pixel format supported ?*/
- switch (pixelFormat) {
- case GF_PIXEL_GREYSCALE:
- pFormat = PixelFormat24bppRGB;
- BPP = 1;
- /*no support for 8bit greyscale not indexed in GDIPlus ...*/
- copy = GF_TRUE;
- break;
- case GF_PIXEL_ALPHAGREY:
- pFormat = PixelFormat32bppARGB;
- BPP = 2;
- /*cannot get it to work without using 32bpp argb*/
- copy = GF_TRUE;
- break;
- case GF_PIXEL_RGB_555:
- pFormat = PixelFormat16bppRGB555;
- BPP = 2;
- break;
- case GF_PIXEL_RGB_565:
- pFormat = PixelFormat16bppRGB565;
- BPP = 2;
- break;
- case GF_PIXEL_RGB:
- pFormat = PixelFormat24bppRGB;
- BPP = 3;
- /*one day I'll hope to understand how color management works with GDIplus bitmaps...*/
- isBGR = 1;
-// copy = 1;
- break;
- case GF_PIXEL_BGR:
- pFormat = PixelFormat24bppRGB;
- BPP = 3;
- break;
- case GF_PIXEL_RGBX:
- pFormat = PixelFormat32bppRGB;
- BPP = 4;
- break;
- case GF_PIXEL_ARGB:
- pFormat = PixelFormat32bppARGB;
- BPP = 4;
- break;
- case GF_PIXEL_RGBA:
- pFormat = PixelFormat32bppARGB;
- BPP = 4;
- copy = GF_TRUE;
- _sten->orig_buf = (unsigned char *) pixels;
- break;
- case GF_PIXEL_YUV:
- if ( (width*3)%4) return GF_NOT_SUPPORTED;
- _sten->orig_format = GF_PIXEL_YUV;
- is_yuv = GF_TRUE;
- break;
- case GF_PIXEL_YUVA:
- _sten->orig_format = GF_PIXEL_YUVA;
- is_yuv = GF_TRUE;
- break;
- default:
- return GF_NOT_SUPPORTED;
- }
-
- if (_sten->pBitmap) GdipDisposeImage(_sten->pBitmap);
- _sten->pBitmap = NULL;
- _sten->width = width;
- _sten->height = height;
- _sten->destination_format = destination_format_hint;
- if (is_yuv) {
- _sten->orig_buf = (unsigned char*)pixels;
- _sten->orig_stride = stride;
- _sten->is_converted = GF_FALSE;
- return GF_OK;
- }
-
- _sten->is_converted = GF_TRUE;
- _sten->format = pFormat;
-
- /*GDIplus limitation : horiz_stride shall be multiple of 4 and no support for pure grayscale without palette*/
- if (!copy && pixels && !(stride%4)) {
- if (no_copy && isBGR) return GF_NOT_SUPPORTED;
- GdipCreateBitmapFromScan0(_sten->width, _sten->height, stride, pFormat, (unsigned char*)pixels, &_sten->pBitmap);
- _sten->invert_br = isBGR ? GF_TRUE : GF_FALSE;
- }
- /*all other cases: create a local bitmap in desired format*/
- else {
- if (no_copy) return GF_NOT_SUPPORTED;
- GdipCreateBitmapFromScan0(_sten->width, _sten->height, 0, pFormat, NULL, &_sten->pBitmap);
- ptr = pixels;
- for (j=0; j<_sten->height; j++) {
- for (i=0; i<_sten->width; i++) {
- switch (pixelFormat) {
- case GF_PIXEL_GREYSCALE:
- r = *ptr++;
- col = GF_COL_ARGB(255, r, r, r);
- break;
- case GF_PIXEL_ALPHAGREY:
- r = *ptr++;
- a = *ptr++;
- col = GF_COL_ARGB(a, r, r, r);
- break;
- case GF_PIXEL_RGB_555:
- val = * (unsigned short *) (ptr);
- ptr+= 2;
- col = COL_555(val);
- break;
- case GF_PIXEL_RGB_565:
- val = * (unsigned short *) (ptr);
- ptr+= 2;
- col = COL_565(val);
- break;
- /*scan0 uses bgr...*/
- case GF_PIXEL_BGR:
- case GF_PIXEL_RGB:
- r = *ptr++;
- g = *ptr++;
- b = *ptr++;
- if (!isBGR) {
- col = GF_COL_ARGB(255, b, g, r);
- } else {
- col = GF_COL_ARGB(255, r, g, b);
- }
- break;
- /*NOTE: we assume little-endian only for GDIplus platforms, so BGRA/BGRX*/
- case GF_PIXEL_RGBX:
- case GF_PIXEL_ARGB:
- b = *ptr++;
- g = *ptr++;
- r = *ptr++;
- a = *ptr++;
- if (pixelFormat==GF_PIXEL_RGBX) a = 0xFF;
- col = GF_COL_ARGB(a, r, g, b);
- break;
- case GF_PIXEL_RGBA:
- r = *ptr++;
- g = *ptr++;
- b = *ptr++;
- a = *ptr++;
- col = GF_COL_ARGB(a, r, g, b);
- break;
- default:
- col = GF_COL_ARGB(255, 255, 255, 255);
- break;
- }
- GdipBitmapSetPixel(_sten->pBitmap, i, j, col);
- }
- }
- }
-
- return GF_OK;
-}
-
-static
-GF_Err gdip_set_texture_repeat_mode(GF_STENCIL _this, GF_TextureTiling mode)
-{
- GPSTEN();
- _sten->tiling = mode;
- return GF_OK;
-}
-
-static
-GF_Err gdip_set_sr_texture_filter(GF_STENCIL _this, GF_TextureFilter filter_mode)
-{
- GPSTEN();
- CHECK_RET(GF_STENCIL_TEXTURE);
- _sten->tFilter = filter_mode;
- return GF_OK;
-}
-
-
-static
-GF_Err gdip_set_color_matrix(GF_STENCIL _this, GF_ColorMatrix *cmat)
-{
- GPSTEN();
- if (!cmat || cmat->identity) {
- _sten->texture_invalid = _sten->has_cmat;
- _sten->has_cmat = GF_FALSE;
- } else {
- if (_sten->invert_br) {
- GF_ColorMatrix fin, rev;
- memcpy(&fin, cmat, sizeof(GF_ColorMatrix));
- memset(&rev, 0, sizeof(GF_ColorMatrix));
- rev.m[0] = 0;
- rev.m[2] = 1;
- rev.m[10] = 1;
- rev.m[12] = 0;
- rev.m[6] = rev.m[18] = 1;
- gf_cmx_multiply(&fin, &rev);
- cmat_gpac_to_gdip(&fin, &_sten->cmat);
- } else {
- cmat_gpac_to_gdip(cmat, &_sten->cmat);
- }
- _sten->has_cmat = GF_TRUE;
- }
- _sten->texture_invalid = GF_TRUE;
- return GF_OK;
-}
-
-static
-GF_Err gdip_set_alpha(GF_STENCIL _this, u8 alpha)
-{
- GPSTEN();
- if (_sten->alpha != alpha) {
- _sten->alpha = alpha;
- _sten->texture_invalid = GF_TRUE;
- }
- return GF_OK;
-}
-
-void gdip_convert_texture(struct _stencil *sten);
-
-static
-GF_Err gdip_get_pixel(GF_STENCIL _this, u32 x, u32 y, u32 *col)
-{
- ARGB v;
- GpStatus st;
-
- GPSTEN();
- if (!_sten->is_converted) gdip_convert_texture(_sten);
- if (!_sten->pBitmap) return GF_BAD_PARAM;
-
- st = GdipBitmapGetPixel(_sten->pBitmap, x, y, &v);
-
- if (_sten->invert_br) {
- *col = GF_COL_ARGB( ((v>>24)&0xFF), ((v)&0xFF), ((v>>8)&0xFF), ((v>>16)&0xFF) );
- } else {
- *col = v;
- }
- return GF_OK;
-}
-
-
-static
-GF_Err gdip_set_pixel(GF_STENCIL _this, u32 x, u32 y, u32 col)
-{
- GpStatus st;
- ARGB v;
- GPSTEN();
- if (!_sten->pBitmap) return GF_BAD_PARAM;
- if (!_sten->is_converted) gdip_convert_texture(_sten);
-
- if (_sten->invert_br) {
- v = GF_COL_ARGB( ((col>>24)&0xFF), ((col)&0xFF), ((col>>8)&0xFF), ((col>>16)&0xFF) );
- } else {
- v = col;
- }
- st = GdipBitmapSetPixel(_sten->pBitmap, x, y, v);
- return GF_OK;
-}
-
-#if 0
-static
-GF_Err gdip_get_texture(GF_STENCIL _this, unsigned char **pixels, u32 *width, u32 *height, u32 *stride, GF_PixelFormat *pixelFormat)
-{
- GpRect rc;
- BitmapData data;
- GPSTEN();
- if (!_sten->pBitmap) return GF_BAD_PARAM;
-
- rc.X = rc.Y = 0;
- rc.Width = _sten->width;
- rc.Height = _sten->height;
-
- GdipBitmapLockBits(_sten->pBitmap, &rc, ImageLockModeRead, _sten->format, &data);
- *pixels = (unsigned char *) data.Scan0;
- *width = data.Width;
- *height = data.Height;
- *stride = data.Stride;
- switch (data.PixelFormat) {
- case PixelFormat16bppRGB555:
- *pixelFormat = GF_PIXEL_RGB_555;
- break;
- case PixelFormat16bppRGB565:
- *pixelFormat = GF_PIXEL_RGB_565;
- break;
- case PixelFormat32bppRGB:
- *pixelFormat = GF_PIXEL_RGB_32;
- break;
- case PixelFormat32bppARGB:
- *pixelFormat = GF_PIXEL_ARGB;
- break;
- case PixelFormat24bppRGB:
- default:
- *pixelFormat = GF_PIXEL_RGB_24;
- break;
- }
- return GF_OK;
-}
-#endif
-
-
-void gdip_texture_modified(GF_STENCIL _this)
-{
- GPSTEN();
- if (_sten->orig_buf && (_sten->format == PixelFormat32bppARGB)) {
- gdip_set_texture(_this, (char *) _sten->orig_buf, _sten->width, _sten->height, _sten->width * 4, GF_PIXEL_RGBA, GF_PIXEL_RGBA, GF_FALSE);
- }
- _sten->texture_invalid = GF_TRUE;
-}
-
-void gdip_init_driver_texture(GF_Raster2D *driver)
-{
- driver->stencil_set_texture = gdip_set_texture;
- driver->stencil_set_tiling = gdip_set_texture_repeat_mode;
- driver->stencil_set_filter = gdip_set_sr_texture_filter;
- driver->stencil_set_color_matrix = gdip_set_color_matrix;
- driver->stencil_set_alpha = gdip_set_alpha;
- driver->stencil_texture_modified = gdip_texture_modified;
-}
-
-
-void gdip_convert_texture(struct _stencil *sten)
-{
- u32 BPP, format;
- GF_VideoSurface src, dst;
-
- if (sten->orig_format == GF_PIXEL_YUV) {
- BPP = 3;
- dst.pixel_format = GF_PIXEL_BGR;
- format = PixelFormat24bppRGB;
- } else {
- BPP = 4;
- dst.pixel_format = GF_PIXEL_ARGB;
- format = PixelFormat32bppARGB;
- }
- if (BPP*sten->width*sten->height > sten->conv_size) {
- if (sten->conv_buf) gf_free(sten->conv_buf);
- sten->conv_size = BPP*sten->width*sten->height;
- sten->conv_buf = (unsigned char *) gf_malloc(sizeof(unsigned char)*sten->conv_size);
- }
-
- memset(&src, 0, sizeof(GF_VideoSurface));
- src.height = sten->height;
- src.width = sten->width;
- src.pitch_x =0;
- src.pitch_y = sten->orig_stride;
- src.pixel_format = sten->orig_format;
- src.video_buffer = (char*)sten->orig_buf;
-
- memset(&dst, 0, sizeof(GF_VideoSurface));
- dst.width = sten->width;
- dst.height = sten->height;
- dst.pitch_x = 0;
- dst.pitch_y = BPP*sten->width;
- dst.video_buffer = (char*)sten->conv_buf;
-
- gf_stretch_bits(&dst, &src, NULL, NULL, 0xFF, GF_FALSE, NULL, NULL);
-
- if (sten->pBitmap) GdipDisposeImage(sten->pBitmap);
- GdipCreateBitmapFromScan0(sten->width, sten->height, BPP*sten->width, format, sten->conv_buf, &sten->pBitmap);
- sten->is_converted = GF_TRUE;
-}
-
-void gdip_load_texture(struct _stencil *sten)
-{
- GpImageAttributes *attr;
- ColorMatrix _cmat;
-
- if (sten->texture_invalid && sten->pTexture) {
- GdipDeleteBrush(sten->pTexture);
- sten->pTexture = NULL;
- }
- /*nothing to do*/
- if (sten->is_converted && sten->pTexture) return;
- sten->texture_invalid = GF_FALSE;
-
- /*convert*/
- if (!sten->is_converted) gdip_convert_texture(sten);
-
- GdipCreateImageAttributes(&attr);
- if (sten->has_cmat) {
- memcpy(_cmat.m, sten->cmat.m, sizeof(REAL)*5*5);
- } else {
- memset(_cmat.m, 0, sizeof(REAL)*5*5);
- _cmat.m[0][0] = _cmat.m[1][1] = _cmat.m[2][2] = _cmat.m[3][3] = _cmat.m[4][4] = 1.0;
- if (sten->invert_br) {
- _cmat.m[0][0] = 0;
- _cmat.m[0][2] = 1;
- _cmat.m[2][2] = 0;
- _cmat.m[2][0] = 1;
- }
- }
-
- _cmat.m[3][3] *= ((REAL) sten->alpha) /255.0f;
- GdipSetImageAttributesColorMatrix(attr, ColorAdjustTypeDefault, TRUE, &_cmat, NULL, ColorMatrixFlagsDefault);
- if (sten->pTexture) GdipDeleteBrush(sten->pTexture);
- GdipCreateTextureIAI(sten->pBitmap, attr, 0, 0, sten->width, sten->height, &sten->pTexture);
-
- /*1- wrap mode is actually ignored in constructor*/
- /*2- GDIPlus does not support S / T clamping */
- GdipSetTextureWrapMode(sten->pTexture, WrapModeTile);
-
- GdipDisposeImageAttributes(attr);
-}
-
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/hyb_in
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS=hyb_in.o fm_fake_pull.o fm_fake_push.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_hyb_in$(DYN_LIB_SUFFIX)
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac $(LDFLAGS)
-ifeq ($(STATICBUILD),yes)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/gm_hyb_in-static$(DYN_LIB_SUFFIX) $(OBJS) -L../../bin/gcc -lgpac_static $(LDFLAGS)
-endif
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Romain Bouqueau
- * Copyright (c) Telecom ParisTech 2010-20xx
- * All rights reserved
- *
- * This file is part of GPAC / Hybrid Media input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*hybrid media interface implementation generating fake audio consisting in beeps every second in pull mode*/
-
-#include <gpac/thread.h>
-#include "hyb_in.h"
-
-/**********************************************************************************************************************/
-
-#define EXT_MEDIA_LOAD_THREADED
-
-/**********************************************************************************************************************/
-
-#define FM_FAKE_PULL_AUDIO_FREQ 44100
-#define FM_FAKE_PULL_CHAN_NUM 2
-#define FM_FAKE_PULL_BITS 16
-#define FM_FAKE_PULL_TYPE s16
-#define FM_FAKE_PULL_FRAME_DUR 60 /*in ms*/
-#define FM_FAKE_PULL_FRAME_LEN ((FM_FAKE_PULL_FRAME_DUR*FM_FAKE_PULL_CHAN_NUM*FM_FAKE_PULL_BITS*FM_FAKE_PULL_AUDIO_FREQ)/(1000*8)) /*in bytes*/
-
-/**********************************************************************************************************************/
-
-typedef struct s_FM_FAKE_PULL {
- u64 PTS;
- unsigned char buffer10[FM_FAKE_PULL_FRAME_LEN]; /*played 10 percent of time*/
- unsigned char buffer90[FM_FAKE_PULL_FRAME_LEN]; /*played 90 percent of time*/
-
-#ifdef EXT_MEDIA_LOAD_THREADED
- GF_Thread *media_th;
-#endif
-} FM_FAKE_PULL;
-FM_FAKE_PULL FM_FAKE_PULL_private_data;
-
-/**********************************************************************************************************************/
-
-static Bool FM_FAKE_PULL_CanHandleURL(const char *url);
-static GF_ObjectDescriptor* FM_FAKE_PULL_GetOD(void);
-static GF_Err FM_FAKE_PULL_Connect(GF_HYBMEDIA *self, GF_ClientService *service, const char *url);
-static GF_Err FM_FAKE_PULL_Disconnect(GF_HYBMEDIA *self);
-static GF_Err FM_FAKE_PULL_GetData(GF_HYBMEDIA *self, char **out_data_ptr, u32 *out_data_size, GF_SLHeader *out_sl_hdr);
-static GF_Err FM_FAKE_PULL_ReleaseData(GF_HYBMEDIA *self);
-
-GF_HYBMEDIA master_fm_fake_pull = {
- "Fake FM (pull mode)", /*name*/
- FM_FAKE_PULL_CanHandleURL, /*CanHandleURL()*/
- FM_FAKE_PULL_GetOD, /*GetOD()*/
- FM_FAKE_PULL_Connect, /*Connect()*/
- FM_FAKE_PULL_Disconnect, /*Disconnect()*/
- NULL, /*SetState()*/
- FM_FAKE_PULL_GetData, /*GetData()*/
- FM_FAKE_PULL_ReleaseData, /*ReleaseData()*/
- HYB_PULL, /*data_mode*/
- &FM_FAKE_PULL_private_data /*private_data*/
-};
-
-/**********************************************************************************************************************/
-
-static Bool FM_FAKE_PULL_CanHandleURL(const char *url)
-{
- if (!strnicmp(url, "fm://fake_pull", 14))
- return 1;
-
- return 0;
-}
-
-/**********************************************************************************************************************/
-
-static GF_ESD* get_esd()
-{
- GF_BitStream *dsi = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- GF_ESD *esd = gf_odf_desc_esd_new(0);
-
- esd->ESID = 1;
- esd->decoderConfig->streamType = GF_STREAM_AUDIO;
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_RAW_MEDIA_STREAM;
- esd->decoderConfig->avgBitrate = esd->decoderConfig->maxBitrate = 0;
- esd->slConfig->timestampResolution = FM_FAKE_PULL_AUDIO_FREQ;
-
- /*Decoder Specific Info for raw media*/
- gf_bs_write_u32(dsi, FM_FAKE_PULL_AUDIO_FREQ); /*u32 sample_rate*/
- gf_bs_write_u16(dsi, FM_FAKE_PULL_CHAN_NUM); /*u16 nb_channels*/
- gf_bs_write_u16(dsi, FM_FAKE_PULL_BITS); /*u16 nb_bits_per_sample*/
- gf_bs_write_u32(dsi, FM_FAKE_PULL_FRAME_LEN); /*u32 frame_size*/
- gf_bs_write_u32(dsi, 0); /*u32 channel_config*/
- gf_bs_get_content(dsi, &esd->decoderConfig->decoderSpecificInfo->data, &esd->decoderConfig->decoderSpecificInfo->dataLength);
- gf_bs_del(dsi);
-
- return esd;
-}
-
-/**********************************************************************************************************************/
-
-static GF_ObjectDescriptor* FM_FAKE_PULL_GetOD(void)
-{
- /*declare object to terminal*/
- GF_ObjectDescriptor *od = (GF_ObjectDescriptor*)gf_odf_desc_new(GF_ODF_OD_TAG);
- GF_ESD *esd = get_esd();
- od->objectDescriptorID = 1;
- gf_list_add(od->ESDescriptors, esd);
- return od;
-}
-
-/**********************************************************************************************************************/
-
-static u32 ext_media_load_th(void *par) {
- GF_HYBMEDIA *self = (GF_HYBMEDIA*) par;
- /*declare object to terminal*/
- GF_ObjectDescriptor *od = (GF_ObjectDescriptor*)gf_odf_desc_new(GF_ODF_OD_TAG);
- od->URLString = gf_strdup("http://gpac.sourceforge.net/screenshots/lion.jpg");
- od->objectDescriptorID = 0;
- gf_sleep(2000); //TODO: remove the sleep
- gf_service_declare_media(self->owner, (GF_Descriptor*)od, 0);
- return 0;
-}
-
-static GF_Err FM_FAKE_PULL_Connect(GF_HYBMEDIA *self, GF_ClientService *service, const char *url)
-{
- u32 i;
-
- if (!self)
- return GF_BAD_PARAM;
-
- if (!service)
- return GF_BAD_PARAM;
-
- self->owner = service;
-
- /*set audio preloaded data*/
- assert(self->private_data);
- memset(self->private_data, 0, sizeof(FM_FAKE_PULL));
- for (i=0; i<(FM_FAKE_PULL_FRAME_LEN*8)/FM_FAKE_PULL_BITS; i++) {
- if (((2*i)/(FM_FAKE_PULL_CHAN_NUM*100))%2) /*100Hz*/
- *((FM_FAKE_PULL_TYPE*)((FM_FAKE_PULL*)self->private_data)->buffer10+i) = 1 << (FM_FAKE_PULL_BITS-1);
- }
-
- /*for hybrid scenarios: add an external media*/
- if (1) {
-#ifdef EXT_MEDIA_LOAD_THREADED
- GF_Thread **th = &((FM_FAKE_PULL*)self->private_data)->media_th;
- assert(*th == NULL); //once at a time
- *th = gf_th_new("HYB-FM fake external media load thread");
- gf_th_run(*th, ext_media_load_th, self);
-#else
- ext_media_load_th(self);
-#endif
- //wait for video to begin as late video creates desynchro.
- //gf_sleep(5000);
- }
-
- return GF_OK;
-}
-
-/**********************************************************************************************************************/
-
-static GF_Err FM_FAKE_PULL_Disconnect(GF_HYBMEDIA *self)
-{
- FM_FAKE_PULL *priv = (FM_FAKE_PULL*)self->private_data;
- self->owner = NULL;
-#ifdef EXT_MEDIA_LOAD_THREADED
- gf_th_del(priv->media_th);
-#endif
- return GF_OK;
-}
-
-/**********************************************************************************************************************/
-
-static GF_Err FM_FAKE_PULL_GetData(GF_HYBMEDIA *self, char **out_data_ptr, u32 *out_data_size, GF_SLHeader *out_sl_hdr)
-{
- u64 delta_pts = (FM_FAKE_PULL_FRAME_DUR*FM_FAKE_PULL_AUDIO_FREQ)/1000;
- assert(!(FM_FAKE_PULL_FRAME_DUR*FM_FAKE_PULL_AUDIO_FREQ%1000));
-
- /*write SL header*/
- memset(out_sl_hdr, 0, sizeof(GF_SLHeader));
- out_sl_hdr->compositionTimeStampFlag = 1;
- out_sl_hdr->compositionTimeStamp = ((FM_FAKE_PULL*)self->private_data)->PTS;
- out_sl_hdr->accessUnitStartFlag = 1;
-
- /*write audio data*/
- if ((((FM_FAKE_PULL*)self->private_data)->PTS%(10*delta_pts))) {
- *out_data_ptr = ((FM_FAKE_PULL*)self->private_data)->buffer90;
- } else {
- *out_data_ptr = ((FM_FAKE_PULL*)self->private_data)->buffer10;
- }
- *out_data_size = FM_FAKE_PULL_FRAME_LEN;
- ((FM_FAKE_PULL*)self->private_data)->PTS += delta_pts;
-
- return GF_OK;
-}
-
-/**********************************************************************************************************************/
-
-static GF_Err FM_FAKE_PULL_ReleaseData(GF_HYBMEDIA *self)
-{
- return GF_OK;
-}
-
-/**********************************************************************************************************************/
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Romain Bouqueau
- * Copyright (c) Telecom ParisTech 2010-20xx
- * All rights reserved
- *
- * This file is part of GPAC / Hybrid Media input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*hybrid media interface implementation generating fake audio consisting in beeps every second in push mode*/
-
-#include <gpac/thread.h>
-#include <gpac/modules/service.h>
-#include <time.h>
-#include "hyb_in.h"
-
-/**********************************************************************************************************************/
-
-#define EXT_MEDIA_LOAD_THREADED
-
-/**********************************************************************************************************************/
-
-#define FM_FAKE_PUSH_AUDIO_FREQ 22050
-#define FM_FAKE_PUSH_CHAN_NUM 2
-#define FM_FAKE_PUSH_BITS 16
-#define FM_FAKE_PUSH_TYPE s16
-#define FM_FAKE_PUSH_FRAME_DUR 60 /*in ms*/
-#define FM_FAKE_PUSH_FRAME_LEN ((FM_FAKE_PUSH_FRAME_DUR*FM_FAKE_PUSH_CHAN_NUM*FM_FAKE_PUSH_BITS*FM_FAKE_PUSH_AUDIO_FREQ)/(1000*8)) /*in bytes*/
-
-/**********************************************************************************************************************/
-
-typedef struct s_FM_FAKE_PUSH {
- u64 PTS;
- unsigned char buffer10[FM_FAKE_PUSH_FRAME_LEN]; /*played 10 percent of time*/
- unsigned char buffer90[FM_FAKE_PUSH_FRAME_LEN]; /*played 90 percent of time*/
-
- GF_Thread *th;
-#ifdef EXT_MEDIA_LOAD_THREADED
- GF_Thread *media_th;
-#endif
-} FM_FAKE_PUSH;
-FM_FAKE_PUSH FM_FAKE_PUSH_private_data;
-
-/**********************************************************************************************************************/
-
-static Bool FM_FAKE_PUSH_CanHandleURL(const char *url);
-static GF_ObjectDescriptor* FM_FAKE_PUSH_GetOD(void);
-static GF_Err FM_FAKE_PUSH_Connect(GF_HYBMEDIA *self, GF_ClientService *service, const char *url);
-static GF_Err FM_FAKE_PUSH_Disconnect(GF_HYBMEDIA *self);
-static GF_Err FM_FAKE_PUSH_SetState(GF_HYBMEDIA *self, const GF_NET_CHAN_CMD state);
-
-GF_HYBMEDIA master_fm_fake_push = {
- "Fake FM (push mode)", /*name*/
- FM_FAKE_PUSH_CanHandleURL, /*CanHandleURL()*/
- FM_FAKE_PUSH_GetOD, /*GetOD()*/
- FM_FAKE_PUSH_Connect, /*Connect()*/
- FM_FAKE_PUSH_Disconnect, /*Disconnect()*/
- FM_FAKE_PUSH_SetState, /*SetState()*/
- NULL, /*GetData()*/
- NULL, /*ReleaseData()*/
- HYB_PUSH, /*data_mode*/
- &FM_FAKE_PUSH_private_data /*private_data*/
-};
-
-/**********************************************************************************************************************/
-
-static Bool FM_FAKE_PUSH_CanHandleURL(const char *url)
-{
- if (!strnicmp(url, "fm://fake_push", 14))
- return 1;
-
- return 0;
-}
-
-/**********************************************************************************************************************/
-
-static GF_ESD* get_esd()
-{
- GF_BitStream *dsi = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- GF_ESD *esd = gf_odf_desc_esd_new(0);
-
- esd->ESID = 1;
- esd->decoderConfig->streamType = GF_STREAM_AUDIO;
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_RAW_MEDIA_STREAM;
- esd->decoderConfig->avgBitrate = esd->decoderConfig->maxBitrate = 0;
- esd->slConfig->timestampResolution = FM_FAKE_PUSH_AUDIO_FREQ;
-
- /*Decoder Specific Info for raw media*/
- gf_bs_write_u32(dsi, FM_FAKE_PUSH_AUDIO_FREQ); /*u32 sample_rate*/
- gf_bs_write_u16(dsi, FM_FAKE_PUSH_CHAN_NUM); /*u16 nb_channels*/
- gf_bs_write_u16(dsi, FM_FAKE_PUSH_BITS); /*u16 nb_bits_per_sample*/
- gf_bs_write_u32(dsi, FM_FAKE_PUSH_FRAME_LEN); /*u32 frame_size*/
- gf_bs_write_u32(dsi, 0); /*u32 channel_config*/
- gf_bs_get_content(dsi, &esd->decoderConfig->decoderSpecificInfo->data, &esd->decoderConfig->decoderSpecificInfo->dataLength);
- gf_bs_del(dsi);
-
- return esd;
-}
-
-/**********************************************************************************************************************/
-
-static GF_ObjectDescriptor* FM_FAKE_PUSH_GetOD(void)
-{
- /*declare object to terminal*/
- GF_ObjectDescriptor *od = (GF_ObjectDescriptor*)gf_odf_desc_new(GF_ODF_OD_TAG);
- GF_ESD *esd = get_esd();
- od->objectDescriptorID = 1;
- gf_list_add(od->ESDescriptors, esd);
- return od;
-}
-
-/**********************************************************************************************************************/
-
-static GF_Err GetData(const GF_HYBMEDIA *self, char **out_data_ptr, u32 *out_data_size, GF_SLHeader *out_sl_hdr)
-{
- u64 delta_pts = (FM_FAKE_PUSH_FRAME_DUR*FM_FAKE_PUSH_AUDIO_FREQ)/1000;
- assert(!(FM_FAKE_PUSH_FRAME_DUR*FM_FAKE_PUSH_AUDIO_FREQ%1000));
-
- /*write SL header*/
- memset(out_sl_hdr, 0, sizeof(GF_SLHeader));
- out_sl_hdr->compositionTimeStampFlag = 1;
- out_sl_hdr->compositionTimeStamp = ((FM_FAKE_PUSH*)self->private_data)->PTS;
- out_sl_hdr->accessUnitStartFlag = 1;
-
- /*write audio data*/
- if ((((FM_FAKE_PUSH*)self->private_data)->PTS%(10*delta_pts))) {
- *out_data_ptr = ((FM_FAKE_PUSH*)self->private_data)->buffer90;
- } else {
- *out_data_ptr = ((FM_FAKE_PUSH*)self->private_data)->buffer10;
- }
- *out_data_size = FM_FAKE_PUSH_FRAME_LEN;
- ((FM_FAKE_PUSH*)self->private_data)->PTS += delta_pts;
-
- return GF_OK;
-}
-
-/**********************************************************************************************************************/
-
-u32 ext_media_load_th(void *par) {
- GF_HYBMEDIA *self = (GF_HYBMEDIA*) par;
- /*declare object to terminal*/
- GF_ObjectDescriptor *od = (GF_ObjectDescriptor*)gf_odf_desc_new(GF_ODF_OD_TAG);
- od->URLString = gf_strdup("http://gpac.sourceforge.net/screenshots/lion.jpg");
- od->objectDescriptorID = 0;
- gf_sleep(2000); //TODO: remove the sleep
- gf_service_declare_media(self->owner, (GF_Descriptor*)od, 0);
- return 0;
-}
-
-static u32 audio_gen_th(void *par)
-{
- GF_Err e;
- char *data;
- u32 data_size, init_time;
- volatile s32 time_to_wait = 0;
- GF_SLHeader slh;
- GF_HYBMEDIA *self = (GF_HYBMEDIA*) par;
- FM_FAKE_PUSH *fm_fake_push = (FM_FAKE_PUSH*)self->private_data;
- memset(&slh, 0, sizeof(GF_SLHeader));
-
- {
- /*for hybrid scenarios: add an external media*/
- if (1) {
-#ifdef EXT_MEDIA_LOAD_THREADED
- GF_Thread **th = &((FM_FAKE_PUSH*)self->private_data)->media_th;
- assert(*th == NULL); //once at a time
- *th = gf_th_new("HYB-FM fake external media load thread");
- gf_th_run(*th, ext_media_load_th, par);
-#else
- ext_media_load_th(par);
-#endif
- gf_sleep(2000); //TODO: remove the sleep
- }
-
- if (0) {
- time_t now;
- struct tm *now_tm;
- time(&now);
- now_tm = gmtime(&now);
- {
- GF_NetworkCommand com;
- memset(&com, 0, sizeof(com));
- com.command_type = GF_NET_CHAN_MAP_TIME;
-
- com.map_time.media_time = now_tm->tm_hour*3600+now_tm->tm_min*60+now_tm->tm_sec;
- com.map_time.timestamp = slh.compositionTimeStamp;
- com.map_time.reset_buffers = 0;
- com.base.on_channel = self->channel;
- gf_service_command(self->owner, &com, GF_OK);
- GF_LOG(GF_LOG_INFO, GF_LOG_MEDIA, ("[HYB In] Mapping WC Time %04d/%02d/%02d %02d:%02d:%02d and Hyb time "LLD"\n",
- (now_tm->tm_year + 1900), (now_tm->tm_mon + 1), now_tm->tm_mday, now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec,
- com.map_time.timestamp));
- }
- }
-
- /*initialize clock*/
- init_time = gf_sys_clock();
- }
-
- while (self->state >= 0) /*pause or play*/
- {
- if (self->state == HYB_STATE_PAUSE) {
- gf_sleep(10);
- init_time = (u32)(gf_sys_clock() - ((u64)slh.compositionTimeStamp*1000)/FM_FAKE_PUSH_AUDIO_FREQ - 50/*50ms delay*/); /*pause: won't wait at resume*/
- continue;
- }
-
-#if 0
- time_to_wait = (s32)(init_time + ((u64)slh.compositionTimeStamp*1000)/FM_FAKE_PUSH_AUDIO_FREQ - gf_sys_clock());
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[HYB_IN] FM_FAKE_PUSH - %d ms before next AU\n", time_to_wait));
- if (time_to_wait > 0) {
- if (time_to_wait > 1000) /*TODO: understand the big shifts when playing icecasts contents*/
- GF_LOG(GF_LOG_WARNING, GF_LOG_MODULE, ("[HYB_IN] FM_FAKE_PUSH - audio asked to sleep for %d ms\n", time_to_wait));
- gf_sleep(time_to_wait);
- }
-#endif
-
- e = GetData(self, &data, &data_size, &slh);
- gf_service_send_packet(self->owner, self->channel, data, data_size, &slh, e);
- }
-
- self->state = HYB_STATE_STOPPED;
-
- return 0;
-}
-
-/**********************************************************************************************************************/
-
-static void audio_gen_stop(GF_HYBMEDIA *self)
-{
- if (self->state >= 0) { /*only when playing*/
- self->state = HYB_STATE_STOP_REQ;
- while (self->state != HYB_STATE_STOPPED)
- gf_sleep(10);
- }
-}
-
-/**********************************************************************************************************************/
-
-static GF_Err FM_FAKE_PUSH_Connect(GF_HYBMEDIA *self, GF_ClientService *service, const char *url)
-{
- u32 i;
- FM_FAKE_PUSH *priv;
-
- if (!self)
- return GF_BAD_PARAM;
-
- if (!service)
- return GF_BAD_PARAM;
-
- priv = (FM_FAKE_PUSH*)self->private_data;
- if (!priv)
- return GF_BAD_PARAM;
-
- self->owner = service;
-
- /*set audio preloaded data*/
- memset(self->private_data, 0, sizeof(FM_FAKE_PUSH));
- for (i=0; i<(FM_FAKE_PUSH_FRAME_LEN*8)/FM_FAKE_PUSH_BITS; i++) {
- if (((2*i)/(FM_FAKE_PUSH_CHAN_NUM*100))%2) /*100Hz*/
- *((FM_FAKE_PUSH_TYPE*)((FM_FAKE_PUSH*)self->private_data)->buffer10+i) = 1 << (FM_FAKE_PUSH_BITS-1);
- }
-
- assert(!priv->th);
- priv->th = gf_th_new("HYB-FM fake audio generation thread");
- self->state = HYB_STATE_PAUSE;
- gf_th_run(priv->th, audio_gen_th, self);
-
- return GF_OK;
-}
-
-/**********************************************************************************************************************/
-
-static GF_Err FM_FAKE_PUSH_Disconnect(GF_HYBMEDIA *self)
-{
- FM_FAKE_PUSH *priv = (FM_FAKE_PUSH*)self->private_data;
-
- audio_gen_stop(self);
- gf_th_del(priv->th);
-#ifdef EXT_MEDIA_LOAD_THREADED
- gf_th_del(priv->media_th);
-#endif
- priv->th = NULL;
-
- self->owner = NULL;
- return GF_OK;
-}
-
-/**********************************************************************************************************************/
-
-static GF_Err FM_FAKE_PUSH_SetState(GF_HYBMEDIA *self, const GF_NET_CHAN_CMD state)
-{
- switch(state) {
- case GF_NET_CHAN_PLAY:
- self->state = HYB_STATE_PLAYING;
- break;
- case GF_NET_CHAN_STOP:
- audio_gen_stop(self);
- break;
- case GF_NET_CHAN_PAUSE:
- self->state = HYB_STATE_PAUSE;
- break;
- case GF_NET_CHAN_RESUME:
- self->state = HYB_STATE_PLAYING;
- break;
- default:
- return GF_BAD_PARAM;
- }
-
- return GF_OK;
-}
-
-/**********************************************************************************************************************/
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Romain Bouqueau
- * Copyright (c) Telecom ParisTech 2010-20xx
- * All rights reserved
- *
- * This file is part of GPAC / Hybrid Media input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-/*hybrid media interface implementation using MMB Tools from the Communication Research Center Canada (http://mmbtools.crc.ca/)*/
-
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Romain Bouqueau
- * Copyright (c) Telecom ParisTech 2010-20xx
- * All rights reserved
- *
- * This file is part of GPAC / Hybrid Media input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "hyb_in.h"
-
-/*register by hand existing masters*/
-extern GF_HYBMEDIA master_fm_mmbtools;
-extern GF_HYBMEDIA master_fm_fake_pull;
-extern GF_HYBMEDIA master_fm_fake_push;
-
-GF_HYBMEDIA* hyb_masters[] = {
- &master_fm_fake_pull,
- &master_fm_fake_push,
-#ifdef GPAC_CONFIG_ANDROID
- &master_fm_mmbtools,
-#endif
-};
-
-typedef struct {
- /*GPAC Service object (i.e. how this module is seen by the terminal)*/
- GF_ClientService *service;
-
- /*This Hybrid media architecture assumes there is a master media*/
- GF_HYBMEDIA* master;
-
-} GF_HYB_In;
-
-
-static u32 HYB_RegisterMimeTypes(const GF_InputService *plug)
-{
- if (!plug)
- return 0;
-
- return 1;
-}
-
-static Bool HYB_CanHandleURL(GF_InputService *plug, const char *url)
-{
- u32 i;
- const size_t nb_masters = sizeof(hyb_masters) / sizeof(GF_HYBMEDIA*);
-
- for (i=0; i<nb_masters; i++) {
- if (hyb_masters[i]->CanHandleURL(url))
- return 1;
- }
-
- return 0;
-}
-
-static GF_Err hybmedia_sanity_check(GF_HYBMEDIA *master)
-{
- /*these checks need to be upgraded when the interface changes*/
- if (master->data_mode != HYB_PUSH && master->data_mode != HYB_PULL)
- return GF_BAD_PARAM;
-
- if (!master->name) goto error_exit;
- if (!master->CanHandleURL) goto error_exit;
- if (!master->GetOD) goto error_exit;
- if (!master->Connect) goto error_exit;
- if (!master->Disconnect) goto error_exit;
-
- if (master->data_mode == HYB_PUSH) {
- if (!master->SetState) goto error_exit;
- }
-
- if (master->data_mode == HYB_PULL) {
- if (!master->GetData) goto error_exit;
- if (!master->ReleaseData) goto error_exit;
- }
-
- return GF_OK;
-
-error_exit:
- return GF_SERVICE_ERROR;
-}
-
-static GF_Err HYB_ConnectService(GF_InputService *plug, GF_ClientService *serv, const char *url)
-{
- u32 i;
- GF_Err e = GF_OK;
- const size_t nb_masters = sizeof(hyb_masters) / sizeof(GF_HYBMEDIA*);
-
- GF_HYB_In *hyb_in = (GF_HYB_In*)plug->priv;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[HYB_IN] Received Connection request from service %p for %s\n", serv, url));
-
- if (!hyb_in || !serv || !url) return GF_BAD_PARAM;
- hyb_in->service = serv;
-
- /*choose the master service*/
- for (i=0; i<nb_masters; i++) {
- if (hyb_masters[i]->CanHandleURL(url)) {
- hyb_in->master = hyb_masters[i];
- break;
- }
- }
- assert(hyb_in->master);
-
- /*sanity check about the master*/
- e = hybmedia_sanity_check(hyb_in->master);
- if (e) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[HYB_IN] Error - object \"%s\" failed the sanity checks\n", hyb_in->master->name));
- gf_service_connect_ack(hyb_in->service, NULL, e);
- return e;
- }
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[HYB_IN] Selected master object \"%s\" for URL: %s\n", hyb_in->master->name, url));
-
- /*connect the master*/
- e = hyb_in->master->Connect(hyb_in->master, hyb_in->service, url);
- if (e) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[HYB_IN] Error - cannot connect service, wrong URL %s\n", url));
- gf_service_connect_ack(hyb_in->service, NULL, GF_BAD_PARAM);
- return e;
- }
- gf_service_connect_ack(hyb_in->service, NULL, GF_OK);
- gf_service_declare_media(hyb_in->service, (GF_Descriptor*)hyb_in->master->GetOD(), 0);
-
- return GF_OK;
-}
-
-static GF_Err HYB_CloseService(GF_InputService *plug)
-{
- GF_Err e;
- GF_HYB_In *hyb_in = (GF_HYB_In*)plug->priv;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[HYB_IN] Received Close Service (%p) request from terminal\n", ((GF_HYB_In*)plug->priv)->service));
-
- /*force to stop and disconnect the master*/
- hyb_in->master->SetState(hyb_in->master, GF_NET_CHAN_STOP);
- e = hyb_in->master->Disconnect(hyb_in->master);
- if (e) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[HYB_IN] Error - cannot disconnect service %p\n", hyb_in->service));
- gf_service_connect_ack(hyb_in->service, NULL, GF_BAD_PARAM);
- return e;
- }
-
- gf_service_disconnect_ack(hyb_in->service, NULL, GF_OK);
-
- return GF_OK;
-}
-
-static GF_Descriptor *HYB_GetServiceDesc(GF_InputService *plug, u32 expect_type, const char *sub_url)
-{
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[HYB_IN] Received Service Description request from terminal for %s\n", sub_url));
-
- return NULL;
-}
-
-static GF_Err HYB_ConnectChannel(GF_InputService *plug, LPNETCHANNEL channel, const char *url, Bool upstream)
-{
- GF_HYB_In *hyb_in;
- GF_HYBMEDIA *master;
-
- if (!plug || !plug->priv)
- return GF_SERVICE_ERROR;
-
- hyb_in = (GF_HYB_In*)plug->priv;
- master = (GF_HYBMEDIA*)hyb_in->master;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[HYB_IN] Received Channel Connection request from service %p for %s\n", channel, url));
-
- master->channel = channel;
- gf_service_connect_ack(hyb_in->service, channel, GF_OK);
-
- return GF_OK;
-}
-
-static GF_Err HYB_DisconnectChannel(GF_InputService *plug, LPNETCHANNEL channel)
-{
- GF_HYB_In *hyb_in = (GF_HYB_In*)plug->priv;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[HYB_IN] Received Channel Disconnect Service (%p) request from terminal\n", hyb_in->service));
-
- gf_service_disconnect_ack(hyb_in->service, channel, GF_OK);
- hyb_in->master->channel = NULL;
-
- return GF_OK;
-}
-
-static GF_Err HYB_ServiceCommand(GF_InputService *plug, GF_NetworkCommand *com)
-{
- GF_HYB_In *hyb_in = (GF_HYB_In*)plug->priv;
-
- switch (com->command_type) {
- case GF_NET_CHAN_SET_SPEED:
- /*not implemented for push mode*/
- assert(hyb_in->master->data_mode == HYB_PULL);
- return GF_OK;
- case GF_NET_CHAN_INTERACTIVE:
- return GF_NOT_SUPPORTED;
- case GF_NET_CHAN_BUFFER:
- com->buffer.max = com->buffer.min = 0;
- return GF_OK;
- case GF_NET_CHAN_DURATION:
- com->duration.duration = 0;
- return GF_OK;
- case GF_NET_CHAN_PLAY:
- case GF_NET_CHAN_STOP:
- case GF_NET_CHAN_PAUSE:
- case GF_NET_CHAN_RESUME:
- if (hyb_in->master->data_mode == HYB_PUSH)
- return hyb_in->master->SetState(hyb_in->master, com->command_type);
- return GF_OK;
- case GF_NET_CHAN_SET_PULL:
- if (hyb_in->master->data_mode == HYB_PULL)
- return GF_OK;
- else
- return GF_NOT_SUPPORTED; /*we're in push mode*/
- }
-
- return GF_OK;
-}
-
-static Bool HYB_CanHandleURLInService(GF_InputService *plug, const char *url)
-{
- return 0;
-}
-
-static GF_Err HYB_ChannelGetSLP(GF_InputService *plug, LPNETCHANNEL channel, char **out_data_ptr, u32 *out_data_size, GF_SLHeader *out_sl_hdr, Bool *sl_compressed, GF_Err *out_reception_status, Bool *is_new_data)
-{
- GF_HYB_In *hyb_in = (GF_HYB_In*)plug->priv;
- assert(hyb_in->master->data_mode == HYB_PULL && hyb_in->master->GetData && hyb_in->master->ReleaseData);
-
- assert(((GF_HYB_In*)plug->priv)->master->channel == channel);
- hyb_in->master->GetData(hyb_in->master, out_data_ptr, out_data_size, out_sl_hdr);
- *sl_compressed = 0;
- *out_reception_status = GF_OK;
- *is_new_data = 1;
- return GF_OK;
-}
-
-static GF_Err HYB_ChannelReleaseSLP(GF_InputService *plug, LPNETCHANNEL channel)
-{
- GF_HYB_In *hyb_in = (GF_HYB_In*)plug->priv;
- assert(((GF_HYB_In*)plug->priv)->master->channel == channel);
- return GF_OK;
-}
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_NET_CLIENT_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- GF_HYB_In *hyb_in;
- GF_InputService *plug;
- if (InterfaceType != GF_NET_CLIENT_INTERFACE) return NULL;
-
- GF_SAFEALLOC(plug, GF_InputService);
- GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC HYBRID MEDIA Loader", "gpac distribution")
- plug->RegisterMimeTypes= HYB_RegisterMimeTypes;
- plug->CanHandleURL= HYB_CanHandleURL;
- plug->ConnectService= HYB_ConnectService;
- plug->CloseService= HYB_CloseService;
- plug->GetServiceDescriptor= HYB_GetServiceDesc;
- plug->ConnectChannel= HYB_ConnectChannel;
- plug->DisconnectChannel= HYB_DisconnectChannel;
- plug->ServiceCommand= HYB_ServiceCommand;
- plug->CanHandleURLInService=HYB_CanHandleURLInService;
- plug->ChannelGetSLP= HYB_ChannelGetSLP;
- plug->ChannelReleaseSLP= HYB_ChannelReleaseSLP;
-
- GF_SAFEALLOC(hyb_in, GF_HYB_In);
- plug->priv = hyb_in;
-
- return (GF_BaseInterface *)plug;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- GF_LOG(GF_LOG_MEDIA, GF_LOG_ERROR, ("DeleteLoaderInterface %p: 1\n", ifce));
- if (ifce->InterfaceType == GF_NET_CLIENT_INTERFACE) {
- GF_InputService *plug = (GF_InputService*)ifce;
- GF_HYB_In *hyb_in = (GF_HYB_In*)plug->priv;
- gf_free(hyb_in);
- plug->priv = NULL;
- gf_free(plug);
- GF_LOG(GF_LOG_MEDIA, GF_LOG_ERROR, ("DeleteLoaderInterface %p: 2\n", ifce));
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( hyb_in )
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Romain Bouqueau
- * Copyright (c) Telecom ParisTech 2010-20xx
- * All rights reserved
- *
- * This file is part of GPAC / Hybrid Media input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef _HYB_IN_H
-#define _HYB_IN_H
-
-#include <gpac/modules/codec.h>
-#include <gpac/modules/service.h>
-#include <gpac/constants.h>
-
-
-typedef enum {
- HYB_STATE_STOPPED = -2, /*thread received HYB_STATE_STOP_REQ and stopped*/
- HYB_STATE_STOP_REQ = -1, /*user asked to stop*/
- HYB_STATE_PAUSE = 0, /*default state*/
- //HYB_STATE_PLAY_REQ = 1, /*user asked to play*/
- HYB_STATE_PLAYING = 2, /*thread received HYB_STATE_PLAY_REQ and has started playing*/
-} HYB_STATE;
-
-typedef enum {
- HYB_PUSH = 0, /*threaded*/
- HYB_PULL, /*not threaded*/
-} HYB_DATA_MODE;
-
-/*base structure for media hybridation*/
-typedef struct s_GF_HYBMEDIA {
-
- /*object description*/
- const char* name;
-
- /* *** static methods *** */
-
- /*is url handled by this service?*/
- Bool (*CanHandleURL)(const char *url);
-
- /*retrieve object descriptor*/
- GF_ObjectDescriptor* (*GetOD)(void);
-
-
- /* *** other methods *** */
-
- /*create/destroy the object and all its data*/
- GF_Err (*Connect) (struct s_GF_HYBMEDIA *self, GF_ClientService *service, const char *url);
- GF_Err (*Disconnect)(struct s_GF_HYBMEDIA *self);
-
- /*request state from */
- GF_Err (*SetState)(struct s_GF_HYBMEDIA *self, const GF_NET_CHAN_CMD state);
-
- /*in case data retrieval paradigm is pull these two functions shall not be NULL*/
- GF_Err (*GetData) (struct s_GF_HYBMEDIA *self, char **out_data_ptr, u32 *out_data_size, GF_SLHeader *out_sl_hdr); /*only available when data_mode is pull*/
- GF_Err (*ReleaseData)(struct s_GF_HYBMEDIA *self); /*only available when data_mode is pull*/
-
-
- /* *** statically initialized data *** */
-
- /*data retrieval mode: HYB_PUSH or HYB_PULL*/
- HYB_DATA_MODE data_mode;
-
- /*pivate data which type depends on dynamic considerations*/
- void *private_data;
-
-
- /* *** dynamically initialized data *** */
-
- /*object state: play/stop/pause/...*/
- HYB_STATE state;
-
- /*object carrying us (needed to communicate with the player)*/
- GF_ClientService *owner;
- LPNETCHANNEL channel;
-
-} GF_HYBMEDIA;
-
-#endif
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/libplayer
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= libplayer.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_libplayer$(DYN_LIB_SUFFIX)
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac -lplayer $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2005-2012
- * All rights reserved
- *
- * This file is part of GPAC / Dummy input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <gpac/modules/service.h>
-#include <gpac/modules/codec.h>
-/*for GF_STREAM_PRIVATE_SCENE definition*/
-#include <gpac/constants.h>
-#include <gpac/download.h>
-
-//#define TEST_LIBPLAYER
-
-#ifndef TEST_LIBPLAYER
-
-#ifdef WIN32
-typedef u32 uint32_t;
-typedef u8 uint8_t;
-typedef s8 int8_t;
-typedef s32 off_t;
-#endif
-
-#include "player.h"
-
-#endif
-
-// variable used to detect the number of libplayer instances created - up to 2 instances
-static int libplayer_id = 0;
-//! unfortunately, saving data would not be a good solution for Mosaic Mode in ESG Application since the position changes everytime user
-//! uses the navigation button
-// value for input output windows, when save_data_instance1 equals to 1 <=> the second instance is already created with the correct size,
-// save these values in in_instance1 and out_instance1 so that we do not need to recalculate every time
-//~ static video_rect_t in_instance1, out_instance1;
-//~ static save_data_instance1 = 0;
-
-// variable use to detect whether a dvb instance has already started for instance 1
-static int start_dvb = 0;
-
-enum
-{
- PLAYER_FILE = 0,
- PLAYER_DVB = 1
-};
-
-
-typedef struct
-{
- /*the service we're responsible for*/
- GF_ClientService *service;
- u32 init;
- u32 state;
- u32 player_id;
- u32 player_type;
- u32 width;
- u32 height;
- char *url;
-#ifndef TEST_LIBPLAYER
- player_t *player;
-#endif
-
-} LibPlayerIn;
-
-
-static const char * LIBPLAYER_MIME_TYPES[] = {
- "video/x-mpeg", "mpg mpeg mp2 mpa mpe mpv2 ts", "MPEG 1/2 Movies",
- "video/x-mpeg-systems", "mpg mpeg mp2 mpa mpe mpv2", "MPEG 1/2 Movies",
- "audio/basic", "snd au", "Basic Audio",
- "audio/x-wav", "wav", "WAV Audio",
- "audio/vnd.wave", "wav", "WAV Audio",
- "video/x-ms-asf", "asf wma wmv asx asr", "WindowsMedia Movies",
- "video/x-ms-wmv", "asf wma wmv asx asr", "WindowsMedia Movies",
- "video/x-msvideo", "avi", "AVI Movies",
- "video/x-ms-video", "avi", "AVI Movies",
- "video/avi", "avi", "AVI Movies",
- "video/vnd.avi", "avi", "AVI Movies",
- "video/H263", "h263 263", "H263 Video",
- "video/H264", "h264 264", "H264 Video",
- "video/MPEG4", "cmp", "MPEG-4 Video",
- "video/mp4", "mp4", "MPEG-4 Movie",
- "video/quicktime", "mov qt", "QuickTime Movies",
- "video/webm", "webm", "Google WebM Movies",
- "audio/webm", "webm", "Google WebM Music",
- NULL
-};
-
-
-static u32 LIBPLAYER_RegisterMimeTypes(const GF_InputService *plug) {
- u32 i;
- if (!plug)
- return 0;
- for (i = 0 ; LIBPLAYER_MIME_TYPES[i] ; i+=3)
- gf_service_register_mime(plug, LIBPLAYER_MIME_TYPES[i], LIBPLAYER_MIME_TYPES[i+1], LIBPLAYER_MIME_TYPES[i+2]);
- return i / 3;
-}
-
-Bool LIBPLAYER_CanHandleURL(GF_InputService *plug, const char *url)
-{
- char *sExt = strrchr(url, '.');
- if (sExt) {
- u32 i;
- Bool ok = 0;
- char *cgi_par;
- // case dvb
- if (!strnicmp(url, "dvb://", 6)) return 1;
- if (!strnicmp(sExt, ".gz", 3)) sExt = strrchr(sExt, '.');
- if (!strnicmp(url, "rtsp://", 7)) return 0;
- sExt++;
-
- cgi_par = strchr(sExt, '?');
- if (cgi_par) cgi_par[0] = 0;
-
- for (i = 0 ; LIBPLAYER_MIME_TYPES[i] ; i+=3) {
- if (strstr(LIBPLAYER_MIME_TYPES[i+1], sExt)) {
- ok=1;
- break;
- }
- }
- if (cgi_par) cgi_par[0] = '?';
- if (ok) return 1;
- }
-
- return 0;
-}
-
-#ifndef TEST_LIBPLAYER
-
-static int on_libplayer_event(player_event_t e, void *data)
-{
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerEvent] Received event %d\n", e));
-
- switch (e) {
- case PLAYER_EVENT_PLAYBACK_FINISHED:
- player_playback_stop(data);
- player_playback_start(data);
- break;
- case PLAYER_EVENT_FE_HAS_LOCK:
- break;
- case PLAYER_EVENT_FE_TIMEDOUT:
- break;
- case PLAYER_EVENT_VIDEO_PICTURE:
- break;
- default:
- break;
- }
-
- return 0;
-}
-
-
-
-#endif
-
-GF_Err LIBPLAYER_ConnectService(GF_InputService *plug, GF_ClientService *serv, const char *url)
-{
- LibPlayerIn *read = (LibPlayerIn *) plug->priv;
-#ifndef TEST_LIBPLAYER
- mrl_t *mrl = NULL;
-#endif
-
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[LibPlayerIN]Â Connecting\n"));
-
- if (!read || !serv || !url) return GF_BAD_PARAM;
-
- if (!strnicmp(url, "libplayer://", 12)) url+=12;
-
- if (!read->init) {
- read->init=1;
- /* libplayer init with default width/height */
- read->width = 80;
- read->height = 20;
- read->url = url;
- read->player_id = libplayer_id;
- read->player_type = PLAYER_FILE;
-
-#ifndef TEST_LIBPLAYER
- read->player = player_init(PLAYER_TYPE_DUMMY, PLAYER_AO_AUTO, PLAYER_VO_AUTO, PLAYER_MSG_INFO, read->player_id, on_libplayer_event);
-
- if (!read->player) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[LibPlayerIN]Â Failed to instanciate libplayer instance %d\n", read->player_id));
- gf_service_connect_ack(serv, NULL, GF_REMOTE_SERVICE_ERROR);
- return GF_OK;
- }
-#endif
- libplayer_id++;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] Opening URL %s for Player instance %d\n", url, read->player_id));
- }
-
-#ifndef TEST_LIBPLAYER
- mrl = NULL;
-
- // dvb
- if (!strnicmp(url, "dvb://", 6)) {
- read->player_type = PLAYER_DVB;
- mrl_resource_dvb_args_t *mrl_dvb_args;
- mrl_dvb_args = calloc(1, sizeof(mrl_resource_dvb_args_t));
- char *frequency;
-
- // fetch frequency
- if (frequency = strchr(url+6, '@')) {
- char *enc, *pid;
- mrl_dvb_args->frequency = atoi(frequency+1);
-
- /*
- * video
- */
- // video codec
- if (enc = strstr(url+6, "mpeg2")) {
- mrl_dvb_args->video_enc = PLAYER_VIDEO_MPEG2;
- }
- else if (enc = strstr(url+6, "h264")) {
- mrl_dvb_args->video_enc = PLAYER_VIDEO_H264;
- }
- else {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[LibPlayerIN]Â Unknown video encoding\n"));
- mrl_dvb_args->video_enc = PLAYER_VIDEO_UNKNOWN;
- }
-
- // video PID
- if (mrl_dvb_args->video_enc != PLAYER_VIDEO_UNKNOWN) {
- pid = strchr(enc, ':');
- mrl_dvb_args->video_pid = atoi(pid+1);
- }
-
- /*
- * audio
- */
- // audio codec
- if (enc = strstr(url+6, "mp2")) {
- mrl_dvb_args->audio_enc = PLAYER_AUDIO_MP2;
- }
- else if (enc = strstr(url+6, "ac3")) {
- mrl_dvb_args->audio_enc = PLAYER_AUDIO_AC3;
- }
- else {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[LibPlayerIN]Â Unknown audio encoding\n"));
- mrl_dvb_args->audio_enc = PLAYER_AUDIO_UNKNOWN;
- }
-
- // audio PID
- if (mrl_dvb_args->audio_enc != PLAYER_AUDIO_UNKNOWN) {
- pid = strchr(enc, ':');
- mrl_dvb_args->audio_pid = atoi(pid+1);
- }
-
- if (mrl_dvb_args->video_enc == PLAYER_VIDEO_UNKNOWN && mrl_dvb_args->audio_enc == PLAYER_AUDIO_UNKNOWN) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[LibPlayerIN]Â Unknown video and audio encoding\n"));
- free(mrl_dvb_args);
- return GF_BAD_PARAM;
- }
- }
- else {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[LibPlayerIN]Â Unknown frequency\n"));
- free(mrl_dvb_args);
- return GF_BAD_PARAM;
- }
-
- // player instance 1 has not starter yet in dvb case <=> player instance 1 is not created yet
- if (start_dvb == 0) {
- mrl = mrl_new(read->player, MRL_RESOURCE_DVB, mrl_dvb_args);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] MRL created for DVB\n"));
-
- // player has already started, zapping case, make sure the player is not recreated
- } else {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] Starting DVB PES filtering\n"));
- player_dvb_pes_filter_start(read->player, mrl_dvb_args->video_enc, mrl_dvb_args->video_pid, mrl_dvb_args->audio_enc, mrl_dvb_args->audio_pid);
- }
-
- }
- else if (!strnicmp(url, "file://", 7) || !strstr(url, "://")) {
- mrl_resource_local_args_t *mrl_args;
- mrl_args = calloc(1, sizeof(mrl_resource_local_args_t));
- if (!strnicmp(url, "file://", 7)) {
- mrl_args->location = strdup(url + 7);
- } else {
- mrl_args->location = strdup(url);
- }
- mrl = mrl_new (read->player, MRL_RESOURCE_FILE, mrl_args);
-
- }
-
- // only for DVB case to make sure player is only set once
- if (start_dvb == 0) {
- if (!mrl) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[LibPlayerIN] Failed to create MRL for url %s\n", url));
- gf_service_connect_ack(serv, NULL, GF_URL_ERROR);
- return GF_OK;
- }
-
- player_mrl_set(read->player, mrl);
- }
-
-#endif
- read->state = 0;
- read->service = serv;
-
- /*ACK connection is OK*/
- gf_service_connect_ack(serv, NULL, GF_OK);
-
-
- /*setup LIBPLAYER object descriptor*/
- {
- GF_ESD *esd;
- GF_ObjectDescriptor *od = (GF_ObjectDescriptor *) gf_odf_desc_new(GF_ODF_OD_TAG);
- od->objectDescriptorID = 1+read->player_id;
-
- esd = gf_odf_desc_esd_new(0);
- esd->ESID = 1+read->player_id;
- esd->slConfig->timestampResolution = 1000;
- esd->decoderConfig->streamType = GF_STREAM_PRIVATE_MEDIA;
- esd->decoderConfig->objectTypeIndication = GPAC_OTI_PRIVATE_MEDIA_LIBPLAYER;
-#ifndef TEST_LIBPLAYER
- esd->decoderConfig->decoderSpecificInfo->data = read;
-#endif
-
- gf_list_add(od->ESDescriptors, esd);
- gf_service_declare_media(read->service, (GF_Descriptor*)od, 0);
- }
-
- return GF_OK;
-}
-
-GF_Err LIBPLAYER_CloseService(GF_InputService *plug)
-{
- LibPlayerIn *read = (LibPlayerIn *) plug->priv;
-
-#ifndef TEST_LIBPLAYER
- // only disconnect if
- if (read->player_type == PLAYER_FILE) {
- player_playback_stop(read->player);
- fprintf(stderr, "[LibPlayerIN]player_playback_stop for instance %d\n", read->player_id);
- player_uninit(read->player);
- fprintf(stderr, "[LibPlayerIN]player_uninit for instance %d\n", read->player_id);
- read->player = NULL;
- libplayer_id--;
-
- read->state = 0;
-
- gf_service_disconnect_ack(read->service, NULL, GF_OK);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIn] Closing libplayer instance %d\n", read->player_id));
-
-
-
- // channel zapping dvb case, don't disconnect service
- } else {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIn] Don't close service libplayer instance %d, use this instance for channel zapping\n", read->player_id));
- }
-
- return GF_OK;
-#endif
-}
-
-/*Dummy input just send a file name, no multitrack to handle so we don't need to check sub_url nor expected type*/
-static GF_Descriptor *LIBPLAYER_GetServiceDesc(GF_InputService *plug, u32 expect_type, const char *sub_url)
-{
- return NULL;
-}
-
-
-GF_Err LIBPLAYER_ServiceCommand(GF_InputService *plug, GF_NetworkCommand *com)
-{
- LibPlayerIn *read = (LibPlayerIn *) plug->priv;
- unsigned long prop = 0;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] ServiceCommand for instance %d, read->state=%d\n", read->player_id, read->state));
- if (!com->base.on_channel) return GF_NOT_SUPPORTED;
-
- if (com->command_type==GF_NET_SERVICE_HAS_AUDIO) return GF_NOT_SUPPORTED;
-
- switch (com->command_type) {
- case GF_NET_CHAN_SET_PULL:
- return GF_NOT_SUPPORTED;
- case GF_NET_CHAN_INTERACTIVE:
- return GF_OK;
- /*since data is file-based, no padding is needed (decoder plugin will handle it itself)*/
- case GF_NET_CHAN_SET_PADDING:
- return GF_OK;
- case GF_NET_CHAN_BUFFER:
- return GF_OK;
- com->buffer.max = com->buffer.min = 0;
- return GF_OK;
- case GF_NET_CHAN_DURATION:
- /*this module is not made for updates, use undefined duration*/
- com->duration.duration = -1;
- return GF_OK;
- case GF_NET_CHAN_PLAY:
- if (read->state==0) {
-#ifndef TEST_LIBPLAYER
- if ((read->player_id == 0) && (read->player_type == PLAYER_DVB) && (start_dvb == 1)) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] Instance %d has already started, zapping mode\n", read->player_id));
-
- } else {
- player_playback_start(read->player);
- if ((read->player_id == 0) && (read->player_type == PLAYER_DVB)) {
- start_dvb = 1;
- }
-
- read->state = 1;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] Starting playback for instance %d\n", read->player_id));
- }
-#endif
- }
-
- return GF_OK;
- case GF_NET_CHAN_STOP:
- if (read->state==1) {
-#ifndef TEST_LIBPLAYER
- // channel zapping, don't stop channel
- if ((read->player_id == 0) && (read->player_type == PLAYER_DVB) && (start_dvb = 1)) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] Instance %d is in zapping mode, don't stop channel\n", read->player_id));
- } else {
- player_playback_stop(read->player);
- read->state = 0;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] Stopping playback for instance %d\n", read->player_id));
- }
-#endif
- }
- return GF_OK;
- case GF_NET_CHAN_CONFIG:
- return GF_OK;
- case GF_NET_CHAN_GET_DSI:
- com->get_dsi.dsi = NULL;
- com->get_dsi.dsi_len = 0;
- return GF_OK;
- }
- return GF_OK;
-}
-
-GF_Err LIBPLAYER_ConnectChannel(GF_InputService *plug, LPNETCHANNEL channel, const char *url, Bool upstream)
-{
- u32 ESID;
- LibPlayerIn *read = (LibPlayerIn *) plug->priv;
- sscanf(url, "ES_ID=%ud", &ESID);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] instance %d connect channel %d\n", read->player_id, ESID));
- if (ESID != 1+read->player_id) {
- gf_service_connect_ack(read->service, channel, GF_STREAM_NOT_FOUND);
- } else {
- gf_service_connect_ack(read->service, channel, GF_OK);
- }
- return GF_OK;
-}
-
-GF_Err LIBPLAYER_DisconnectChannel(GF_InputService *plug, LPNETCHANNEL channel)
-{
- LibPlayerIn *read = (LibPlayerIn *) plug->priv;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] instance %d disconnect channel\n", read->player_id));
- gf_service_disconnect_ack(read->service, channel, GF_OK);
- return GF_OK;
-}
-
-
-
-Bool LIBPLAYER_CanHandleURLInService(GF_InputService *plug, const char *url)
-{
- return 0;
- //return 1;
-}
-
-static GF_Err LIBPLAYER_AttachStream(GF_BaseDecoder *dec, GF_ESD *esd)
-{
- LibPlayerIn *read;
-
- if (dec->privateStack) return GF_BAD_PARAM;
- if (!esd->decoderConfig->decoderSpecificInfo) return GF_BAD_PARAM;
- if (!esd->decoderConfig->decoderSpecificInfo->data) return GF_BAD_PARAM;
- read = (LibPlayerIn *) esd->decoderConfig->decoderSpecificInfo->data;
- if (esd->ESID!=1+read->player_id) return GF_BAD_PARAM;
- dec->privateStack = read;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] AttachStream for instance %d\n", read->player_id));
- esd->decoderConfig->decoderSpecificInfo->data = NULL;
- return GF_OK;
-}
-
-static GF_Err LIBPLAYER_DetachStream(GF_BaseDecoder *dec, u16 ES_ID)
-{
- LibPlayerIn *player = dec->privateStack;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] DetachStream for instance %d\n", player ? player->player_id : -1));
- dec->privateStack = NULL;
- return GF_OK;
-}
-static GF_Err LIBPLAYER_GetCapabilities(GF_BaseDecoder *dec, GF_CodecCapability *capability)
-{
- LibPlayerIn *read = dec->privateStack;
- //GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] GetCapabilities\n"));
- switch (capability->CapCode) {
- case GF_CODEC_WIDTH:
- capability->cap.valueInt = read->width;
- break;
- case GF_CODEC_HEIGHT:
- capability->cap.valueInt = read->height;
- break;
- }
- return GF_OK;
-}
-static GF_Err LIBPLAYER_SetCapabilities(GF_BaseDecoder *dec, GF_CodecCapability capability)
-{
- return GF_NOT_SUPPORTED;
-}
-static u32 LIBPLAYER_CanHandleStream(GF_BaseDecoder *dec, u32 StreamType, GF_ESD *esd, u8 PL)
-{
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] CanHandleStream\n"));
- if (StreamType!=GF_STREAM_PRIVATE_MEDIA) return GF_CODEC_NOT_SUPPORTED;
- /*don't reply to media type queries*/
- if (!esd) return GF_CODEC_NOT_SUPPORTED;
- if (esd->decoderConfig->objectTypeIndication==GPAC_OTI_PRIVATE_MEDIA_LIBPLAYER) return GF_CODEC_SUPPORTED;
- return GF_CODEC_NOT_SUPPORTED;
-}
-static const char *LIBPLAYER_GetName(GF_BaseDecoder *dec)
-{
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] GetName\n"));
- return "LibPlayer decoder";
-}
-
-static GF_Err LIBPLAYER_Control(GF_PrivateMediaDecoder *dec, Bool mute, GF_Window *src, GF_Window *dst)
-{
-#ifndef TEST_LIBPLAYER
- video_rect_t in, out;
- LibPlayerIn *read = dec->privateStack;
- u32 width, height;
-
- if (!read) return GF_OK;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] Control instance %d\n",read->player_id));
- //! unfortunately, saving data would not be a good solution for Mosaic Mode in ESG Application since the position changes everytime user
- //! uses the navigation button
- //~ if (read->player_id == 1 && save_data_instance1 == 1) {
- //~ fprintf(stderr, "in here for save data instance\n");
- //~ player_video_io_windows_set(read->player, &in_instance1, &out_instance1);
- //~
- //~ return GF_OK;
- //~
- //~ } else {
- width = mrl_get_property(read->player, NULL, MRL_PROPERTY_VIDEO_WIDTH);
- height = mrl_get_property(read->player, NULL, MRL_PROPERTY_VIDEO_HEIGHT);
- //~ }
-
-
-
- if((width != read->width) || (height != read->height)) {
- fprintf(stderr, "in here for video size changed\t");
- fprintf(stderr, "width %d read->width %d height %d read->height %d\n", width, read->width, height, read->height);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] video size changed to width %d - height %d\n", width, height));
- if (width && height) {
- read->width = width;
- read->height = height;
- }
- return GF_BUFFER_TOO_SMALL;
- }
-
- in.x = src->x;
- in.y = src->y;
- in.w = src->w;
- in.h = src->h;
- out.x = dst->x;
- out.y = dst->y;
- out.w = dst->w;
- out.h = dst->h;
- player_video_io_windows_set(read->player, &in, &out);
-
- //! unfortunately, saving data would not be a good solution for Mosaic Mode in ESG Application since the position changes everytime user
- //! uses the navigation button
- //~ if (read->player_id == 1) {
- //~ in_instance1 = in;
- //~ // //~ out_instance1.w = out.w;
- //~ // //~ out_instance1.h = out.h;
- //~ out_instance1 = out;
- //~ save_data_instance1 = 1;
- //~ }
- //~
-
-#endif
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] Repositioning video src %d %d %d %d - dest %d %d %d %d\n", src->x, src->y, src->w, src->h, dst->x, dst->y, dst->w, dst->h) );
- return GF_OK;
-}
-
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_NET_CLIENT_INTERFACE,
- GF_PRIVATE_MEDIA_DECODER_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_NET_CLIENT_INTERFACE) {
- LibPlayerIn *read;
- GF_InputService *plug;
- GF_SAFEALLOC(plug, GF_InputService);
- memset(plug, 0, sizeof(GF_InputService));
- GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "LibPlayer Input", "gpac distribution")
-
- plug->RegisterMimeTypes = LIBPLAYER_RegisterMimeTypes;
- plug->CanHandleURL = LIBPLAYER_CanHandleURL;
- plug->ConnectService = LIBPLAYER_ConnectService;
- plug->CloseService = LIBPLAYER_CloseService;
- plug->GetServiceDescriptor = LIBPLAYER_GetServiceDesc;
- plug->ConnectChannel = LIBPLAYER_ConnectChannel;
- plug->DisconnectChannel = LIBPLAYER_DisconnectChannel;
- plug->ServiceCommand = LIBPLAYER_ServiceCommand;
- plug->CanHandleURLInService = LIBPLAYER_CanHandleURLInService;
-
- GF_SAFEALLOC(read, LibPlayerIn);
- plug->priv = read;
- return (GF_BaseInterface *)plug;
-
- } else if (InterfaceType == GF_PRIVATE_MEDIA_DECODER_INTERFACE) {
- GF_PrivateMediaDecoder *ifce;
-
- GF_SAFEALLOC(ifce, GF_PrivateMediaDecoder);
- GF_REGISTER_MODULE_INTERFACE(ifce, GF_PRIVATE_MEDIA_DECODER_INTERFACE, "LibPlayer Decoder", "gpac distribution")
-
- /*setup our own interface*/
- ifce->AttachStream = LIBPLAYER_AttachStream;
- ifce->DetachStream = LIBPLAYER_DetachStream;
- ifce->GetCapabilities = LIBPLAYER_GetCapabilities;
- ifce->SetCapabilities = LIBPLAYER_SetCapabilities;
- ifce->Control = LIBPLAYER_Control;
- ifce->CanHandleStream = LIBPLAYER_CanHandleStream;
- ifce->GetName = LIBPLAYER_GetName;
- return (GF_BaseInterface *) ifce;
- }
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *bi)
-{
- if (bi->InterfaceType==GF_NET_CLIENT_INTERFACE) {
- GF_InputService *ifcn = (GF_InputService*)bi;
- LibPlayerIn *read = (LibPlayerIn*)ifcn->priv;
- gf_free(read);
- gf_free(bi);
- } else if (bi->InterfaceType == GF_PRIVATE_MEDIA_DECODER_INTERFACE) {
- gf_free(bi);
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( libplayer )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/mse_in
-
-CFLAGS= $(OPTFLAGS) -w -I"$(SRC_PATH)/include" -Wall
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g -DDEBUG
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#libsj specific flags
-ifeq ($(CONFIG_JS),no)
-else
-CFLAGS+=$(JS_FLAGS)
-ifeq ($(CONFIG_JS),local)
-NEED_LOCAL_LIB=yes
-LOCAL_LIB+=-L../../extra_lib/lib/gcc
-endif
-ifeq ($(CONFIG_JS),prefix)
-NEED_LOCAL_LIB=yes
-LOCAL_LIB+=-L$(prefix)/$(libdir)
-endif
-LINKLIBS+= $(JS_LIBS)
-endif
-
-#common obj
-OBJS=mse_in.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_mse_in$(DYN_LIB_SUFFIX)
-
-all: $(LIB)
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac $(LDFLAGS)
-ifeq ($(STATICBUILD),yes)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/gm_mse_in-static$(DYN_LIB_SUFFIX) $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac_static $(LDFLAGS)
-endif
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Cyril Concolato, Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2013-
- * All rights reserved
- *
- * This file is part of GPAC / Media Source input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/modules/service.h>
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/html5_mse.h>
-
-#ifndef GPAC_DISABLE_MSE
-
-typedef struct __mse_module
-{
- GF_HTML_MediaSource *mediasource;
- GF_InputService *plug;
-} GF_MSE_In;
-
-/* The MSE plugin has no MIME type associated, it cannot handle basic media resources (it needs a blob)*/
-static u32 MSE_RegisterMimeTypes(const GF_InputService *plug)
-{
- return 0;
-}
-
-/* Only Blob URL are supported */
-static Bool MSE_CanHandleURL(GF_InputService *plug, const char *url)
-{
- if (!plug || !url)
- return GF_FALSE;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received CanHandleURL request from terminal for URL '%s'\n", url));
- if (!strncmp(url, "blob:", 5)) {
- return GF_TRUE;
- } else {
- return GF_FALSE;
- }
-}
-
-/* Returns the source buffer associated with the terminal channel */
-static GF_HTML_SourceBuffer *MSE_GetSourceBufferForChannel(GF_HTML_MediaSource *mediasource, LPNETCHANNEL channel)
-{
- GF_Channel *ch;
- if (!channel || !mediasource) {
- return NULL;
- } else {
- u32 i;
- GF_InputService *parser;
- ch = (GF_Channel *) channel;
- assert(ch->odm && ch->odm->ID);
-#if FILTER_FIXME
- parser = (GF_InputService *) ch->odm->OD->service_ifce;
-#else
- parser=NULL;
-#endif
- if (!parser) return NULL;
- for (i = 0; i < gf_list_count(mediasource->sourceBuffers.list); i++) {
- GF_HTML_SourceBuffer *sb = (GF_HTML_SourceBuffer *)gf_list_get(mediasource->sourceBuffers.list, i);
- if (sb && sb->parser && sb->parser == parser) return sb;
- }
- return NULL;
- }
-}
-
-/* For a given source buffer, returns the media track associated with the terminal channel object
- Association is saved during the ConnectChannel operation */
-static GF_HTML_Track *MSE_GetTrackForChannel(GF_HTML_SourceBuffer *sb, LPNETCHANNEL channel)
-{
- u32 i;
- u32 count;
- count = gf_list_count(sb->tracks);
- for (i = 0; i < count; i++)
- {
- GF_HTML_Track *track = (GF_HTML_Track *)gf_list_get(sb->tracks, i);
- if (track->channel == channel)
- {
- return track;
- }
- }
- return NULL;
-}
-
-/* For a given source buffer, returns the media track associated with the given ESID
- Association is saved when the initialisation segment has been parsed */
-static GF_HTML_Track *gf_mse_get_track_by_esid(GF_HTML_SourceBuffer *sb, u32 ESID)
-{
- GF_HTML_Track *track;
- u32 i;
- u32 count;
- count = gf_list_count(sb->tracks);
- for (i=0; i<count; i++)
- {
- track = (GF_HTML_Track *)gf_list_get(sb->tracks, i);
- if (track->bin_id == ESID)
- {
- return track;
- }
- }
- return NULL;
-}
-
-/* We connect the channel only if the sourcebuffer has been created,
- and a track with the right ESID has been found in the init segment */
-static GF_Err MSE_ConnectChannel(GF_InputService *plug, LPNETCHANNEL channel, const char *url, Bool upstream)
-{
- u32 ESID;
- GF_MSE_In *msein = (GF_MSE_In*) plug->priv;
- GF_HTML_SourceBuffer *sb = MSE_GetSourceBufferForChannel(msein->mediasource, channel);
- if (!plug || !plug->priv || !sb || !sb->parser) return GF_SERVICE_ERROR;
- if (strstr(url, "ES_ID")) {
- GF_HTML_Track *track;
- sscanf(url, "ES_ID=%u", &ESID);
- track = gf_mse_get_track_by_esid(sb, ESID);
- if (!track) {
- return GF_BAD_PARAM;
- } else {
- track->channel = channel;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received Channel Connection request on Service %p from terminal for URL '%s#%s'\n", channel, msein->mediasource->blobURI, url));
- return sb->parser->ConnectChannel(sb->parser, channel, url, upstream);
- }
- } else {
- return GF_BAD_PARAM;
- }
-}
-
-static GF_Err MSE_DisconnectChannel(GF_InputService *plug, LPNETCHANNEL channel)
-{
- GF_MSE_In *msein = (GF_MSE_In*) plug->priv;
- GF_HTML_Track *track;
- GF_HTML_SourceBuffer *sb = MSE_GetSourceBufferForChannel(msein->mediasource, channel);
- if (!plug || !plug->priv || !sb || !sb->parser) return GF_SERVICE_ERROR;
- track = MSE_GetTrackForChannel(sb, channel);
- if (track) {
- track->channel = NULL;
- }
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received Disconnect channel request on Service %p from terminal for channel %p\n", msein->mediasource->service, channel));
- return sb->parser->DisconnectChannel(sb->parser, channel);
-}
-
-/* Upon service connection, if the URL is a blobURL, we do the following:
- - get the associated MediaSource object, mark it as used
- - trigger a source event to the media node associated with the service */
-static GF_Err MSE_ConnectService(GF_InputService *plug, GF_ClientService *serv, const char *url)
-{
- GF_MSE_In *msein = (GF_MSE_In*) plug->priv;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received Service Connection request on Service %p from terminal for URL '%s'\n", serv, url));
- if (!msein|| !serv || !url) {
- return GF_BAD_PARAM;
- } else {
- GF_HTML_MediaSource *ms = NULL;
-
- sscanf(url, "blob:%p", &ms);
- msein->mediasource = ms;
- ms->reference_count++;
- ms->service = serv;
- gf_mse_mediasource_open(ms, serv->owner->mo);
- return GF_OK;
- }
-}
-
-/* There is no service description (no MPEG-4 IOD) for this module, the associated scene will be generated dynamically */
-static GF_Descriptor *MSE_GetServiceDesc(GF_InputService *plug, u32 expect_type, const char *sub_url)
-{
- GF_MSE_In *msein = (GF_MSE_In*) plug->priv;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received Service Description request on Service %p from terminal for URL '%s'\n", msein->mediasource->service, sub_url));
- return NULL;
-}
-
-/* Indicate that the media source object is unused anymore */
-static GF_Err MSE_CloseService(GF_InputService *plug)
-{
- GF_MSE_In *msein = (GF_MSE_In*) plug->priv;
- assert( msein );
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received Close Service request on Service %p from terminal for URL '%s'\n", msein->mediasource->service, msein->mediasource->blobURI));
- if (msein->mediasource) {
- gf_service_disconnect_ack(msein->mediasource->service, NULL, GF_OK);
- gf_mse_mediasource_del(msein->mediasource, GF_FALSE);
- msein->mediasource = NULL;
- }
- return GF_OK;
-}
-
-/* Forward all the commands received from the the terminal
- to the parser associated with the channel on which the command is received */
-static GF_Err MSE_ServiceCommand(GF_InputService *plug, GF_NetworkCommand *com)
-{
- GF_MSE_In *msein = (GF_MSE_In*) plug->priv;
- GF_HTML_SourceBuffer *sb = NULL;
-
- if (!plug || !plug->priv || !com ) return GF_SERVICE_ERROR;
-
- /* channel independant commands */
- switch (com->command_type) {
- case GF_NET_SERVICE_INFO:
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received Info command from terminal on Service %p for URL '%s'\n", msein->mediasource->service, msein->mediasource->blobURI));
- return GF_NOT_SUPPORTED;
- case GF_NET_SERVICE_HAS_AUDIO:
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received HasAudio command from terminal on Service %p for URL '%s'\n", msein->mediasource->service, msein->mediasource->blobURI));
- return GF_OK;
- case GF_NET_SERVICE_QUALITY_SWITCH:
- return GF_NOT_SUPPORTED;
- default:
- break;
- }
-
- if (!com->base.on_channel) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received unknown command %d from terminal on Service %p for URL '%s'\n", com->command_type, msein->mediasource->service, msein->mediasource->blobURI));
- return GF_NOT_SUPPORTED;
- }
- sb = MSE_GetSourceBufferForChannel(msein->mediasource, com->base.on_channel);
- if (!sb || !sb->parser) {
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] SourceBuffer not ready on Service %p for URL '%s'\n", msein->mediasource->service, msein->mediasource->blobURI));
- return GF_NOT_SUPPORTED;
- }
-
- switch (com->command_type) {
- case GF_NET_CHAN_PLAY:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_STOP:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_PAUSE:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_RESUME:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_SET_SPEED:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_CONFIG:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_DURATION:
- /* Ignore the duration given by the input service and
- Note: the duration of the initial segment will be 0 anyway (in MP4).*/
- com->duration.duration = 0;
- return GF_OK;
-
- case GF_NET_CHAN_BUFFER:
- com->buffer.max = com->buffer.min = 0;
- return GF_OK;
-
- case GF_NET_CHAN_BUFFER_QUERY:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_GET_DSI:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_SET_PADDING:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_SET_PULL:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- case GF_NET_CHAN_INTERACTIVE:
- /* we are interactive */
- return GF_OK;
-
- case GF_NET_CHAN_GET_PIXEL_AR:
- return sb->parser->ServiceCommand(sb->parser, com);
-
- default:
- return sb->parser->ServiceCommand(sb->parser, com);
- }
-}
-
-/* Forward the request for a new packet to the track (ask the parser to parse a new buffer or use already parsed AU) */
-static GF_Err MSE_ChannelGetSLP(GF_InputService *plug, LPNETCHANNEL channel, char **out_data_ptr, u32 *out_data_size,
- GF_SLHeader *out_sl_hdr, Bool *sl_compressed, GF_Err *out_reception_status, Bool *is_new_data)
-{
- GF_MSE_In *msein = (GF_MSE_In*) plug->priv;
- GF_HTML_SourceBuffer *sb = MSE_GetSourceBufferForChannel(msein->mediasource, channel);
- GF_HTML_Track *track = MSE_GetTrackForChannel(sb, channel);
- if (!plug || !plug->priv || !sb || !sb->parser || !track) return GF_SERVICE_ERROR;
- gf_mse_track_buffer_get_next_packet(track, out_data_ptr, out_data_size, out_sl_hdr, sl_compressed, out_reception_status, is_new_data);
- return GF_OK;
-}
-
-/* Indicate to the track that a packet can be released (and potentially deleted) */
-static GF_Err MSE_ChannelReleaseSLP(GF_InputService *plug, LPNETCHANNEL channel)
-{
- GF_MSE_In *msein = (GF_MSE_In*) plug->priv;
- GF_HTML_SourceBuffer *sb = MSE_GetSourceBufferForChannel(msein->mediasource, channel);
- GF_HTML_Track *track = MSE_GetTrackForChannel(sb, channel);
- if (!plug || !plug->priv || !sb || !sb->parser || !track) return GF_SERVICE_ERROR;
- gf_mse_track_buffer_release_packet(track);
- return GF_OK;
-}
-
-/* This module can only handle one blobURL at a time */
-static Bool MSE_CanHandleURLInService(GF_InputService *plug, const char *url)
-{
- GF_MSE_In *msein = (GF_MSE_In*) plug->priv;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[MSE_IN] Received CanHandleURLInService request on service %p from terminal for URL '%s'\n", msein->mediasource->service, url));
- if (!plug || !plug->priv) return GF_FALSE;
- if (!strcmp(url, msein->mediasource->blobURI)) {
- return GF_TRUE;
- } else {
- return GF_FALSE;
- }
-}
-
-#endif //GPAC_DISABLE_MSE
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
-#ifndef GPAC_DISABLE_MSE
- GF_NET_CLIENT_INTERFACE,
-#endif
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
-#ifdef GPAC_DISABLE_MSE
- return NULL;
-#else
- GF_MSE_In *msein;
- GF_InputService *plug;
- if (InterfaceType != GF_NET_CLIENT_INTERFACE) return NULL;
-
- GF_SAFEALLOC(plug, GF_InputService);
- if (!plug) return NULL;
- GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC MSE Loader", "gpac distribution")
-
- GF_SAFEALLOC(msein, GF_MSE_In);
- if (!msein) {
- gf_free(plug);
- return NULL;
- }
-
- plug->RegisterMimeTypes = MSE_RegisterMimeTypes;
- plug->CanHandleURL = MSE_CanHandleURL;
- plug->ConnectService = MSE_ConnectService;
- plug->CloseService = MSE_CloseService;
- plug->GetServiceDescriptor = MSE_GetServiceDesc;
- plug->ConnectChannel = MSE_ConnectChannel;
- plug->DisconnectChannel = MSE_DisconnectChannel;
- plug->ServiceCommand = MSE_ServiceCommand;
- plug->CanHandleURLInService = MSE_CanHandleURLInService;
- plug->ChannelGetSLP = MSE_ChannelGetSLP;
- plug->ChannelReleaseSLP = MSE_ChannelReleaseSLP;
-
- plug->priv = msein;
- msein->plug = plug;
- return (GF_BaseInterface *)plug;
-#endif
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *bi)
-{
-#ifndef GPAC_DISABLE_MSE
- GF_MSE_In *msein;
-
- if (bi->InterfaceType!=GF_NET_CLIENT_INTERFACE) return;
-
- msein = (GF_MSE_In*) ((GF_InputService*)bi)->priv;
- assert(msein);
- gf_free(msein);
- gf_free(bi);
-#endif
-}
-
-GPAC_MODULE_STATIC_DECLARATION( mse_in )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/netctrl
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-LINKLIBS= -lgpac
-LOCAL_LIB=../../bin/gcc
-
-#common objects
-OBJS=netctrl.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_netctrl$(DYN_LIB_SUFFIX)
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L$(LOCAL_LIB) $(LINKLIBS) $(LDFLAGS)
-
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2011-2012
- * All rights reserved
- *
- * This file is part of GPAC / Sampe On-Scvreen Display sub-project
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/modules/term_ext.h>
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/compositor_dev.h>
-#include <gpac/nodes_mpeg4.h>
-#include <gpac/network.h>
-
-#define XMIN 160
-#define XMAX 480
-
-#define YMAX 360
-#define YMIN 120
-
-typedef struct
-{
- GF_Terminal *term;
- GF_Socket *sock;
- Bool mouse_down;
- u32 cnt;
- Float last_min_x, last_max_x, last_min_y, last_max_y;
-} GF_NetControl;
-
-static Bool netctrl_process(GF_TermExt *termext, u32 action, void *param)
-{
- const char *sOpt, *server_ip;
- int port;
- Float face_min_x, face_max_x, face_min_y, face_max_y, gaze_x, gaze_y;
- GF_Event event;
- GF_NetControl *netctrl = termext->udta;
- char message[1024];
- GF_Err e;
- u32 bytes;
- u32 face = 0;
-
- switch (action) {
- case GF_TERM_EXT_START:
- netctrl->term = (GF_Terminal *) param;
-
- sOpt = gf_opts_get_key("NetControler", "Enabled");
- if (!sOpt || strcmp(sOpt, "yes")) return 0;
- sOpt = gf_opts_get_key("NetControler", "ServerIP");
- if (sOpt) server_ip = sOpt;
- else server_ip = "127.0.0.1";
- sOpt = gf_opts_get_key("NetControler", "Port");
- if (sOpt) port = atoi(sOpt);
- else port = 20320;
-
- termext->caps |= GF_TERM_EXTENSION_NOT_THREADED;
- netctrl->sock = gf_sk_new(GF_SOCK_TYPE_UDP);
-
- if (netctrl->sock < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_INTERACT, ("[NetControl] Failed to open socket for %s:%d\n", server_ip, port));
- return 0;
- }
-
- e = gf_sk_bind(netctrl->sock, server_ip, port, NULL, 0, 0);
- if (e != GF_OK) {
- if (netctrl->sock) gf_sk_del(netctrl->sock);
- netctrl->sock = NULL;
- GF_LOG(GF_LOG_ERROR, GF_LOG_INTERACT, ("[NetControl] Failed to bind to socket %s:%d\n", server_ip, port));
- return 0;
- }
-
- return 1;
-
- case GF_TERM_EXT_STOP:
- if (netctrl->sock) gf_sk_del(netctrl->sock);
- break;
-
- case GF_TERM_EXT_PROCESS:
- gf_sk_receive(netctrl->sock, message, 1024, 0, &bytes);
- if (!bytes) break;
- message[bytes] = '\0';
- GF_LOG(GF_LOG_DEBUG, GF_LOG_INTERACT, ("[NetControl] received message %s\n", message));
-
- if (!strncmp(message, "gpac splice ", 12) || !strncmp(message, "gpac add ", 9)
- || !strncmp(message, "gpac select ", 12)
- ) {
- gf_term_scene_update(netctrl->term, NULL, message);
- break;
- }
-
- if (strncmp(message, "gpac:face=", 10)) break;
-
- sscanf(message, "gpac:face=%d,%f,%f,%f,%f", &face, &face_min_x, &face_max_x, &face_min_y, &face_max_y);
-
-
- memset(&event, 0, sizeof(GF_Event));
- event.mouse.button = GF_MOUSE_LEFT;
- if (face == 0) {
- if (netctrl->last_min_x < 0.01) {
- netctrl->term->compositor->auto_rotate = 2;
- } else if (netctrl->last_max_x > 0.90) {
- netctrl->term->compositor->auto_rotate = 1;
- } else if (netctrl->last_min_y < 0.01) {
- netctrl->term->compositor->auto_rotate = 4;
- } else if (netctrl->last_max_y > 0.90) {
- netctrl->term->compositor->auto_rotate = 3;
- } else {
- netctrl->cnt++;
- if ((netctrl->cnt>=50) && (netctrl->mouse_down)) {
- netctrl->term->compositor->auto_rotate = 0;
- netctrl->mouse_down = GF_FALSE;
- event.type = GF_EVENT_MOUSEUP;
- netctrl->term->compositor->video_out->on_event(netctrl->term->compositor->video_out->evt_cbk_hdl, &event);
- }
- }
- break;
- }
-
- netctrl->last_min_x = face_min_x;
- netctrl->last_max_x = face_max_x;
- netctrl->last_min_y = face_min_y;
- netctrl->last_max_y = face_max_y;
-
- gaze_x = (face_min_x+face_max_x)/2;
- gaze_y = (face_min_y+face_max_y)/2;
-
- event.mouse.x = (1-gaze_x) * netctrl->term->compositor->display_width;
- event.mouse.y = (1-gaze_y) * netctrl->term->compositor->display_height;
-
- if (!netctrl->mouse_down) {
- //don't grab if mouse is down
- if (netctrl->term->compositor->navigation_state) break;
- netctrl->mouse_down = GF_TRUE;
- event.type = GF_EVENT_MOUSEDOWN;
- netctrl->term->compositor->video_out->on_event(netctrl->term->compositor->video_out->evt_cbk_hdl, &event);
- netctrl->cnt = 0;
- }
- event.type = GF_EVENT_MOUSEMOVE;
- netctrl->term->compositor->video_out->on_event(netctrl->term->compositor->video_out->evt_cbk_hdl, &event);
- break;
- }
- return 0;
-}
-
-
-GF_TermExt *netctrl_new()
-{
- GF_TermExt *dr;
- GF_NetControl *netctrl;
- dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));
- memset(dr, 0, sizeof(GF_TermExt));
- GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC NetControl", "gpac distribution");
-
- GF_SAFEALLOC(netctrl, GF_NetControl);
- dr->process = netctrl_process;
- dr->udta = netctrl;
- return dr;
-}
-
-
-void netctrl_delete(GF_BaseInterface *ifce)
-{
- GF_TermExt *dr = (GF_TermExt *) ifce;
- GF_NetControl *netctrl = dr->udta;
- gf_free(netctrl);
- gf_free(dr);
-}
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_TERM_EXT_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_TERM_EXT_INTERFACE) return (GF_BaseInterface *)netctrl_new();
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- switch (ifce->InterfaceType) {
- case GF_TERM_EXT_INTERFACE:
- netctrl_delete(ifce);
- break;
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( netctrl )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/opencv_is
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-#common obj
-OBJS= opencv_is.o
-
-SRCS := $(OBJS:.o=.c)
-
-EXTRALIBS+=-lcv -lcvaux -lhighgui -lcxcore
-
-LIB=gm_opencv$(DYN_LIB_SUFFIX)
-ifeq ($(CONFIG_WIN32),yes)
-#LDFLAGS+=-export-symbols opencv.def
-endif
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac $(LDFLAGS)
-
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-InitialObjectDescriptor {
- objectDescriptorID 1
- audioProfileLevelIndication 255
- visualProfileLevelIndication 254
- sceneProfileLevelIndication 1
- graphicsProfileLevelIndication 1
- ODProfileLevelIndication 1
- esDescr [
- ES_Descriptor {
- ES_ID 1
- decConfigDescr DecoderConfigDescriptor {
- streamType 3
- decSpecificInfo BIFSConfig {
- isCommandStream true
- pixelMetric true
- pixelWidth 640
- pixelHeight 480
- }
- }
- }
- ES_Descriptor {
- ES_ID 2
- decConfigDescr DecoderConfigDescriptor {
- streamType 1
- }
- }
- ]
-}
-
-OrderedGroup {
- children [
- Background2D {
- backColor 1 1 1
- }
- WorldInfo {
- info ["This shows usage of a demo InputSensor" "" "GPAC Regression Tests" "$Date: 2009-06-22 15:54:46 $ - $Revision: 1.1 $" "(C) 2009 ENST"]
- title "InputSensor Test - Demo device"
- }
- DEF TR Transform2D {
- translation 0 0
- children [
- Shape {
- appearance DEF APP Appearance {
- material Material2D {
- emissiveColor 0 0 0
- filled TRUE
- }
- }
- geometry DEF TEXT Text {
- string ["Demo Tracker", ""]
- fontStyle FontStyle {
- justify ["BEGIN" "MIDDLE"]
- size 30
- }
- }
- }
- ]
- }
- DEF V Valuator {}
-
- InputSensor {
- url [od:10]
- buffer {
- REPLACE TR.translation BY 0 0
- }
- }
- ]
-}
-
-ROUTE TR.translation TO V.inSFVec2f
-ROUTE V.outMFString TO TEXT.string
-
-
-
-AT 0 {
- UPDATE OD [
- ObjectDescriptor {
- objectDescriptorID 10
- esDescr [
- ES_Descriptor {
- ES_ID 5
- decConfigDescr DecoderConfigDescriptor {
- streamType 10
- decSpecificInfo UIConfig {
- deviceName "OpenCV"
- }
- }
- }
- ]
- }
- ]
-}
-
+++ /dev/null
-<?xml version="1.0"?>
-<!--
- Stump-based 24x24 discrete(?) adaboost frontal face detector.
- Created by Rainer Lienhart.
-
-////////////////////////////////////////////////////////////////////////////////////////
-
- IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-
- By downloading, copying, installing or using the software you agree to this license.
- If you do not agree to this license, do not download, install,
- copy or use the software.
-
-
- Intel License Agreement
- For Open Source Computer Vision Library
-
- Copyright (C) 2000, Intel Corporation, all rights reserved.
- Third party copyrights are property of their respective owners.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- * Redistribution's of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistribution's in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- * The name of Intel Corporation may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- This software is provided by the copyright holders and contributors "as is" and
- any express or implied warranties, including, but not limited to, the implied
- warranties of merchantability and fitness for a particular purpose are disclaimed.
- In no event shall the Intel Corporation or contributors be liable for any direct,
- indirect, incidental, special, exemplary, or consequential damages
- (including, but not limited to, procurement of substitute goods or services;
- loss of use, data, or profits; or business interruption) however caused
- and on any theory of liability, whether in contract, strict liability,
- or tort (including negligence or otherwise) arising in any way out of
- the use of this software, even if advised of the possibility of such damage.
--->
-<opencv_storage>
-<haarcascade_frontalface_default type_id="opencv-haar-classifier">
- <size>24 24</size>
- <stages>
- <_>
- <!-- stage 0 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 9 -1.</_>
- <_>6 7 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0315119996666908</threshold>
- <left_val>2.0875380039215088</left_val>
- <right_val>-2.2172100543975830</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 7 -1.</_>
- <_>10 4 4 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0123960003256798</threshold>
- <left_val>-1.8633940219879150</left_val>
- <right_val>1.3272049427032471</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 18 9 -1.</_>
- <_>3 12 18 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0219279993325472</threshold>
- <left_val>-1.5105249881744385</left_val>
- <right_val>1.0625729560852051</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 9 6 -1.</_>
- <_>8 20 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.7529998011887074e-003</threshold>
- <left_val>-0.8746389746665955</left_val>
- <right_val>1.1760339736938477</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 4 19 -1.</_>
- <_>5 5 2 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0150140002369881</threshold>
- <left_val>-0.7794569730758667</left_val>
- <right_val>1.2608419656753540</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 12 16 -1.</_>
- <_>6 13 12 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0993710011243820</threshold>
- <left_val>0.5575129985809326</left_val>
- <right_val>-1.8743000030517578</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 12 6 -1.</_>
- <_>5 11 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.7340000960975885e-003</threshold>
- <left_val>-1.6911929845809937</left_val>
- <right_val>0.4400970041751862</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 14 4 10 -1.</_>
- <_>11 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0188590008765459</threshold>
- <left_val>-1.4769539833068848</left_val>
- <right_val>0.4435009956359863</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 7 6 -1.</_>
- <_>4 3 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.9739998541772366e-003</threshold>
- <left_val>-0.8590919971466065</left_val>
- <right_val>0.8525559902191162</right_val></_></_></trees>
- <stage_threshold>-5.0425500869750977</stage_threshold>
- <parent>-1</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 1 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 6 -1.</_>
- <_>6 8 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0211100000888109</threshold>
- <left_val>1.2435649633407593</left_val>
- <right_val>-1.5713009834289551</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 7 -1.</_>
- <_>10 4 4 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0203559994697571</threshold>
- <left_val>-1.6204780340194702</left_val>
- <right_val>1.1817760467529297</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 8 19 12 -1.</_>
- <_>1 12 19 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0213089995086193</threshold>
- <left_val>-1.9415930509567261</left_val>
- <right_val>0.7006909847259522</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 3 -1.</_>
- <_>8 2 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0916600003838539</threshold>
- <left_val>-0.5567010045051575</left_val>
- <right_val>1.7284419536590576</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 9 6 15 -1.</_>
- <_>9 14 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0362880006432533</threshold>
- <left_val>0.2676379978656769</left_val>
- <right_val>-2.1831810474395752</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 10 -1.</_>
- <_>5 11 14 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0191099997609854</threshold>
- <left_val>-2.6730210781097412</left_val>
- <right_val>0.4567080140113831</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 14 9 -1.</_>
- <_>5 3 14 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.2539999857544899e-003</threshold>
- <left_val>-1.0852910280227661</left_val>
- <right_val>0.5356420278549194</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 9 6 -1.</_>
- <_>16 11 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0183550007641315</threshold>
- <left_val>-0.3520019948482513</left_val>
- <right_val>0.9333919882774353</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 6 10 -1.</_>
- <_>9 5 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.0569999516010284e-003</threshold>
- <left_val>0.9278209805488586</left_val>
- <right_val>-0.6634989976882935</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 8 6 10 -1.</_>
- <_>12 8 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.8770000040531158e-003</threshold>
- <left_val>1.1577470302581787</left_val>
- <right_val>-0.2977479994297028</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 4 9 -1.</_>
- <_>4 5 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0158140007406473</threshold>
- <left_val>-0.4196060001850128</left_val>
- <right_val>1.3576040267944336</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 0 6 11 -1.</_>
- <_>20 0 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0207000002264977</threshold>
- <left_val>1.4590020179748535</left_val>
- <right_val>-0.1973939985036850</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 24 13 -1.</_>
- <_>8 6 8 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1376080065965653</threshold>
- <left_val>1.1186759471893311</left_val>
- <right_val>-0.5291550159454346</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0143189998343587</threshold>
- <left_val>-0.3512719869613648</left_val>
- <right_val>1.1440860033035278</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 18 10 6 -1.</_>
- <_>7 20 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0102530000731349</threshold>
- <left_val>-0.6085060238838196</left_val>
- <right_val>0.7709850072860718</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 14 12 -1.</_>
- <_>5 13 14 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0915080010890961</threshold>
- <left_val>0.3881779909133911</left_val>
- <right_val>-1.5122940540313721</right_val></_></_></trees>
- <stage_threshold>-4.9842400550842285</stage_threshold>
- <parent>0</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 2 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 24 3 -1.</_>
- <_>8 3 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0697470009326935</threshold>
- <left_val>-1.0130879878997803</left_val>
- <right_val>1.4687349796295166</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 15 6 -1.</_>
- <_>5 11 15 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0315029993653297</threshold>
- <left_val>-1.6463639736175537</left_val>
- <right_val>1.0000629425048828</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 5 14 -1.</_>
- <_>9 13 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0142609998583794</threshold>
- <left_val>0.4648030102252960</left_val>
- <right_val>-1.5959889888763428</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 6 10 -1.</_>
- <_>11 5 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0144530003890395</threshold>
- <left_val>-0.6551190018653870</left_val>
- <right_val>0.8302180171012878</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 3 12 -1.</_>
- <_>6 12 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.0509999487549067e-003</threshold>
- <left_val>-1.3982310295104980</left_val>
- <right_val>0.4255059957504273</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 18 3 -1.</_>
- <_>9 21 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0327229984104633</threshold>
- <left_val>-0.5070260167121887</left_val>
- <right_val>1.0526109933853149</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 13 6 -1.</_>
- <_>5 8 13 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.2960001416504383e-003</threshold>
- <left_val>0.3635689914226532</left_val>
- <right_val>-1.3464889526367187</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 1 6 15 -1.</_>
- <_>18 1 3 15 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0504250004887581</threshold>
- <left_val>-0.3046140074729919</left_val>
- <right_val>1.4504129886627197</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 6 15 -1.</_>
- <_>4 1 3 15 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0468790009617805</threshold>
- <left_val>-0.4028620123863220</left_val>
- <right_val>1.2145609855651855</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 24 15 -1.</_>
- <_>8 8 8 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0693589970469475</threshold>
- <left_val>1.0539360046386719</left_val>
- <right_val>-0.4571970105171204</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 12 -1.</_>
- <_>5 6 7 6 2.</_>
- <_>12 12 7 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0490339994430542</threshold>
- <left_val>-1.6253089904785156</left_val>
- <right_val>0.1537899971008301</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 21 12 -1.</_>
- <_>2 16 21 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0848279967904091</threshold>
- <left_val>0.2840299904346466</left_val>
- <right_val>-1.5662059783935547</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 4 10 -1.</_>
- <_>10 1 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.7229999648407102e-003</threshold>
- <left_val>-1.0147459506988525</left_val>
- <right_val>0.2329480051994324</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 13 20 10 -1.</_>
- <_>2 13 10 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1156219989061356</threshold>
- <left_val>-0.1673289984464645</left_val>
- <right_val>1.2804069519042969</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 13 -1.</_>
- <_>2 1 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0512799993157387</threshold>
- <left_val>1.5162390470504761</left_val>
- <right_val>-0.3027110099792481</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 2 4 13 -1.</_>
- <_>20 2 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0427069999277592</threshold>
- <left_val>1.7631920576095581</left_val>
- <right_val>-0.0518320016562939</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 22 19 -1.</_>
- <_>11 5 11 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.3717809915542603</threshold>
- <left_val>-0.3138920068740845</left_val>
- <right_val>1.5357979536056519</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 4 6 9 -1.</_>
- <_>20 4 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0194129999727011</threshold>
- <left_val>-0.1001759991049767</left_val>
- <right_val>0.9365540146827698</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 11 -1.</_>
- <_>2 3 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0174390003085136</threshold>
- <left_val>-0.4037989974021912</left_val>
- <right_val>0.9629300236701965</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 4 9 -1.</_>
- <_>12 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0396389998495579</threshold>
- <left_val>0.1703909933567047</left_val>
- <right_val>-2.9602990150451660</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 19 3 -1.</_>
- <_>0 7 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.1469995677471161e-003</threshold>
- <left_val>0.8878679871559143</left_val>
- <right_val>-0.4381870031356812</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 4 9 -1.</_>
- <_>12 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.7219999572262168e-003</threshold>
- <left_val>-0.3721860051155090</left_val>
- <right_val>0.4001890122890472</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 4 9 -1.</_>
- <_>10 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0302310008555651</threshold>
- <left_val>0.0659240037202835</left_val>
- <right_val>-2.6469180583953857</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 14 14 -1.</_>
- <_>12 5 7 7 2.</_>
- <_>5 12 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0787959992885590</threshold>
- <left_val>-1.7491459846496582</left_val>
- <right_val>0.2847529947757721</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 18 2 -1.</_>
- <_>1 11 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.1110000088810921e-003</threshold>
- <left_val>-0.9390810132026672</left_val>
- <right_val>0.2320519983768463</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 13 4 11 -1.</_>
- <_>17 13 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0270910002291203</threshold>
- <left_val>-0.0526640005409718</left_val>
- <right_val>1.0756820440292358</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 6 9 -1.</_>
- <_>0 7 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0449649989604950</threshold>
- <left_val>-1.8294479846954346</left_val>
- <right_val>0.0995619967579842</right_val></_></_></trees>
- <stage_threshold>-4.6551899909973145</stage_threshold>
- <parent>1</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 3 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 9 -1.</_>
- <_>6 7 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0657010003924370</threshold>
- <left_val>1.1558510065078735</left_val>
- <right_val>-1.0716359615325928</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 12 6 -1.</_>
- <_>10 5 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0158399995416403</threshold>
- <left_val>-1.5634720325469971</left_val>
- <right_val>0.7687709927558899</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 5 -1.</_>
- <_>8 1 8 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1457089930772781</threshold>
- <left_val>-0.5745009779930115</left_val>
- <right_val>1.3808720111846924</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 10 18 6 -1.</_>
- <_>4 12 18 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.1389999464154243e-003</threshold>
- <left_val>-1.4570560455322266</left_val>
- <right_val>0.5161030292510986</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 17 12 6 -1.</_>
- <_>2 17 6 3 2.</_>
- <_>8 20 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.7179999314248562e-003</threshold>
- <left_val>-0.8353360295295715</left_val>
- <right_val>0.5852220058441162</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 3 4 13 -1.</_>
- <_>19 3 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0185180008411407</threshold>
- <left_val>-0.3131209909915924</left_val>
- <right_val>1.1696679592132568</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 3 4 13 -1.</_>
- <_>3 3 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0199580006301403</threshold>
- <left_val>-0.4344260096549988</left_val>
- <right_val>0.9544690251350403</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 23 -1.</_>
- <_>8 1 8 23 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2775500118732452</threshold>
- <left_val>1.4906179904937744</left_val>
- <right_val>-0.1381590068340302</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 7 8 12 -1.</_>
- <_>1 11 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.1859996318817139e-003</threshold>
- <left_val>-0.9636150002479553</left_val>
- <right_val>0.2766549885272980</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 7 3 14 -1.</_>
- <_>14 14 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0377379991114140</threshold>
- <left_val>-2.4464108943939209</left_val>
- <right_val>0.2361959964036942</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 12 16 6 -1.</_>
- <_>3 12 8 3 2.</_>
- <_>11 15 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0184630006551743</threshold>
- <left_val>0.1753920018672943</left_val>
- <right_val>-1.3423130512237549</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 6 -1.</_>
- <_>6 8 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0111149996519089</threshold>
- <left_val>0.4871079921722412</left_val>
- <right_val>-0.8985189795494080</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 6 12 -1.</_>
- <_>8 13 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0339279994368553</threshold>
- <left_val>0.1787420064210892</left_val>
- <right_val>-1.6342279911041260</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 15 9 6 -1.</_>
- <_>15 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0356490015983582</threshold>
- <left_val>-1.9607399702072144</left_val>
- <right_val>0.1810249984264374</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 17 18 3 -1.</_>
- <_>1 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0114380000159144</threshold>
- <left_val>0.9901069998741150</left_val>
- <right_val>-0.3810319900512695</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 16 12 -1.</_>
- <_>4 10 16 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0652360022068024</threshold>
- <left_val>-2.5794160366058350</left_val>
- <right_val>0.2475360035896301</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 4 20 -1.</_>
- <_>2 1 2 20 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0422720015048981</threshold>
- <left_val>1.4411840438842773</left_val>
- <right_val>-0.2950829863548279</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 18 2 -1.</_>
- <_>3 1 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.9219999667257071e-003</threshold>
- <left_val>-0.4960860013961792</left_val>
- <right_val>0.6317359805107117</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 20 14 -1.</_>
- <_>1 5 10 7 2.</_>
- <_>11 12 10 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1292179971933365</threshold>
- <left_val>-2.3314270973205566</left_val>
- <right_val>0.0544969998300076</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 14 12 -1.</_>
- <_>5 12 14 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0229310002177954</threshold>
- <left_val>-0.8444709777832031</left_val>
- <right_val>0.3873809874057770</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 14 7 9 -1.</_>
- <_>3 17 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0341200008988380</threshold>
- <left_val>-1.4431500434875488</left_val>
- <right_val>0.0984229966998100</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 9 6 -1.</_>
- <_>14 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0262230001389980</threshold>
- <left_val>0.1822309941053391</left_val>
- <right_val>-1.2586519718170166</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 15 9 6 -1.</_>
- <_>1 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0222369991242886</threshold>
- <left_val>0.0698079988360405</left_val>
- <right_val>-2.3820950984954834</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 8 10 -1.</_>
- <_>15 6 4 5 2.</_>
- <_>11 11 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.8240001089870930e-003</threshold>
- <left_val>0.3933250010013580</left_val>
- <right_val>-0.2754279971122742</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 14 14 -1.</_>
- <_>5 5 7 7 2.</_>
- <_>12 12 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0436530001461506</threshold>
- <left_val>0.1483269929885864</left_val>
- <right_val>-1.1368780136108398</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 12 5 -1.</_>
- <_>10 0 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0572669990360737</threshold>
- <left_val>0.2462809979915619</left_val>
- <right_val>-1.2687400579452515</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 9 -1.</_>
- <_>9 3 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.3409998975694180e-003</threshold>
- <left_val>-0.7544890046119690</left_val>
- <right_val>0.2716380059719086</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0129960002377629</threshold>
- <left_val>-0.3639490008354187</left_val>
- <right_val>0.7095919847488403</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0265170000493526</threshold>
- <left_val>-2.3221859931945801</left_val>
- <right_val>0.0357440002262592</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 6 9 -1.</_>
- <_>12 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.8400002308189869e-003</threshold>
- <left_val>0.4219430088996887</left_val>
- <right_val>-0.0481849983334541</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 6 9 -1.</_>
- <_>10 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0165689997375011</threshold>
- <left_val>1.1099940538406372</left_val>
- <right_val>-0.3484970033168793</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 8 18 4 -1.</_>
- <_>9 8 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0681570023298264</threshold>
- <left_val>-3.3269989490509033</left_val>
- <right_val>0.2129900008440018</right_val></_></_></trees>
- <stage_threshold>-4.4531588554382324</stage_threshold>
- <parent>2</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 4 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 12 9 -1.</_>
- <_>6 3 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0399740003049374</threshold>
- <left_val>-1.2173449993133545</left_val>
- <right_val>1.0826710462570190</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 6 -1.</_>
- <_>8 0 8 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1881950050592423</threshold>
- <left_val>-0.4828940033912659</left_val>
- <right_val>1.4045250415802002</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 16 12 -1.</_>
- <_>4 11 16 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0780270025134087</threshold>
- <left_val>-1.0782150030136108</left_val>
- <right_val>0.7404029965400696</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 6 6 -1.</_>
- <_>11 6 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.1899999663000926e-004</threshold>
- <left_val>-1.2019979953765869</left_val>
- <right_val>0.3774920105934143</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 20 24 3 -1.</_>
- <_>8 20 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0850569978356361</threshold>
- <left_val>-0.4393909871578217</left_val>
- <right_val>1.2647340297698975</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 4 9 -1.</_>
- <_>11 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.9720003306865692e-003</threshold>
- <left_val>-0.1844049990177155</left_val>
- <right_val>0.4572640061378479</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 15 4 -1.</_>
- <_>9 13 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.8120000436902046e-003</threshold>
- <left_val>0.3039669990539551</left_val>
- <right_val>-0.9599109888076782</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 4 9 -1.</_>
- <_>11 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0235079992562532</threshold>
- <left_val>1.2487529516220093</left_val>
- <right_val>0.0462279990315437</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 4 9 -1.</_>
- <_>11 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.0039997808635235e-003</threshold>
- <left_val>-0.5944210290908814</left_val>
- <right_val>0.5396329760551453</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 12 -1.</_>
- <_>9 18 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0338519997894764</threshold>
- <left_val>0.2849609851837158</left_val>
- <right_val>-1.4895249605178833</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 22 18 2 -1.</_>
- <_>1 23 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.2530000898987055e-003</threshold>
- <left_val>0.4812079966068268</left_val>
- <right_val>-0.5271239876747131</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 4 10 -1.</_>
- <_>10 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0290970001369715</threshold>
- <left_val>0.2674390077590942</left_val>
- <right_val>-1.6007850170135498</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 8 10 -1.</_>
- <_>6 12 8 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.4790000692009926e-003</threshold>
- <left_val>-1.3107639551162720</left_val>
- <right_val>0.1524309962987900</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 10 6 -1.</_>
- <_>7 8 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0107950000092387</threshold>
- <left_val>0.4561359882354736</left_val>
- <right_val>-0.7205089926719666</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 10 4 -1.</_>
- <_>0 16 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0246200002729893</threshold>
- <left_val>-1.7320619821548462</left_val>
- <right_val>0.0683630034327507</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 18 18 2 -1.</_>
- <_>6 19 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.7380000576376915e-003</threshold>
- <left_val>-0.1930329948663712</left_val>
- <right_val>0.6824349761009216</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 22 3 -1.</_>
- <_>1 2 22 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0122640002518892</threshold>
- <left_val>-1.6095290184020996</left_val>
- <right_val>0.0752680003643036</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 18 3 -1.</_>
- <_>6 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.8670000396668911e-003</threshold>
- <left_val>0.7428650259971619</left_val>
- <right_val>-0.2151020020246506</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 4 6 15 -1.</_>
- <_>5 4 3 15 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0767259970307350</threshold>
- <left_val>-0.2683509886264801</left_val>
- <right_val>1.3094140291213989</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 4 4 10 -1.</_>
- <_>20 4 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0285780001431704</threshold>
- <left_val>-0.0587930008769035</left_val>
- <right_val>1.2196329832077026</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 4 10 -1.</_>
- <_>2 4 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0196940004825592</threshold>
- <left_val>-0.3514289855957031</left_val>
- <right_val>0.8492699861526489</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 16 20 6 -1.</_>
- <_>12 16 10 3 2.</_>
- <_>2 19 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0290939994156361</threshold>
- <left_val>-1.0507299900054932</left_val>
- <right_val>0.2980630099773407</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 8 9 -1.</_>
- <_>4 12 4 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0291440002620220</threshold>
- <left_val>0.8254780173301697</left_val>
- <right_val>-0.3268719911575317</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 6 9 -1.</_>
- <_>14 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0197410006076097</threshold>
- <left_val>0.2045260071754456</left_val>
- <right_val>-0.8376020193099976</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 6 6 -1.</_>
- <_>8 10 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.3299999088048935e-003</threshold>
- <left_val>0.2057790011167526</left_val>
- <right_val>-0.6682980060577393</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 8 12 6 -1.</_>
- <_>17 8 6 3 2.</_>
- <_>11 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0355009995400906</threshold>
- <left_val>-1.2969900369644165</left_val>
- <right_val>0.1389749944210053</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 12 6 -1.</_>
- <_>0 8 6 3 2.</_>
- <_>6 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0161729995161295</threshold>
- <left_val>-1.3110569715499878</left_val>
- <right_val>0.0757519975304604</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 6 9 -1.</_>
- <_>14 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0221510007977486</threshold>
- <left_val>-1.0524389743804932</left_val>
- <right_val>0.1924110054969788</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 6 9 -1.</_>
- <_>8 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0227070003747940</threshold>
- <left_val>-1.3735309839248657</left_val>
- <right_val>0.0667809993028641</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 14 9 6 -1.</_>
- <_>8 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0166079998016357</threshold>
- <left_val>-0.0371359996497631</left_val>
- <right_val>0.7784640192985535</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 9 6 -1.</_>
- <_>0 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0133090000599623</threshold>
- <left_val>-0.9985070228576660</left_val>
- <right_val>0.1224810034036636</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 8 6 10 -1.</_>
- <_>12 8 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0337320007383823</threshold>
- <left_val>1.4461359977722168</left_val>
- <right_val>0.0131519995629787</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 19 12 3 -1.</_>
- <_>9 19 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0169350001960993</threshold>
- <left_val>-0.3712129890918732</left_val>
- <right_val>0.5284219980239868</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 10 20 2 -1.</_>
- <_>2 11 20 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.3259999472647905e-003</threshold>
- <left_val>-0.5756850242614746</left_val>
- <right_val>0.3926190137863159</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 9 18 12 -1.</_>
- <_>2 9 9 6 2.</_>
- <_>11 15 9 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0836440026760101</threshold>
- <left_val>0.0161160007119179</left_val>
- <right_val>-2.1173279285430908</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 18 24 -1.</_>
- <_>3 0 9 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2578519880771637</threshold>
- <left_val>-0.0816090032458305</left_val>
- <right_val>0.9878249764442444</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 10 -1.</_>
- <_>5 6 7 5 2.</_>
- <_>12 11 7 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0365669988095760</threshold>
- <left_val>-1.1512110233306885</left_val>
- <right_val>0.0964590013027191</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 10 12 -1.</_>
- <_>14 5 5 6 2.</_>
- <_>9 11 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0164459999650717</threshold>
- <left_val>0.3731549978256226</left_val>
- <right_val>-0.1458539962768555</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 5 12 12 -1.</_>
- <_>4 5 6 6 2.</_>
- <_>10 11 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.7519999314099550e-003</threshold>
- <left_val>0.2617929875850678</left_val>
- <right_val>-0.5815669894218445</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 14 18 3 -1.</_>
- <_>4 15 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.3660000450909138e-003</threshold>
- <left_val>0.7547739744186401</left_val>
- <right_val>-0.1705520004034042</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 13 8 8 -1.</_>
- <_>6 17 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.8499999791383743e-003</threshold>
- <left_val>0.2265399992465973</left_val>
- <right_val>-0.6387640237808228</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 16 18 6 -1.</_>
- <_>3 19 18 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0454940013587475</threshold>
- <left_val>-1.2640299797058105</left_val>
- <right_val>0.2526069879531860</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 6 -1.</_>
- <_>3 0 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0239410009235144</threshold>
- <left_val>0.8706840276718140</left_val>
- <right_val>-0.2710469961166382</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 18 -1.</_>
- <_>10 6 4 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0775580033659935</threshold>
- <left_val>-1.3901610374450684</left_val>
- <right_val>0.2361229956150055</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 4 14 -1.</_>
- <_>8 1 2 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0236140005290508</threshold>
- <left_val>0.0661400035023689</left_val>
- <right_val>-1.2645419836044312</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 19 2 -1.</_>
- <_>3 3 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.5750000495463610e-003</threshold>
- <left_val>-0.5384169816970825</left_val>
- <right_val>0.3037909865379334</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 8 22 13 -1.</_>
- <_>12 8 11 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1201080009341240</threshold>
- <left_val>-0.3534300029277802</left_val>
- <right_val>0.5286620259284973</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 9 11 4 -1.</_>
- <_>8 11 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.2899999748915434e-003</threshold>
- <left_val>-0.5870199799537659</left_val>
- <right_val>0.2406100034713745</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 15 10 -1.</_>
- <_>5 12 5 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0697169974446297</threshold>
- <left_val>-0.3334890007972717</left_val>
- <right_val>0.5191630125045776</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 16 12 6 -1.</_>
- <_>16 16 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0466700010001659</threshold>
- <left_val>0.6979539990425110</left_val>
- <right_val>-0.0148959998041391</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 12 6 -1.</_>
- <_>4 16 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0501290000975132</threshold>
- <left_val>0.8614619970321655</left_val>
- <right_val>-0.2598600089550018</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 1 5 12 -1.</_>
- <_>19 5 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0301479995250702</threshold>
- <left_val>0.1933279931545258</left_val>
- <right_val>-0.5913109779357910</right_val></_></_></trees>
- <stage_threshold>-4.3864588737487793</stage_threshold>
- <parent>3</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 5 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 4 -1.</_>
- <_>8 2 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0910850018262863</threshold>
- <left_val>-0.8923310041427612</left_val>
- <right_val>1.0434230566024780</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 12 4 -1.</_>
- <_>6 10 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0128189995884895</threshold>
- <left_val>-1.2597670555114746</left_val>
- <right_val>0.5531709790229797</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 9 6 -1.</_>
- <_>10 5 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0159319993108511</threshold>
- <left_val>-0.8625440001487732</left_val>
- <right_val>0.6373180150985718</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 17 6 6 -1.</_>
- <_>9 20 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.2780001163482666e-003</threshold>
- <left_val>-0.7463920116424561</left_val>
- <right_val>0.5315560102462769</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 22 15 -1.</_>
- <_>0 12 22 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0318409986793995</threshold>
- <left_val>-1.2650489807128906</left_val>
- <right_val>0.3615390062332153</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 17 9 -1.</_>
- <_>4 4 17 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.6960000395774841e-003</threshold>
- <left_val>-0.9829040169715881</left_val>
- <right_val>0.3601300120353699</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 6 10 -1.</_>
- <_>9 5 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0120550002902746</threshold>
- <left_val>0.6406840085983276</left_val>
- <right_val>-0.5012500286102295</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 1 6 8 -1.</_>
- <_>18 1 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0213249996304512</threshold>
- <left_val>-0.2403499931097031</left_val>
- <right_val>0.8544800281524658</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 7 -1.</_>
- <_>3 1 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0304860007017851</threshold>
- <left_val>-0.3427360057830811</left_val>
- <right_val>1.1428849697113037</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 0 6 22 -1.</_>
- <_>18 0 3 22 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0450799986720085</threshold>
- <left_val>1.0976949930191040</left_val>
- <right_val>-0.1797460019588471</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 22 -1.</_>
- <_>3 0 3 22 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0717009976506233</threshold>
- <left_val>1.5735000371932983</left_val>
- <right_val>-0.3143349885940552</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 7 8 16 -1.</_>
- <_>16 7 4 16 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0592180006206036</threshold>
- <left_val>-0.2758240103721619</left_val>
- <right_val>1.0448570251464844</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 10 19 6 -1.</_>
- <_>2 12 19 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.7010000348091125e-003</threshold>
- <left_val>-1.0974019765853882</left_val>
- <right_val>0.1980119943618774</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 9 6 12 -1.</_>
- <_>9 13 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0410469993948936</threshold>
- <left_val>0.3054769933223724</left_val>
- <right_val>-1.3287999629974365</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 15 17 6 -1.</_>
- <_>2 17 17 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.5499999113380909e-004</threshold>
- <left_val>0.2580710053443909</left_val>
- <right_val>-0.7005289793014526</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 7 3 14 -1.</_>
- <_>14 14 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0303600002080202</threshold>
- <left_val>-1.2306419610977173</left_val>
- <right_val>0.2260939925909042</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 8 10 -1.</_>
- <_>5 6 4 5 2.</_>
- <_>9 11 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0129300002008677</threshold>
- <left_val>0.4075860083103180</left_val>
- <right_val>-0.5123450160026550</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 8 9 11 -1.</_>
- <_>18 8 3 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0373679995536804</threshold>
- <left_val>-0.0947550013661385</left_val>
- <right_val>0.6176509857177734</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 9 11 -1.</_>
- <_>3 8 3 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0244340002536774</threshold>
- <left_val>-0.4110060036182404</left_val>
- <right_val>0.4763050079345703</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 10 18 -1.</_>
- <_>8 15 10 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0570079982280731</threshold>
- <left_val>0.2524929940700531</left_val>
- <right_val>-0.6866980195045471</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 3 14 -1.</_>
- <_>7 14 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0163139998912811</threshold>
- <left_val>-0.9392840266227722</left_val>
- <right_val>0.1144810020923615</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 24 8 -1.</_>
- <_>8 14 8 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1764889955520630</threshold>
- <left_val>1.2451089620590210</left_val>
- <right_val>-0.0565190017223358</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 18 14 -1.</_>
- <_>10 10 9 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1761460006237030</threshold>
- <left_val>-0.3252820074558258</left_val>
- <right_val>0.8279150128364563</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 12 6 6 -1.</_>
- <_>14 15 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.3910001665353775e-003</threshold>
- <left_val>0.3478370010852814</left_val>
- <right_val>-0.1792909950017929</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 10 16 -1.</_>
- <_>7 0 5 8 2.</_>
- <_>12 8 5 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0608909986913204</threshold>
- <left_val>0.0550980009138584</left_val>
- <right_val>-1.5480779409408569</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 9 6 -1.</_>
- <_>13 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0291230008006096</threshold>
- <left_val>-1.0255639553070068</left_val>
- <right_val>0.2410690039396286</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 16 4 -1.</_>
- <_>12 3 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0456489995121956</threshold>
- <left_val>1.0301599502563477</left_val>
- <right_val>-0.3167209923267365</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 9 6 -1.</_>
- <_>13 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0373330004513264</threshold>
- <left_val>0.2162059992551804</left_val>
- <right_val>-0.8258990049362183</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 20 4 -1.</_>
- <_>1 1 10 2 2.</_>
- <_>11 3 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0244110003113747</threshold>
- <left_val>-1.5957959890365601</left_val>
- <right_val>0.0511390008032322</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 9 6 -1.</_>
- <_>13 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0598069988191128</threshold>
- <left_val>-1.0312290191650391</left_val>
- <right_val>0.1309230029582977</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 9 6 -1.</_>
- <_>8 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0301060006022453</threshold>
- <left_val>-1.4781630039215088</left_val>
- <right_val>0.0372119992971420</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 10 6 -1.</_>
- <_>8 20 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.4209999293088913e-003</threshold>
- <left_val>-0.2402410060167313</left_val>
- <right_val>0.4933399856090546</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 6 9 -1.</_>
- <_>8 3 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.1909999195486307e-003</threshold>
- <left_val>0.2894150018692017</left_val>
- <right_val>-0.5725960135459900</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 3 12 6 -1.</_>
- <_>7 5 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0208609998226166</threshold>
- <left_val>-0.2314839959144592</left_val>
- <right_val>0.6376590132713318</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 18 3 -1.</_>
- <_>0 11 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.6990000195801258e-003</threshold>
- <left_val>-1.2107750177383423</left_val>
- <right_val>0.0640180036425591</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 22 3 -1.</_>
- <_>1 11 22 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0187580008059740</threshold>
- <left_val>0.2446130067110062</left_val>
- <right_val>-0.9978669881820679</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 8 8 -1.</_>
- <_>9 11 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0443230010569096</threshold>
- <left_val>-1.3699189424514771</left_val>
- <right_val>0.0360519997775555</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 11 6 6 -1.</_>
- <_>12 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0228599999099970</threshold>
- <left_val>0.2128839939832687</left_val>
- <right_val>-1.0397620201110840</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 6 6 -1.</_>
- <_>9 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.8600005730986595e-004</threshold>
- <left_val>0.3244360089302063</left_val>
- <right_val>-0.5429180264472961</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 10 11 6 -1.</_>
- <_>7 12 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0172390006482601</threshold>
- <left_val>-0.2832390069961548</left_val>
- <right_val>0.4446820020675659</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 24 4 -1.</_>
- <_>0 13 12 2 2.</_>
- <_>12 15 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0345310010015965</threshold>
- <left_val>-2.3107020854949951</left_val>
- <right_val>-3.1399999279528856e-003</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 4 22 12 -1.</_>
- <_>13 4 11 6 2.</_>
- <_>2 10 11 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0670069977641106</threshold>
- <left_val>0.2871569991111755</left_val>
- <right_val>-0.6448100209236145</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 20 17 -1.</_>
- <_>12 0 10 17 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2377689927816391</threshold>
- <left_val>-0.2717480063438416</left_val>
- <right_val>0.8021910190582275</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 2 24 -1.</_>
- <_>14 0 1 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0129030002281070</threshold>
- <left_val>-1.5317620038986206</left_val>
- <right_val>0.2142360061407089</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 2 24 -1.</_>
- <_>9 0 1 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0105149997398257</threshold>
- <left_val>0.0770379975438118</left_val>
- <right_val>-1.0581140518188477</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 1 2 22 -1.</_>
- <_>14 1 1 22 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0169690009206533</threshold>
- <left_val>0.1430670022964478</left_val>
- <right_val>-0.8582839965820313</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 2 22 -1.</_>
- <_>9 1 1 22 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.2460002265870571e-003</threshold>
- <left_val>-1.1020129919052124</left_val>
- <right_val>0.0649069994688034</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 6 3 18 -1.</_>
- <_>18 6 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0105569995939732</threshold>
- <left_val>0.0139640001580119</left_val>
- <right_val>0.6360149979591370</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 14 9 6 -1.</_>
- <_>6 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.1380001716315746e-003</threshold>
- <left_val>-0.3454590141773224</left_val>
- <right_val>0.5629680156707764</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 14 9 4 -1.</_>
- <_>13 16 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0131580000743270</threshold>
- <left_val>0.1992730051279068</left_val>
- <right_val>-1.5040320158004761</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 18 3 -1.</_>
- <_>3 19 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.1310000922530890e-003</threshold>
- <left_val>-0.4090369939804077</left_val>
- <right_val>0.3779639899730682</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 4 8 18 -1.</_>
- <_>13 4 4 9 2.</_>
- <_>9 13 4 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1092069968581200</threshold>
- <left_val>-2.2227079868316650</left_val>
- <right_val>0.1217819973826408</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 18 3 -1.</_>
- <_>0 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.1820003688335419e-003</threshold>
- <left_val>-0.2865200042724609</left_val>
- <right_val>0.6789079904556274</right_val></_></_></trees>
- <stage_threshold>-4.1299300193786621</stage_threshold>
- <parent>4</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 6 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 12 4 -1.</_>
- <_>6 2 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0313469991087914</threshold>
- <left_val>-0.8888459801673889</left_val>
- <right_val>0.9493680000305176</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 14 6 -1.</_>
- <_>6 11 14 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0319180004298687</threshold>
- <left_val>-1.1146880388259888</left_val>
- <right_val>0.4888899922370911</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 6 6 -1.</_>
- <_>10 5 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.5939999185502529e-003</threshold>
- <left_val>-1.0097689628601074</left_val>
- <right_val>0.4972380101680756</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 6 16 -1.</_>
- <_>10 13 6 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0261480007320642</threshold>
- <left_val>0.2599129974842072</left_val>
- <right_val>-1.2537480592727661</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 4 9 16 -1.</_>
- <_>4 4 3 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0128450002521276</threshold>
- <left_val>-0.5713859796524048</left_val>
- <right_val>0.5965949892997742</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 18 9 -1.</_>
- <_>5 3 18 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0263449996709824</threshold>
- <left_val>-0.5520319938659668</left_val>
- <right_val>0.3021740019321442</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 15 5 8 -1.</_>
- <_>9 19 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0150830000638962</threshold>
- <left_val>-1.2871240377426147</left_val>
- <right_val>0.2235420048236847</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 0 4 9 -1.</_>
- <_>20 0 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0388870015740395</threshold>
- <left_val>1.7425049543380737</left_val>
- <right_val>-0.0997470021247864</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 18 3 -1.</_>
- <_>2 1 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.7029998861253262e-003</threshold>
- <left_val>-1.0523240566253662</left_val>
- <right_val>0.1836259961128235</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 22 19 2 -1.</_>
- <_>5 23 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.4860000228509307e-003</threshold>
- <left_val>0.5678420066833496</left_val>
- <right_val>-0.4674200117588043</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 4 9 -1.</_>
- <_>2 0 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0284860003739595</threshold>
- <left_val>1.3082909584045410</left_val>
- <right_val>-0.2646090090274811</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 19 18 -1.</_>
- <_>5 12 19 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0662249997258186</threshold>
- <left_val>-0.4621070027351379</left_val>
- <right_val>0.4174959957599640</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 9 -1.</_>
- <_>2 1 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.8569996878504753e-003</threshold>
- <left_val>-0.4147489964962006</left_val>
- <right_val>0.5920479893684387</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 14 12 -1.</_>
- <_>13 5 7 6 2.</_>
- <_>6 11 7 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0113559998571873</threshold>
- <left_val>0.3610309958457947</left_val>
- <right_val>-0.4578120112419128</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 20 2 -1.</_>
- <_>0 2 20 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.7679998893290758e-003</threshold>
- <left_val>-0.8923889994621277</left_val>
- <right_val>0.1419900059700012</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 22 3 -1.</_>
- <_>1 3 22 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0112469997256994</threshold>
- <left_val>0.2935340106487274</left_val>
- <right_val>-0.9733060002326965</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 8 7 9 -1.</_>
- <_>2 11 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.1970000863075256e-003</threshold>
- <left_val>-0.7933490276336670</left_val>
- <right_val>0.1831340044736862</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 22 4 -1.</_>
- <_>13 12 11 2 2.</_>
- <_>2 14 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0317689999938011</threshold>
- <left_val>0.1552309989929199</left_val>
- <right_val>-1.3245639801025391</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 22 4 -1.</_>
- <_>0 12 11 2 2.</_>
- <_>11 14 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0251739993691444</threshold>
- <left_val>0.0342149995267391</left_val>
- <right_val>-2.0948131084442139</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 7 6 11 -1.</_>
- <_>11 7 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.5360001064836979e-003</threshold>
- <left_val>-0.3945060074329376</left_val>
- <right_val>0.5133399963378906</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 9 6 -1.</_>
- <_>10 1 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0328730009496212</threshold>
- <left_val>0.0883729979395866</left_val>
- <right_val>-1.2814120054244995</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 2 4 10 -1.</_>
- <_>11 7 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.7379998937249184e-003</threshold>
- <left_val>0.5528650283813477</left_val>
- <right_val>-0.4638499915599823</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 12 -1.</_>
- <_>6 10 12 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0380750000476837</threshold>
- <left_val>-1.8497270345687866</left_val>
- <right_val>0.0459440015256405</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 1 6 15 -1.</_>
- <_>18 6 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0389840006828308</threshold>
- <left_val>-0.4822370111942291</left_val>
- <right_val>0.3476060032844544</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 15 18 3 -1.</_>
- <_>3 16 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.8029999230057001e-003</threshold>
- <left_val>-0.4515469968318939</left_val>
- <right_val>0.4280630052089691</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 5 6 9 -1.</_>
- <_>18 8 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0541459992527962</threshold>
- <left_val>-0.8452079892158508</left_val>
- <right_val>0.1667490005493164</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 16 6 -1.</_>
- <_>1 5 8 3 2.</_>
- <_>9 8 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.3280000835657120e-003</threshold>
- <left_val>0.3534829914569855</left_val>
- <right_val>-0.4716320037841797</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 6 9 -1.</_>
- <_>13 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0337780006229877</threshold>
- <left_val>0.1846310049295425</left_val>
- <right_val>-1.6686669588088989</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 24 14 -1.</_>
- <_>0 4 12 7 2.</_>
- <_>12 11 12 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1123809963464737</threshold>
- <left_val>-1.2521569728851318</left_val>
- <right_val>0.0359920002520084</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 4 13 -1.</_>
- <_>13 0 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0104080000892282</threshold>
- <left_val>-0.8162040114402771</left_val>
- <right_val>0.2342859953641892</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 4 13 -1.</_>
- <_>9 0 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.9439999274909496e-003</threshold>
- <left_val>-0.9258469939231873</left_val>
- <right_val>0.1003480032086372</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 6 9 -1.</_>
- <_>13 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.3029998242855072e-003</threshold>
- <left_val>0.5649930238723755</left_val>
- <right_val>-0.1888190060853958</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 6 9 -1.</_>
- <_>10 7 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0117499995976686</threshold>
- <left_val>0.8030239939689636</left_val>
- <right_val>-0.3827700018882752</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 17 9 6 -1.</_>
- <_>13 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0232170000672340</threshold>
- <left_val>-0.8492699861526489</left_val>
- <right_val>0.1967120021581650</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 18 14 6 -1.</_>
- <_>2 18 7 3 2.</_>
- <_>9 21 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0168660003691912</threshold>
- <left_val>-0.4059189856052399</left_val>
- <right_val>0.5069530010223389</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 18 4 -1.</_>
- <_>12 18 9 2 2.</_>
- <_>3 20 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0240310002118349</threshold>
- <left_val>-1.5297520160675049</left_val>
- <right_val>0.2334499955177307</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 20 15 4 -1.</_>
- <_>5 20 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0369459986686707</threshold>
- <left_val>0.6300770044326782</left_val>
- <right_val>-0.3178040087223053</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 15 15 9 -1.</_>
- <_>14 15 5 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0615639984607697</threshold>
- <left_val>0.5862789750099182</left_val>
- <right_val>-0.0121079999953508</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 16 4 -1.</_>
- <_>4 6 16 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0216610003262758</threshold>
- <left_val>-0.2562370002269745</left_val>
- <right_val>1.0409849882125854</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 10 6 -1.</_>
- <_>7 8 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.6710000131279230e-003</threshold>
- <left_val>0.2917110025882721</left_val>
- <right_val>-0.8328729867935181</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 15 10 -1.</_>
- <_>5 14 5 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0448490008711815</threshold>
- <left_val>-0.3963319957256317</left_val>
- <right_val>0.4566200077533722</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 9 10 14 -1.</_>
- <_>12 9 5 7 2.</_>
- <_>7 16 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0571950003504753</threshold>
- <left_val>0.2102389931678772</left_val>
- <right_val>-1.5004800558090210</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 6 9 -1.</_>
- <_>9 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0113420002162457</threshold>
- <left_val>0.4407129883766174</left_val>
- <right_val>-0.3865379989147186</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 3 -1.</_>
- <_>3 7 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0120040001347661</threshold>
- <left_val>0.9395459890365601</left_val>
- <right_val>-0.1058949977159500</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 18 3 -1.</_>
- <_>0 11 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0225159991532564</threshold>
- <left_val>9.4480002298951149e-003</left_val>
- <right_val>-1.6799509525299072</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 16 18 4 -1.</_>
- <_>12 16 9 2 2.</_>
- <_>3 18 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0198090001940727</threshold>
- <left_val>-1.0133639574050903</left_val>
- <right_val>0.2414660006761551</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 14 6 -1.</_>
- <_>4 6 7 3 2.</_>
- <_>11 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0158910006284714</threshold>
- <left_val>-0.3750759959220886</left_val>
- <right_val>0.4661409854888916</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 2 18 -1.</_>
- <_>13 0 1 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.1420002281665802e-003</threshold>
- <left_val>-0.8048409819602966</left_val>
- <right_val>0.1781699955463409</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 2 18 -1.</_>
- <_>10 0 1 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.4740000739693642e-003</threshold>
- <left_val>-1.0562069416046143</left_val>
- <right_val>0.0733050033450127</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 15 10 -1.</_>
- <_>10 7 5 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1274250000715256</threshold>
- <left_val>0.2016559988260269</left_val>
- <right_val>-1.5467929840087891</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 20 21 4 -1.</_>
- <_>8 20 7 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0477030016481876</threshold>
- <left_val>-0.3793779909610748</left_val>
- <right_val>0.3788599967956543</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 5 18 -1.</_>
- <_>10 14 5 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0536080002784729</threshold>
- <left_val>0.2122049927711487</left_val>
- <right_val>-1.2399710416793823</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 6 -1.</_>
- <_>0 2 12 3 2.</_>
- <_>12 5 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0396809987723827</threshold>
- <left_val>-1.0257550477981567</left_val>
- <right_val>0.0512829981744289</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 22 8 -1.</_>
- <_>12 1 11 4 2.</_>
- <_>1 5 11 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0673270002007484</threshold>
- <left_val>-1.0304750204086304</left_val>
- <right_val>0.2300529927015305</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 15 9 -1.</_>
- <_>4 3 15 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1333760023117065</threshold>
- <left_val>-0.2086900025606155</left_val>
- <right_val>1.2272510528564453</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 19 -1.</_>
- <_>8 0 8 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2091930061578751</threshold>
- <left_val>0.8792989850044251</left_val>
- <right_val>-0.0442549996078014</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 21 18 3 -1.</_>
- <_>11 21 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0655890032649040</threshold>
- <left_val>1.0443429946899414</left_val>
- <right_val>-0.2168209999799728</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 7 10 4 -1.</_>
- <_>9 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0618829987943172</threshold>
- <left_val>0.1379819959402084</left_val>
- <right_val>-1.9009059667587280</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 10 4 -1.</_>
- <_>10 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0255789998918772</threshold>
- <left_val>-1.6607600450515747</left_val>
- <right_val>5.8439997956156731e-003</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 8 6 16 -1.</_>
- <_>20 8 3 8 2.</_>
- <_>17 16 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0348270013928413</threshold>
- <left_val>0.7994040250778198</left_val>
- <right_val>-0.0824069976806641</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 15 20 4 -1.</_>
- <_>1 15 10 2 2.</_>
- <_>11 17 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0182099994271994</threshold>
- <left_val>-0.9607399702072144</left_val>
- <right_val>0.0663200020790100</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 10 6 -1.</_>
- <_>14 17 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0150709999725223</threshold>
- <left_val>0.1989939957857132</left_val>
- <right_val>-0.7643300294876099</right_val></_></_></trees>
- <stage_threshold>-4.0218091011047363</stage_threshold>
- <parent>5</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 7 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 16 9 -1.</_>
- <_>3 3 16 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0463249981403351</threshold>
- <left_val>-1.0362670421600342</left_val>
- <right_val>0.8220149874687195</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 6 7 15 -1.</_>
- <_>15 11 7 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0154069997370243</threshold>
- <left_val>-1.2327589988708496</left_val>
- <right_val>0.2964769899845123</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 6 13 -1.</_>
- <_>11 1 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0128089999780059</threshold>
- <left_val>-0.7585229873657227</left_val>
- <right_val>0.5798550248146057</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 2 6 14 -1.</_>
- <_>17 2 3 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0491509996354580</threshold>
- <left_val>-0.3898389935493469</left_val>
- <right_val>0.8968030214309692</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 14 12 10 -1.</_>
- <_>3 14 6 5 2.</_>
- <_>9 19 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0126210004091263</threshold>
- <left_val>-0.7179930210113525</left_val>
- <right_val>0.5044090151786804</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 10 6 -1.</_>
- <_>7 8 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0187689997255802</threshold>
- <left_val>0.5514760017395020</left_val>
- <right_val>-0.7055540084838867</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 6 14 -1.</_>
- <_>4 2 3 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0419650003314018</threshold>
- <left_val>-0.4478209912776947</left_val>
- <right_val>0.7098550200462341</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 4 5 12 -1.</_>
- <_>10 8 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0514019988477230</threshold>
- <left_val>-1.0932120084762573</left_val>
- <right_val>0.2670190036296845</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 24 5 -1.</_>
- <_>8 17 8 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0709609985351563</threshold>
- <left_val>0.8361840248107910</left_val>
- <right_val>-0.3831810057163239</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 7 5 12 -1.</_>
- <_>15 11 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0167459994554520</threshold>
- <left_val>-0.2573310136795044</left_val>
- <right_val>0.2596650123596191</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 6 12 -1.</_>
- <_>3 1 3 6 2.</_>
- <_>6 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.2400000169873238e-003</threshold>
- <left_val>0.3163149952888489</left_val>
- <right_val>-0.5879690051078796</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 13 6 6 -1.</_>
- <_>12 16 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0393979996442795</threshold>
- <left_val>-1.0491210222244263</left_val>
- <right_val>0.1682240068912506</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 13 6 6 -1.</_>
- <_>6 16 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.</threshold>
- <left_val>0.1614419966936112</left_val>
- <right_val>-0.8787689805030823</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 6 3 16 -1.</_>
- <_>14 14 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0223079994320869</threshold>
- <left_val>-0.6905350089073181</left_val>
- <right_val>0.2360700070858002</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 12 13 6 -1.</_>
- <_>1 14 13 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.8919999711215496e-003</threshold>
- <left_val>0.2498919963836670</left_val>
- <right_val>-0.5658329725265503</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 1 4 9 -1.</_>
- <_>13 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.0730000212788582e-003</threshold>
- <left_val>-0.5041580200195313</left_val>
- <right_val>0.3837450146675110</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 9 6 -1.</_>
- <_>10 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0392309986054897</threshold>
- <left_val>0.0426190011203289</left_val>
- <right_val>-1.3875889778137207</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 2 6 9 -1.</_>
- <_>12 2 3 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0622380003333092</threshold>
- <left_val>0.1411940008401871</left_val>
- <right_val>-1.0688860416412354</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 2 6 9 -1.</_>
- <_>9 2 3 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.1399999968707561e-003</threshold>
- <left_val>-0.8962240219116211</left_val>
- <right_val>0.1979639977216721</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 18 12 6 -1.</_>
- <_>6 20 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.1800000518560410e-004</threshold>
- <left_val>-0.4533729851245880</left_val>
- <right_val>0.4353269934654236</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 6 9 -1.</_>
- <_>9 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.9169998168945313e-003</threshold>
- <left_val>0.3382279872894287</left_val>
- <right_val>-0.4479300081729889</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 12 3 -1.</_>
- <_>7 7 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0238669998943806</threshold>
- <left_val>-0.7890859842300415</left_val>
- <right_val>0.2251179963350296</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 3 8 21 -1.</_>
- <_>8 10 8 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1026280000805855</threshold>
- <left_val>-2.2831439971923828</left_val>
- <right_val>-5.3960001096129417e-003</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 4 10 12 -1.</_>
- <_>7 8 10 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.5239998772740364e-003</threshold>
- <left_val>0.3934670090675354</left_val>
- <right_val>-0.5224220156669617</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 9 -1.</_>
- <_>0 4 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0398770011961460</threshold>
- <left_val>0.0327990017831326</left_val>
- <right_val>-1.5079489946365356</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 2 2 20 -1.</_>
- <_>15 2 1 20 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0131449997425079</threshold>
- <left_val>-1.0839990377426147</left_val>
- <right_val>0.1848240047693253</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 9 -1.</_>
- <_>0 6 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0505909994244576</threshold>
- <left_val>-1.8822289705276489</left_val>
- <right_val>-2.2199999075382948e-003</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 3 2 21 -1.</_>
- <_>15 3 1 21 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0249170009046793</threshold>
- <left_val>0.1459340006113052</left_val>
- <right_val>-2.2196519374847412</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 2 23 -1.</_>
- <_>8 0 1 23 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.6370001770555973e-003</threshold>
- <left_val>-1.0164569616317749</left_val>
- <right_val>0.0587970018386841</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 8 9 4 -1.</_>
- <_>15 10 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0429119989275932</threshold>
- <left_val>0.1544300019741058</left_val>
- <right_val>-1.1843889951705933</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 9 4 -1.</_>
- <_>0 10 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.3000000510364771e-004</threshold>
- <left_val>-0.7730579972267151</left_val>
- <right_val>0.1218990013003349</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 14 9 6 -1.</_>
- <_>8 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.0929996222257614e-003</threshold>
- <left_val>-0.1145009994506836</left_val>
- <right_val>0.7109130024909973</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 9 6 -1.</_>
- <_>0 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0111450003460050</threshold>
- <left_val>0.0700009986758232</left_val>
- <right_val>-1.0534820556640625</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 18 4 -1.</_>
- <_>9 10 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0524530000984669</threshold>
- <left_val>-1.7594360113143921</left_val>
- <right_val>0.1952379941940308</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 19 -1.</_>
- <_>8 0 8 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2302069962024689</threshold>
- <left_val>0.9584029912948608</left_val>
- <right_val>-0.2504569888114929</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 8 12 -1.</_>
- <_>9 7 8 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0163659993559122</threshold>
- <left_val>0.4673190116882324</left_val>
- <right_val>-0.2110839933156967</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 10 -1.</_>
- <_>12 6 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0172080006450415</threshold>
- <left_val>0.7083569765090942</left_val>
- <right_val>-0.2801829874515533</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 9 10 12 -1.</_>
- <_>12 9 5 6 2.</_>
- <_>7 15 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0366480015218258</threshold>
- <left_val>-1.1013339757919312</left_val>
- <right_val>0.2434110045433044</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 3 19 -1.</_>
- <_>6 0 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0103049995377660</threshold>
- <left_val>-1.0933129787445068</left_val>
- <right_val>0.0562589988112450</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 6 10 -1.</_>
- <_>16 0 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0137130003422499</threshold>
- <left_val>-0.2643809914588928</left_val>
- <right_val>0.1982100009918213</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 6 12 -1.</_>
- <_>2 0 3 6 2.</_>
- <_>5 6 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0293080005794764</threshold>
- <left_val>-0.2214239984750748</left_val>
- <right_val>1.0525950193405151</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 24 2 -1.</_>
- <_>0 12 24 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0240770000964403</threshold>
- <left_val>0.1848569959402084</left_val>
- <right_val>-1.7203969955444336</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 9 13 4 -1.</_>
- <_>4 11 13 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.1280000954866409e-003</threshold>
- <left_val>-0.9272149801254273</left_val>
- <right_val>0.0587529987096787</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 6 9 -1.</_>
- <_>9 11 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0223779994994402</threshold>
- <left_val>1.9646559953689575</left_val>
- <right_val>0.0277859997004271</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 16 4 -1.</_>
- <_>0 14 16 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.0440000854432583e-003</threshold>
- <left_val>0.2142760008573532</left_val>
- <right_val>-0.4840759932994843</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 12 6 9 -1.</_>
- <_>18 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0406030006706715</threshold>
- <left_val>-1.1754349470138550</left_val>
- <right_val>0.1606120020151138</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 6 9 -1.</_>
- <_>0 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0244660004973412</threshold>
- <left_val>-1.1239900588989258</left_val>
- <right_val>0.0411100015044212</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 10 4 -1.</_>
- <_>8 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.5309999473392963e-003</threshold>
- <left_val>-0.1716970056295395</left_val>
- <right_val>0.3217880129814148</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 6 9 -1.</_>
- <_>10 7 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0195889994502068</threshold>
- <left_val>0.8272020220756531</left_val>
- <right_val>-0.2637670040130615</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 6 9 -1.</_>
- <_>13 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0296359993517399</threshold>
- <left_val>-1.1524770259857178</left_val>
- <right_val>0.1499930024147034</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0150300003588200</threshold>
- <left_val>-1.0491830110549927</left_val>
- <right_val>0.0401609987020493</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 3 6 15 -1.</_>
- <_>14 3 2 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0607150010764599</threshold>
- <left_val>-1.0903840065002441</left_val>
- <right_val>0.1533080041408539</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 6 15 -1.</_>
- <_>8 3 2 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0127900000661612</threshold>
- <left_val>0.4224860072135925</left_val>
- <right_val>-0.4239920079708099</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 2 9 4 -1.</_>
- <_>15 4 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0202479995787144</threshold>
- <left_val>-0.9186699986457825</left_val>
- <right_val>0.1848569959402084</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 6 7 -1.</_>
- <_>8 10 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0306839998811483</threshold>
- <left_val>-1.5958670377731323</left_val>
- <right_val>2.5760000571608543e-003</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 14 6 10 -1.</_>
- <_>9 19 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0207180008292198</threshold>
- <left_val>-0.6629999876022339</left_val>
- <right_val>0.3103719949722290</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 13 5 8 -1.</_>
- <_>7 17 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.7290000105276704e-003</threshold>
- <left_val>0.1918340027332306</left_val>
- <right_val>-0.6508499979972839</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 5 3 16 -1.</_>
- <_>14 13 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0313940010964870</threshold>
- <left_val>-0.6364300251007080</left_val>
- <right_val>0.1540839970111847</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 17 18 3 -1.</_>
- <_>2 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0190030001103878</threshold>
- <left_val>-0.1891939938068390</left_val>
- <right_val>1.5294510126113892</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 18 19 3 -1.</_>
- <_>5 19 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.1769997701048851e-003</threshold>
- <left_val>-0.1059790030121803</left_val>
- <right_val>0.6485959887504578</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 9 -1.</_>
- <_>11 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0101659996435046</threshold>
- <left_val>-1.0802700519561768</left_val>
- <right_val>0.0371760018169880</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 4 3 18 -1.</_>
- <_>13 4 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.4169999631121755e-003</threshold>
- <left_val>0.3415749967098236</left_val>
- <right_val>-0.0977379977703094</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 4 3 18 -1.</_>
- <_>10 4 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.0799998678267002e-003</threshold>
- <left_val>0.4762459993362427</left_val>
- <right_val>-0.3436630070209503</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 3 18 9 -1.</_>
- <_>9 3 6 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0440969988703728</threshold>
- <left_val>0.9763429760932922</left_val>
- <right_val>-0.0191730000078678</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 6 14 -1.</_>
- <_>8 1 2 14 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0606699995696545</threshold>
- <left_val>-2.1752851009368896</left_val>
- <right_val>-0.0289259999990463</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 16 9 6 -1.</_>
- <_>12 19 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0329319983720779</threshold>
- <left_val>-0.6438310146331787</left_val>
- <right_val>0.1649409979581833</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 3 20 16 -1.</_>
- <_>1 3 10 8 2.</_>
- <_>11 11 10 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1472280025482178</threshold>
- <left_val>-1.4745830297470093</left_val>
- <right_val>2.5839998852461576e-003</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 5 6 12 -1.</_>
- <_>15 5 3 6 2.</_>
- <_>12 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0119300000369549</threshold>
- <left_val>0.4244140088558197</left_val>
- <right_val>-0.1771260052919388</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 22 16 -1.</_>
- <_>1 2 11 8 2.</_>
- <_>12 10 11 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1451790034770966</threshold>
- <left_val>0.0254449993371964</left_val>
- <right_val>-1.2779400348663330</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 5 10 -1.</_>
- <_>10 19 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0514479987323284</threshold>
- <left_val>0.1567839980125427</left_val>
- <right_val>-1.5188430547714233</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 18 3 -1.</_>
- <_>3 22 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.1479999888688326e-003</threshold>
- <left_val>-0.4042440056800842</left_val>
- <right_val>0.3242970108985901</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 6 10 -1.</_>
- <_>12 14 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0436000004410744</threshold>
- <left_val>-1.9932260513305664</left_val>
- <right_val>0.1501860022544861</right_val></_></_></trees>
- <stage_threshold>-3.8832089900970459</stage_threshold>
- <parent>6</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 8 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 4 -1.</_>
- <_>8 2 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1289959996938705</threshold>
- <left_val>-0.6216199994087219</left_val>
- <right_val>1.1116520166397095</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 9 -1.</_>
- <_>6 7 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0912619978189468</threshold>
- <left_val>1.0143059492111206</left_val>
- <right_val>-0.6133520007133484</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 5 -1.</_>
- <_>10 6 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0142719997093081</threshold>
- <left_val>-1.0261659622192383</left_val>
- <right_val>0.3977999985218048</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 14 12 -1.</_>
- <_>5 12 14 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0328899994492531</threshold>
- <left_val>-1.1386079788208008</left_val>
- <right_val>0.2869080007076263</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 14 8 10 -1.</_>
- <_>4 14 4 5 2.</_>
- <_>8 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0125900004059076</threshold>
- <left_val>-0.5664560198783875</left_val>
- <right_val>0.4517239928245544</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 5 14 -1.</_>
- <_>11 13 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0146610001102090</threshold>
- <left_val>0.3050599992275238</left_val>
- <right_val>-0.6812959909439087</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 3 16 -1.</_>
- <_>7 14 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0335559993982315</threshold>
- <left_val>-1.7208939790725708</left_val>
- <right_val>0.0614390000700951</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 18 8 -1.</_>
- <_>9 7 6 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1425269991159439</threshold>
- <left_val>0.2319220006465912</left_val>
- <right_val>-1.7297149896621704</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 3 20 2 -1.</_>
- <_>2 4 20 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.2079997733235359e-003</threshold>
- <left_val>-1.2163300514221191</left_val>
- <right_val>0.1216019988059998</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 12 19 6 -1.</_>
- <_>3 14 19 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0181789994239807</threshold>
- <left_val>0.3255369961261749</left_val>
- <right_val>-0.8100399971008301</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 6 9 -1.</_>
- <_>10 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0250369999557734</threshold>
- <left_val>-0.3169879913330078</left_val>
- <right_val>0.6736140251159668</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 6 6 14 -1.</_>
- <_>16 6 3 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0465609990060329</threshold>
- <left_val>-0.1108980029821396</left_val>
- <right_val>0.8408250212669373</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 9 6 12 -1.</_>
- <_>9 9 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.9999996125698090e-003</threshold>
- <left_val>0.3957450091838837</left_val>
- <right_val>-0.4762459993362427</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 6 6 18 -1.</_>
- <_>21 6 3 9 2.</_>
- <_>18 15 3 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0408059991896153</threshold>
- <left_val>-1.8000000272877514e-004</left_val>
- <right_val>0.9457070231437683</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 6 18 -1.</_>
- <_>0 6 3 9 2.</_>
- <_>3 15 3 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0342219993472099</threshold>
- <left_val>0.7520629763603210</left_val>
- <right_val>-0.3153150081634522</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 9 -1.</_>
- <_>18 5 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0397160016000271</threshold>
- <left_val>-0.8313959836959839</left_val>
- <right_val>0.1774439960718155</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 15 6 -1.</_>
- <_>3 20 15 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.5170000735670328e-003</threshold>
- <left_val>-0.5937799811363220</left_val>
- <right_val>0.2465700060129166</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 9 -1.</_>
- <_>18 5 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0274289995431900</threshold>
- <left_val>0.1599839925765991</left_val>
- <right_val>-0.4278199970722199</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 9 -1.</_>
- <_>0 5 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0349860005080700</threshold>
- <left_val>0.0350559987127781</left_val>
- <right_val>-1.5988600254058838</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 18 2 -1.</_>
- <_>5 11 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.4970000162720680e-003</threshold>
- <left_val>-0.5203430056571960</left_val>
- <right_val>0.3782829940319061</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 12 6 -1.</_>
- <_>6 2 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.7699999045580626e-003</threshold>
- <left_val>-0.5318260192871094</left_val>
- <right_val>0.2495100051164627</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 6 9 -1.</_>
- <_>12 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0351740010082722</threshold>
- <left_val>0.1998340040445328</left_val>
- <right_val>-1.4446129798889160</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 6 9 -1.</_>
- <_>10 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0259709991514683</threshold>
- <left_val>0.0444269999861717</left_val>
- <right_val>-1.3622980117797852</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 12 9 6 -1.</_>
- <_>15 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0157839991152287</threshold>
- <left_val>-0.9102039933204651</left_val>
- <right_val>0.2719030082225800</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 13 6 -1.</_>
- <_>3 8 13 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.5880000367760658e-003</threshold>
- <left_val>0.0920649990439415</left_val>
- <right_val>-0.8162890076637268</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 12 9 6 -1.</_>
- <_>15 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0207540001720190</threshold>
- <left_val>0.2118570059537888</left_val>
- <right_val>-0.7472900152206421</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 6 15 -1.</_>
- <_>5 5 3 15 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0598290003836155</threshold>
- <left_val>-0.2730109989643097</left_val>
- <right_val>0.8092330098152161</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 9 6 -1.</_>
- <_>11 8 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0390390008687973</threshold>
- <left_val>-0.1043229997158051</left_val>
- <right_val>0.8622620105743408</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 3 14 -1.</_>
- <_>8 13 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0216659996658564</threshold>
- <left_val>0.0627090036869049</left_val>
- <right_val>-0.9889429807662964</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 12 9 6 -1.</_>
- <_>15 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0274969991296530</threshold>
- <left_val>-0.9269099831581116</left_val>
- <right_val>0.1558630019426346</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 10 4 -1.</_>
- <_>9 12 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0104620000347495</threshold>
- <left_val>0.1341809928417206</left_val>
- <right_val>-0.7038639783859253</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 1 4 19 -1.</_>
- <_>13 1 2 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0248709991574287</threshold>
- <left_val>0.1970670074224472</left_val>
- <right_val>-0.4026330113410950</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 4 19 -1.</_>
- <_>9 1 2 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0160360001027584</threshold>
- <left_val>-1.1409829854965210</left_val>
- <right_val>0.0739979967474937</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 9 6 9 -1.</_>
- <_>18 12 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0486270003020763</threshold>
- <left_val>0.1699039936065674</left_val>
- <right_val>-0.7215219736099243</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 21 18 3 -1.</_>
- <_>1 22 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.2619999470189214e-003</threshold>
- <left_val>-0.4738979935646057</left_val>
- <right_val>0.2625499963760376</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 10 9 -1.</_>
- <_>14 16 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0880350023508072</threshold>
- <left_val>-2.1606519222259521</left_val>
- <right_val>0.1455480009317398</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 22 4 -1.</_>
- <_>1 13 11 2 2.</_>
- <_>12 15 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0183569993823767</threshold>
- <left_val>0.0447509996592999</left_val>
- <right_val>-1.0766370296478271</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 16 6 -1.</_>
- <_>12 6 8 3 2.</_>
- <_>4 9 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0352750010788441</threshold>
- <left_val>-0.0329190008342266</left_val>
- <right_val>1.2153890132904053</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 18 22 -1.</_>
- <_>1 0 9 11 2.</_>
- <_>10 11 9 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2039290070533752</threshold>
- <left_val>-1.3187999725341797</left_val>
- <right_val>0.0155039997771382</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 8 14 -1.</_>
- <_>14 7 4 7 2.</_>
- <_>10 14 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0166190005838871</threshold>
- <left_val>0.3685019910335541</left_val>
- <right_val>-0.1528369933366776</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 6 20 -1.</_>
- <_>0 4 3 10 2.</_>
- <_>3 14 3 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0377390012145042</threshold>
- <left_val>-0.2572779953479767</left_val>
- <right_val>0.7065529823303223</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 6 9 -1.</_>
- <_>17 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.2720000706613064e-003</threshold>
- <left_val>-0.0776029974222183</left_val>
- <right_val>0.3336780071258545</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 6 9 -1.</_>
- <_>5 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0148029997944832</threshold>
- <left_val>-0.7852479815483093</left_val>
- <right_val>0.0769340023398399</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 12 6 12 -1.</_>
- <_>18 12 3 6 2.</_>
- <_>15 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0483190007507801</threshold>
- <left_val>1.7022320032119751</left_val>
- <right_val>0.0497220009565353</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 12 6 12 -1.</_>
- <_>3 12 3 6 2.</_>
- <_>6 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0295390002429485</threshold>
- <left_val>0.7767069935798645</left_val>
- <right_val>-0.2453429996967316</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 12 9 6 -1.</_>
- <_>15 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0461690016090870</threshold>
- <left_val>-1.4922779798507690</left_val>
- <right_val>0.1234000027179718</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 9 6 -1.</_>
- <_>0 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0280649997293949</threshold>
- <left_val>-2.1345369815826416</left_val>
- <right_val>-0.0257970001548529</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 14 19 3 -1.</_>
- <_>4 15 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.7339998893439770e-003</threshold>
- <left_val>0.5698260068893433</left_val>
- <right_val>-0.1205660030245781</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 13 19 3 -1.</_>
- <_>2 14 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0101110003888607</threshold>
- <left_val>0.6791139841079712</left_val>
- <right_val>-0.2663800120353699</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 10 6 -1.</_>
- <_>14 17 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0113599998876452</threshold>
- <left_val>0.2478979974985123</left_val>
- <right_val>-0.6449300050735474</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 10 12 -1.</_>
- <_>6 0 5 6 2.</_>
- <_>11 6 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0518090017139912</threshold>
- <left_val>0.0147160002961755</left_val>
- <right_val>-1.2395579814910889</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 1 6 12 -1.</_>
- <_>20 1 3 6 2.</_>
- <_>17 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0332919992506504</threshold>
- <left_val>-8.2559995353221893e-003</left_val>
- <right_val>1.0168470144271851</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 6 12 -1.</_>
- <_>1 1 3 6 2.</_>
- <_>4 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0144940000027418</threshold>
- <left_val>0.4506680071353912</left_val>
- <right_val>-0.3625099956989288</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 14 6 9 -1.</_>
- <_>16 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0342219993472099</threshold>
- <left_val>-0.9529250264167786</left_val>
- <right_val>0.2068459987640381</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 3 9 12 -1.</_>
- <_>7 9 9 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0806540027260780</threshold>
- <left_val>-2.0139501094818115</left_val>
- <right_val>-0.0230849999934435</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 4 12 -1.</_>
- <_>12 7 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.9399999706074595e-004</threshold>
- <left_val>0.3957200050354004</left_val>
- <right_val>-0.2935130000114441</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 14 8 -1.</_>
- <_>4 4 14 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0971620008349419</threshold>
- <left_val>-0.2498030066490173</left_val>
- <right_val>1.0859220027923584</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 6 9 -1.</_>
- <_>12 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0366140007972717</threshold>
- <left_val>-0.0578440017998219</left_val>
- <right_val>1.2162159681320190</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 10 18 3 -1.</_>
- <_>8 10 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0516939982771873</threshold>
- <left_val>0.0430629998445511</left_val>
- <right_val>-1.0636160373687744</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 15 9 6 -1.</_>
- <_>15 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0245570000261068</threshold>
- <left_val>-0.4894680082798004</left_val>
- <right_val>0.1718290001153946</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 21 23 -1.</_>
- <_>7 1 7 23 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.3273679912090302</threshold>
- <left_val>-0.2968859970569611</left_val>
- <right_val>0.5179830193519592</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 17 4 -1.</_>
- <_>6 11 17 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.6959999278187752e-003</threshold>
- <left_val>-0.5980589985847473</left_val>
- <right_val>0.2480320036411285</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 11 18 -1.</_>
- <_>1 6 11 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1617220044136047</threshold>
- <left_val>-0.0296139996498823</left_val>
- <right_val>-2.3162529468536377</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 15 13 6 -1.</_>
- <_>6 17 13 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.7889999113976955e-003</threshold>
- <left_val>0.3745790123939514</left_val>
- <right_val>-0.3277919888496399</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 9 6 -1.</_>
- <_>0 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0184029992669821</threshold>
- <left_val>-0.9969270229339600</left_val>
- <right_val>0.0729480013251305</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 15 4 -1.</_>
- <_>13 7 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0776650011539459</threshold>
- <left_val>0.1417569965124130</left_val>
- <right_val>-1.7238730192184448</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 9 -1.</_>
- <_>9 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0189210008829832</threshold>
- <left_val>-0.2127310037612915</left_val>
- <right_val>1.0165189504623413</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 18 3 -1.</_>
- <_>12 8 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0793979987502098</threshold>
- <left_val>-1.3164349794387817</left_val>
- <right_val>0.1498199999332428</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 24 4 -1.</_>
- <_>8 14 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0680370032787323</threshold>
- <left_val>0.4942199885845184</left_val>
- <right_val>-0.2909100055694580</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 10 3 12 -1.</_>
- <_>16 16 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.1010001227259636e-003</threshold>
- <left_val>0.4243049919605255</left_val>
- <right_val>-0.3389930129051209</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 24 3 -1.</_>
- <_>0 4 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0319270007312298</threshold>
- <left_val>-0.0310469996184111</left_val>
- <right_val>-2.3459999561309814</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 17 10 6 -1.</_>
- <_>14 19 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0298439990729094</threshold>
- <left_val>-0.7898960113525391</left_val>
- <right_val>0.1541769951581955</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 18 3 -1.</_>
- <_>7 13 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0805419981479645</threshold>
- <left_val>-2.2509229183197021</left_val>
- <right_val>-0.0309069994837046</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 18 9 -1.</_>
- <_>5 3 18 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.8109999150037766e-003</threshold>
- <left_val>-0.2557730078697205</left_val>
- <right_val>0.2378550022840500</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 16 9 -1.</_>
- <_>4 6 16 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0336470007896423</threshold>
- <left_val>-0.2254139930009842</left_val>
- <right_val>0.9230740070343018</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 5 3 12 -1.</_>
- <_>16 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.2809999585151672e-003</threshold>
- <left_val>-0.2889620065689087</left_val>
- <right_val>0.3104619979858398</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 18 4 -1.</_>
- <_>6 7 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1010439991950989</threshold>
- <left_val>-0.0348640009760857</left_val>
- <right_val>-2.7102620601654053</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 6 9 -1.</_>
- <_>12 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0100090000778437</threshold>
- <left_val>0.5971540212631226</left_val>
- <right_val>-0.0338310003280640</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 6 10 -1.</_>
- <_>11 8 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.1919998154044151e-003</threshold>
- <left_val>-0.4773800075054169</left_val>
- <right_val>0.2268600016832352</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 15 6 9 -1.</_>
- <_>11 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0249690003693104</threshold>
- <left_val>0.2287770062685013</left_val>
- <right_val>-1.0435529947280884</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 18 21 -1.</_>
- <_>12 1 9 21 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2790800034999847</threshold>
- <left_val>-0.2581810057163239</left_val>
- <right_val>0.7678049802780151</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 12 7 -1.</_>
- <_>6 8 6 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0442130006849766</threshold>
- <left_val>-0.5979800224304199</left_val>
- <right_val>0.2803989946842194</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 5 6 9 -1.</_>
- <_>10 5 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0141369998455048</threshold>
- <left_val>0.7098730206489563</left_val>
- <right_val>-0.2564519941806793</right_val></_></_></trees>
- <stage_threshold>-3.8424909114837646</stage_threshold>
- <parent>7</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 9 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 4 -1.</_>
- <_>8 2 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1377120018005371</threshold>
- <left_val>-0.5587059855461121</left_val>
- <right_val>1.0953769683837891</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 7 5 12 -1.</_>
- <_>14 11 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0344609990715981</threshold>
- <left_val>-0.7117189764976502</left_val>
- <right_val>0.5289959907531738</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 5 12 -1.</_>
- <_>5 11 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0185800008475780</threshold>
- <left_val>-1.1157519817352295</left_val>
- <right_val>0.4059399962425232</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0250419992953539</threshold>
- <left_val>-0.4089249968528748</left_val>
- <right_val>0.7412999868392944</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 17 -1.</_>
- <_>3 1 3 17 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0571790002286434</threshold>
- <left_val>-0.3805429935455322</left_val>
- <right_val>0.7364770174026489</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 19 9 -1.</_>
- <_>3 4 19 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0149320000782609</threshold>
- <left_val>-0.6994550228118897</left_val>
- <right_val>0.3795099854469299</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 12 6 -1.</_>
- <_>3 18 6 3 2.</_>
- <_>9 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.8900001719594002e-003</threshold>
- <left_val>-0.5455859899520874</left_val>
- <right_val>0.3633249998092651</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 4 4 19 -1.</_>
- <_>20 4 2 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0304359998553991</threshold>
- <left_val>-0.1012459993362427</left_val>
- <right_val>0.7958589792251587</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 10 7 -1.</_>
- <_>5 16 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0441600009799004</threshold>
- <left_val>0.8441089987754822</left_val>
- <right_val>-0.3297640085220337</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 10 12 -1.</_>
- <_>13 7 5 6 2.</_>
- <_>8 13 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0184610001742840</threshold>
- <left_val>0.2632659971714020</left_val>
- <right_val>-0.9673650264739990</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 10 12 -1.</_>
- <_>6 7 5 6 2.</_>
- <_>11 13 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0106149995699525</threshold>
- <left_val>0.1525190025568008</left_val>
- <right_val>-1.0589870214462280</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 2 9 6 -1.</_>
- <_>12 2 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0459740012884140</threshold>
- <left_val>-1.9918340444564819</left_val>
- <right_val>0.1362909972667694</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 20 21 4 -1.</_>
- <_>8 20 7 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0829000025987625</threshold>
- <left_val>-0.3203719854354858</left_val>
- <right_val>0.6030420064926148</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 9 6 -1.</_>
- <_>9 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.9130001142621040e-003</threshold>
- <left_val>0.5958660244941711</left_val>
- <right_val>-0.2113959938287735</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 2 9 6 -1.</_>
- <_>10 2 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0428140014410019</threshold>
- <left_val>0.0229250006377697</left_val>
- <right_val>-1.4679330587387085</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 4 14 -1.</_>
- <_>13 0 2 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.7139997631311417e-003</threshold>
- <left_val>-0.4398950040340424</left_val>
- <right_val>0.2043969929218292</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 4 14 -1.</_>
- <_>9 0 2 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.3390002101659775e-003</threshold>
- <left_val>-0.8906679749488831</left_val>
- <right_val>0.1046999990940094</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 9 6 -1.</_>
- <_>14 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.0749997869133949e-003</threshold>
- <left_val>0.2116419970989227</left_val>
- <right_val>-0.4023160040378571</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 8 18 5 -1.</_>
- <_>8 8 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0967390015721321</threshold>
- <left_val>0.0133199999108911</left_val>
- <right_val>-1.6085360050201416</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 3 6 11 -1.</_>
- <_>20 3 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0305369999259710</threshold>
- <left_val>1.0063740015029907</left_val>
- <right_val>-0.1341329962015152</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 11 14 -1.</_>
- <_>6 12 11 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0608559995889664</threshold>
- <left_val>-1.4689979553222656</left_val>
- <right_val>9.4240000471472740e-003</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 4 6 9 -1.</_>
- <_>18 7 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0381620004773140</threshold>
- <left_val>-0.8163639903068543</left_val>
- <right_val>0.2617120146751404</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 9 6 -1.</_>
- <_>7 8 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.6960002556443214e-003</threshold>
- <left_val>0.1156169995665550</left_val>
- <right_val>-0.7169319987297058</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 4 6 9 -1.</_>
- <_>18 7 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0489029996097088</threshold>
- <left_val>0.1305049955844879</left_val>
- <right_val>-1.6448370218276978</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 6 9 -1.</_>
- <_>0 7 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0416119992733002</threshold>
- <left_val>-1.1795840263366699</left_val>
- <right_val>0.0250170007348061</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 4 9 4 -1.</_>
- <_>9 6 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0201880000531673</threshold>
- <left_val>0.6318820118904114</left_val>
- <right_val>-0.1049040034413338</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 22 19 2 -1.</_>
- <_>0 23 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.7900000400841236e-004</threshold>
- <left_val>0.1850779950618744</left_val>
- <right_val>-0.5356590151786804</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 14 6 9 -1.</_>
- <_>17 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0336220003664494</threshold>
- <left_val>-0.9312760233879089</left_val>
- <right_val>0.2007150053977966</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 14 6 9 -1.</_>
- <_>1 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0194559991359711</threshold>
- <left_val>0.0380290001630783</left_val>
- <right_val>-1.0112210512161255</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 11 4 9 -1.</_>
- <_>14 11 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.1800000579096377e-004</threshold>
- <left_val>0.3645769953727722</left_val>
- <right_val>-0.2761090099811554</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 4 9 -1.</_>
- <_>8 11 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.8899999344721437e-004</threshold>
- <left_val>0.1966589987277985</left_val>
- <right_val>-0.5341050028800964</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 18 7 -1.</_>
- <_>9 9 6 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0934960022568703</threshold>
- <left_val>-1.6772350072860718</left_val>
- <right_val>0.2072709947824478</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 10 -1.</_>
- <_>9 17 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0778779983520508</threshold>
- <left_val>-3.0760629177093506</left_val>
- <right_val>-0.0358039997518063</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 6 9 -1.</_>
- <_>14 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0169479995965958</threshold>
- <left_val>0.2144739925861359</left_val>
- <right_val>-0.7137629985809326</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 6 9 -1.</_>
- <_>8 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0214590001851320</threshold>
- <left_val>-1.1468060016632080</left_val>
- <right_val>0.0158559996634722</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 17 18 3 -1.</_>
- <_>6 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0128659997135401</threshold>
- <left_val>0.8381239771842957</left_val>
- <right_val>-0.0659440010786057</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 17 18 3 -1.</_>
- <_>1 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.8220004215836525e-003</threshold>
- <left_val>-0.2802680134773254</left_val>
- <right_val>0.7937690019607544</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 11 12 -1.</_>
- <_>10 12 11 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1029440015554428</threshold>
- <left_val>0.1783230006694794</left_val>
- <right_val>-0.6841220259666443</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 6 -1.</_>
- <_>5 6 7 3 2.</_>
- <_>12 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0374879986047745</threshold>
- <left_val>0.9618999958038330</left_val>
- <right_val>-0.2173559963703156</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 15 4 -1.</_>
- <_>5 6 15 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0255059991031885</threshold>
- <left_val>0.0101039996370673</left_val>
- <right_val>1.2461110353469849</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 22 2 -1.</_>
- <_>0 1 22 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.6700001480057836e-004</threshold>
- <left_val>-0.5348820090293884</left_val>
- <right_val>0.1474629938602448</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 24 -1.</_>
- <_>8 0 8 24 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2886790037155151</threshold>
- <left_val>0.8217279911041260</left_val>
- <right_val>-0.0149480002000928</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 15 18 4 -1.</_>
- <_>10 15 9 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0912949964404106</threshold>
- <left_val>-0.1960539966821671</left_val>
- <right_val>1.0803170204162598</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 12 9 -1.</_>
- <_>6 11 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1205660030245781</threshold>
- <left_val>-0.0238489992916584</left_val>
- <right_val>1.1392610073089600</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 7 12 -1.</_>
- <_>4 16 7 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0737750008702278</threshold>
- <left_val>-1.3583840131759644</left_val>
- <right_val>-4.2039998807013035e-003</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 22 6 -1.</_>
- <_>12 2 11 3 2.</_>
- <_>1 5 11 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0331280007958412</threshold>
- <left_val>-0.6448320150375366</left_val>
- <right_val>0.2414219975471497</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 20 14 3 -1.</_>
- <_>12 20 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0439370013773441</threshold>
- <left_val>0.8428540229797363</left_val>
- <right_val>-0.2062480002641678</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 16 -1.</_>
- <_>12 0 12 8 2.</_>
- <_>0 8 12 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1811019927263260</threshold>
- <left_val>0.1921209990978241</left_val>
- <right_val>-1.2222139835357666</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 13 18 4 -1.</_>
- <_>3 13 9 2 2.</_>
- <_>12 15 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0118509996682405</threshold>
- <left_val>-0.7267739772796631</left_val>
- <right_val>0.0526879988610744</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 10 22 2 -1.</_>
- <_>2 11 22 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.5920000411570072e-003</threshold>
- <left_val>-0.3630520105361939</left_val>
- <right_val>0.2922379970550537</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 11 8 -1.</_>
- <_>6 7 11 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.0620002225041389e-003</threshold>
- <left_val>0.0581160001456738</left_val>
- <right_val>-0.6716160178184509</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 5 6 6 -1.</_>
- <_>14 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0237150005996227</threshold>
- <left_val>0.4714210033416748</left_val>
- <right_val>0.0185800008475780</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 24 6 -1.</_>
- <_>0 9 24 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0671719983220100</threshold>
- <left_val>-1.1331889629364014</left_val>
- <right_val>0.0237809997051954</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 10 10 -1.</_>
- <_>19 0 5 5 2.</_>
- <_>14 5 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0653100013732910</threshold>
- <left_val>0.9825350046157837</left_val>
- <right_val>0.0283620003610849</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 10 10 -1.</_>
- <_>0 0 5 5 2.</_>
- <_>5 5 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0227910000830889</threshold>
- <left_val>-0.2821370065212250</left_val>
- <right_val>0.5899339914321899</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 4 -1.</_>
- <_>12 1 12 2 2.</_>
- <_>0 3 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0190379992127419</threshold>
- <left_val>-0.6371150016784668</left_val>
- <right_val>0.2651459872722626</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 18 3 -1.</_>
- <_>0 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.8689999170601368e-003</threshold>
- <left_val>0.3748730123043060</left_val>
- <right_val>-0.3323209881782532</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 15 16 6 -1.</_>
- <_>13 15 8 3 2.</_>
- <_>5 18 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0401460006833076</threshold>
- <left_val>-1.3048729896545410</left_val>
- <right_val>0.1572429984807968</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 15 16 6 -1.</_>
- <_>3 15 8 3 2.</_>
- <_>11 18 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0405309982597828</threshold>
- <left_val>-2.0458049774169922</left_val>
- <right_val>-0.0269259996712208</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 18 3 -1.</_>
- <_>6 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0122539997100830</threshold>
- <left_val>0.7764940261840820</left_val>
- <right_val>-0.0429710000753403</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 21 10 -1.</_>
- <_>0 18 21 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0272199995815754</threshold>
- <left_val>0.1742440015077591</left_val>
- <right_val>-0.4460090100765228</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 6 24 -1.</_>
- <_>15 0 2 24 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0883660018444061</threshold>
- <left_val>-1.5036419630050659</left_val>
- <right_val>0.1428990066051483</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 4 6 11 -1.</_>
- <_>9 4 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.9159997403621674e-003</threshold>
- <left_val>0.2866669893264771</left_val>
- <right_val>-0.3792369961738586</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 9 6 -1.</_>
- <_>12 5 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0419600009918213</threshold>
- <left_val>1.3846950531005859</left_val>
- <right_val>0.0650269985198975</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 4 2 20 -1.</_>
- <_>1 14 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0456629991531372</threshold>
- <left_val>-0.2245229929685593</left_val>
- <right_val>0.7952100038528442</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 6 24 -1.</_>
- <_>15 0 2 24 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1409060060977936</threshold>
- <left_val>-1.5879319906234741</left_val>
- <right_val>0.1135900020599365</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 6 24 -1.</_>
- <_>7 0 2 24 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0592160001397133</threshold>
- <left_val>-1.1945960521697998</left_val>
- <right_val>-7.1640000678598881e-003</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 7 6 14 -1.</_>
- <_>19 7 3 7 2.</_>
- <_>16 14 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.3390002101659775e-003</threshold>
- <left_val>-0.1552869975566864</left_val>
- <right_val>0.4066449999809265</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 4 12 -1.</_>
- <_>6 7 2 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.0369999110698700e-003</threshold>
- <left_val>0.2592790126800537</left_val>
- <right_val>-0.3836829960346222</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 24 14 -1.</_>
- <_>8 5 8 14 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2751649916172028</threshold>
- <left_val>-0.0884979963302612</left_val>
- <right_val>0.7678750157356262</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 13 10 6 -1.</_>
- <_>5 15 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0266019999980927</threshold>
- <left_val>0.7502449750900269</left_val>
- <right_val>-0.2262199968099594</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 6 9 -1.</_>
- <_>14 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0409060008823872</threshold>
- <left_val>0.1215860024094582</left_val>
- <right_val>-1.4566910266876221</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 6 14 -1.</_>
- <_>2 7 3 7 2.</_>
- <_>5 14 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.5320002138614655e-003</threshold>
- <left_val>-0.3661150038242340</left_val>
- <right_val>0.2596859931945801</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 2 9 15 -1.</_>
- <_>18 2 3 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0318790003657341</threshold>
- <left_val>-0.0750190019607544</left_val>
- <right_val>0.4848479926586151</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 9 -1.</_>
- <_>2 2 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0414820015430450</threshold>
- <left_val>0.7822039723396301</left_val>
- <right_val>-0.2199220061302185</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 2 10 14 -1.</_>
- <_>17 2 5 7 2.</_>
- <_>12 9 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0961309969425201</threshold>
- <left_val>-0.8945630192756653</left_val>
- <right_val>0.1468070000410080</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 2 18 -1.</_>
- <_>12 6 1 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0115689998492599</threshold>
- <left_val>0.8271409869194031</left_val>
- <right_val>-0.2027560025453568</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 15 6 -1.</_>
- <_>14 5 5 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0183129999786615</threshold>
- <left_val>0.0163679998368025</left_val>
- <right_val>0.2730680108070374</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 6 10 -1.</_>
- <_>10 6 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0341660007834435</threshold>
- <left_val>1.1307320594787598</left_val>
- <right_val>-0.1881089955568314</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 6 9 -1.</_>
- <_>14 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0244769994169474</threshold>
- <left_val>-0.5779129862785339</left_val>
- <right_val>0.1581249982118607</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 3 9 7 -1.</_>
- <_>6 3 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0489570014178753</threshold>
- <left_val>-0.0225649997591972</left_val>
- <right_val>-1.6373280286788940</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 14 3 -1.</_>
- <_>6 7 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0207029990851879</threshold>
- <left_val>-0.5451210141181946</left_val>
- <right_val>0.2408699989318848</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 8 6 -1.</_>
- <_>11 7 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0230020005255938</threshold>
- <left_val>-1.2236540317535400</left_val>
- <right_val>-7.3440000414848328e-003</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 7 7 12 -1.</_>
- <_>12 13 7 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0645850002765656</threshold>
- <left_val>0.1469559967517853</left_val>
- <right_val>-0.4496749937534332</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 18 -1.</_>
- <_>10 6 2 9 2.</_>
- <_>12 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0126660000532866</threshold>
- <left_val>-0.2787390053272247</left_val>
- <right_val>0.4387660026550293</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 14 6 9 -1.</_>
- <_>16 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0120029998943210</threshold>
- <left_val>-0.2428909987211227</left_val>
- <right_val>0.2535009980201721</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 6 13 -1.</_>
- <_>6 0 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0264439992606640</threshold>
- <left_val>-0.8586480021476746</left_val>
- <right_val>0.0260259993374348</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 21 3 -1.</_>
- <_>9 2 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0255479998886585</threshold>
- <left_val>0.6928790211677551</left_val>
- <right_val>-2.1160000469535589e-003</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 5 12 -1.</_>
- <_>5 8 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0391150005161762</threshold>
- <left_val>-0.1658910065889359</left_val>
- <right_val>1.5209139585494995</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 3 4 10 -1.</_>
- <_>10 8 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.0330000706017017e-003</threshold>
- <left_val>0.4385690093040466</left_val>
- <right_val>-0.2161370068788528</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 4 5 8 -1.</_>
- <_>8 8 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0339369997382164</threshold>
- <left_val>-0.9799839854240418</left_val>
- <right_val>0.0221330001950264</right_val></_></_></trees>
- <stage_threshold>-3.6478610038757324</stage_threshold>
- <parent>8</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 10 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 11 9 -1.</_>
- <_>6 3 11 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0406729988753796</threshold>
- <left_val>-0.9047470092773438</left_val>
- <right_val>0.6441059708595276</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 5 -1.</_>
- <_>10 6 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0256099998950958</threshold>
- <left_val>-0.7921699881553650</left_val>
- <right_val>0.5748999714851379</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 5 -1.</_>
- <_>8 0 8 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1995950043201447</threshold>
- <left_val>-0.3009960055351257</left_val>
- <right_val>1.3143850564956665</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 23 6 -1.</_>
- <_>1 12 23 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0124049996957183</threshold>
- <left_val>-0.8988299965858460</left_val>
- <right_val>0.2920579910278320</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 18 3 -1.</_>
- <_>9 21 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0392079986631870</threshold>
- <left_val>-0.4195519983768463</left_val>
- <right_val>0.5346329808235169</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 21 6 -1.</_>
- <_>3 8 21 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0308439992368221</threshold>
- <left_val>0.4579339921474457</left_val>
- <right_val>-0.4462909996509552</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 6 12 -1.</_>
- <_>2 5 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0355230011045933</threshold>
- <left_val>0.9131050109863281</left_val>
- <right_val>-0.2737320065498352</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 15 -1.</_>
- <_>10 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0616500005125999</threshold>
- <left_val>-1.4697799682617187</left_val>
- <right_val>0.2036409974098206</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 8 10 -1.</_>
- <_>8 12 8 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0117399999871850</threshold>
- <left_val>-1.0482879877090454</left_val>
- <right_val>0.0678019970655441</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 15 12 -1.</_>
- <_>10 7 5 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0669339969754219</threshold>
- <left_val>0.2927449941635132</left_val>
- <right_val>-0.5228289961814880</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 10 6 -1.</_>
- <_>0 19 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0206310003995895</threshold>
- <left_val>-1.2855139970779419</left_val>
- <right_val>0.0445509999990463</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 18 9 6 -1.</_>
- <_>14 20 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0223570000380278</threshold>
- <left_val>-0.8575379848480225</left_val>
- <right_val>0.1843400001525879</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 16 -1.</_>
- <_>9 14 6 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.1500000255182385e-003</threshold>
- <left_val>0.1640550047159195</left_val>
- <right_val>-0.6912500262260437</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 18 9 6 -1.</_>
- <_>14 20 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0358729995787144</threshold>
- <left_val>0.1575649976730347</left_val>
- <right_val>-0.8426259756088257</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 18 9 6 -1.</_>
- <_>1 20 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0306599996984005</threshold>
- <left_val>0.0216370001435280</left_val>
- <right_val>-1.3634690046310425</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 9 9 6 -1.</_>
- <_>15 11 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.5559999309480190e-003</threshold>
- <left_val>-0.1673700064420700</left_val>
- <right_val>0.2588840126991272</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 9 6 -1.</_>
- <_>0 11 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.1160000041127205e-003</threshold>
- <left_val>-0.9727180004119873</left_val>
- <right_val>0.0661000013351440</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 3 6 9 -1.</_>
- <_>19 3 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0303169991821051</threshold>
- <left_val>0.9847419857978821</left_val>
- <right_val>-0.0164480004459620</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 17 18 3 -1.</_>
- <_>2 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.7200004383921623e-003</threshold>
- <left_val>0.4760470092296600</left_val>
- <right_val>-0.3251670002937317</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 15 21 6 -1.</_>
- <_>3 17 21 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0571269989013672</threshold>
- <left_val>-0.9592069983482361</left_val>
- <right_val>0.1993820071220398</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 17 6 6 -1.</_>
- <_>9 20 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.0059997700154781e-003</threshold>
- <left_val>-0.5261250138282776</left_val>
- <right_val>0.2242870032787323</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 3 6 9 -1.</_>
- <_>18 6 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0337340012192726</threshold>
- <left_val>0.1707009971141815</left_val>
- <right_val>-1.0737580060958862</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 9 -1.</_>
- <_>0 6 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0346419997513294</threshold>
- <left_val>-1.1343129873275757</left_val>
- <right_val>0.0365400016307831</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 16 10 -1.</_>
- <_>12 0 8 5 2.</_>
- <_>4 5 8 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0469230003654957</threshold>
- <left_val>0.2583230137825012</left_val>
- <right_val>-0.7153580188751221</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 10 16 -1.</_>
- <_>2 0 5 8 2.</_>
- <_>7 8 5 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.7660001590847969e-003</threshold>
- <left_val>0.1964090019464493</left_val>
- <right_val>-0.5335509777069092</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 10 5 -1.</_>
- <_>14 0 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0656279996037483</threshold>
- <left_val>-0.0511949993669987</left_val>
- <right_val>0.9761070013046265</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 10 5 -1.</_>
- <_>5 0 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0441650003194809</threshold>
- <left_val>1.0631920099258423</left_val>
- <right_val>-0.2346259951591492</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 3 6 10 -1.</_>
- <_>18 3 3 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0173049997538328</threshold>
- <left_val>-0.1858289986848831</left_val>
- <right_val>0.4588989913463593</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 12 6 -1.</_>
- <_>5 11 6 3 2.</_>
- <_>11 14 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0331359989941120</threshold>
- <left_val>-0.0293819997459650</left_val>
- <right_val>-2.6651329994201660</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>21 0 3 18 -1.</_>
- <_>22 0 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0210299994796515</threshold>
- <left_val>0.9997990131378174</left_val>
- <right_val>0.0249370001256466</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 6 9 -1.</_>
- <_>8 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0297839995473623</threshold>
- <left_val>-0.0296059995889664</left_val>
- <right_val>-2.1695868968963623</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 9 7 -1.</_>
- <_>11 8 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0552919991314411</threshold>
- <left_val>-7.5599999399855733e-004</left_val>
- <right_val>0.7465199828147888</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 12 8 10 -1.</_>
- <_>7 12 4 5 2.</_>
- <_>11 17 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0335979983210564</threshold>
- <left_val>-1.5274159908294678</left_val>
- <right_val>0.0110600003972650</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>21 0 3 18 -1.</_>
- <_>22 0 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0196029990911484</threshold>
- <left_val>0.0335749983787537</left_val>
- <right_val>0.9952620267868042</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 9 -1.</_>
- <_>12 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0207870006561279</threshold>
- <left_val>0.7661290168762207</left_val>
- <right_val>-0.2467080056667328</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 9 6 -1.</_>
- <_>15 2 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0325360000133514</threshold>
- <left_val>0.1626340001821518</left_val>
- <right_val>-0.6113430261611939</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 3 -1.</_>
- <_>0 3 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0107880001887679</threshold>
- <left_val>-0.9783970117568970</left_val>
- <right_val>0.0289699994027615</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 7 6 9 -1.</_>
- <_>13 7 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.9560003727674484e-003</threshold>
- <left_val>0.4614579975605011</left_val>
- <right_val>-0.1351049989461899</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 6 10 -1.</_>
- <_>9 6 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.7489999085664749e-003</threshold>
- <left_val>0.2545819878578186</left_val>
- <right_val>-0.5195559859275818</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 6 12 -1.</_>
- <_>14 1 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0417799986898899</threshold>
- <left_val>-0.8056510090827942</left_val>
- <right_val>0.1520850062370300</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 12 -1.</_>
- <_>6 10 12 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0342210009694099</threshold>
- <left_val>-1.3137799501419067</left_val>
- <right_val>-3.5800000187009573e-003</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 3 2 21 -1.</_>
- <_>14 3 1 21 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0101300003007054</threshold>
- <left_val>0.2017579972743988</left_val>
- <right_val>-0.6133959889411926</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 12 8 -1.</_>
- <_>6 5 12 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0898490026593208</threshold>
- <left_val>0.9763280153274536</left_val>
- <right_val>-0.2088479995727539</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 18 8 -1.</_>
- <_>3 4 18 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0260979998856783</threshold>
- <left_val>-0.1880799978971481</left_val>
- <right_val>0.4770579934120178</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 18 3 -1.</_>
- <_>3 1 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.7539999466389418e-003</threshold>
- <left_val>-0.6798040270805359</left_val>
- <right_val>0.1128880009055138</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 24 4 -1.</_>
- <_>12 13 12 2 2.</_>
- <_>0 15 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0319730006158352</threshold>
- <left_val>0.1895170062780380</left_val>
- <right_val>-1.4967479705810547</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 4 9 -1.</_>
- <_>12 5 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0193329993635416</threshold>
- <left_val>-0.2360990047454834</left_val>
- <right_val>0.8132050037384033</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 6 9 -1.</_>
- <_>13 1 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.9490000559017062e-003</threshold>
- <left_val>0.2483039945363998</left_val>
- <right_val>-0.0692119970917702</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 2 6 22 -1.</_>
- <_>8 2 2 22 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0441469997167587</threshold>
- <left_val>-1.0418920516967773</left_val>
- <right_val>0.0480530001223087</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 10 8 14 -1.</_>
- <_>20 10 4 7 2.</_>
- <_>16 17 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0446819998323917</threshold>
- <left_val>0.5134630203247070</left_val>
- <right_val>-7.3799998499453068e-003</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 16 15 -1.</_>
- <_>3 9 16 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1075749993324280</threshold>
- <left_val>1.6202019453048706</left_val>
- <right_val>-0.1866759955883026</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 10 8 14 -1.</_>
- <_>20 10 4 7 2.</_>
- <_>16 17 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1284680068492889</threshold>
- <left_val>2.9869480133056641</left_val>
- <right_val>0.0954279974102974</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 8 14 -1.</_>
- <_>0 10 4 7 2.</_>
- <_>4 17 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0447579994797707</threshold>
- <left_val>0.6040530204772949</left_val>
- <right_val>-0.2705869972705841</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 11 6 -1.</_>
- <_>10 17 11 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0439909994602203</threshold>
- <left_val>-0.6179050207138062</left_val>
- <right_val>0.1599719971418381</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 24 9 -1.</_>
- <_>8 7 8 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1226899996399880</threshold>
- <left_val>0.6632720232009888</left_val>
- <right_val>-0.2363699972629547</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 1 4 16 -1.</_>
- <_>13 1 2 16 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0199829991906881</threshold>
- <left_val>-1.1228660345077515</left_val>
- <right_val>0.1961670070886612</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 4 16 -1.</_>
- <_>9 1 2 16 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0155279999598861</threshold>
- <left_val>-1.0770269632339478</left_val>
- <right_val>0.0206930004060268</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 16 8 -1.</_>
- <_>13 5 8 4 2.</_>
- <_>5 9 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0489710010588169</threshold>
- <left_val>0.8116829991340637</left_val>
- <right_val>-0.0172520000487566</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 6 9 -1.</_>
- <_>0 12 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0559759996831417</threshold>
- <left_val>-0.0225290004163980</left_val>
- <right_val>-1.7356760501861572</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 18 3 -1.</_>
- <_>6 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.8580000922083855e-003</threshold>
- <left_val>0.6788139939308167</left_val>
- <right_val>-0.0581800006330013</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 12 6 9 -1.</_>
- <_>3 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0134810004383326</threshold>
- <left_val>0.0578479990363121</left_val>
- <right_val>-0.7725530266761780</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 14 9 6 -1.</_>
- <_>8 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.5609999001026154e-003</threshold>
- <left_val>-0.1314689964056015</left_val>
- <right_val>0.6705579757690430</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 13 8 10 -1.</_>
- <_>2 13 4 5 2.</_>
- <_>6 18 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.1149999275803566e-003</threshold>
- <left_val>-0.3788059949874878</left_val>
- <right_val>0.3097899854183197</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 5 3 18 -1.</_>
- <_>15 11 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.8159998841583729e-003</threshold>
- <left_val>-0.5847039818763733</left_val>
- <right_val>0.2560209929943085</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 18 3 -1.</_>
- <_>3 6 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.5319999381899834e-003</threshold>
- <left_val>-0.3021700084209442</left_val>
- <right_val>0.4125329852104187</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 5 6 11 -1.</_>
- <_>19 5 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0274749994277954</threshold>
- <left_val>0.5915470123291016</left_val>
- <right_val>0.0179639998823404</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 6 11 -1.</_>
- <_>3 5 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0395199991762638</threshold>
- <left_val>0.9691349864006043</left_val>
- <right_val>-0.2102030068635941</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 1 4 9 -1.</_>
- <_>19 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0306589994579554</threshold>
- <left_val>0.9115589857101440</left_val>
- <right_val>0.0405500009655952</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 4 9 -1.</_>
- <_>3 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.4680000022053719e-003</threshold>
- <left_val>-0.6048979759216309</left_val>
- <right_val>0.1696089953184128</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 15 18 9 -1.</_>
- <_>4 15 9 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1907760053873062</threshold>
- <left_val>0.0435150004923344</left_val>
- <right_val>0.8189290165901184</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 12 4 -1.</_>
- <_>6 11 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.1790000870823860e-003</threshold>
- <left_val>-0.9361730217933655</left_val>
- <right_val>0.0249370001256466</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 2 9 6 -1.</_>
- <_>15 4 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0241260007023811</threshold>
- <left_val>0.1817550063133240</left_val>
- <right_val>-0.3418590128421783</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 9 6 -1.</_>
- <_>0 4 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0263839997351170</threshold>
- <left_val>-1.2912579774856567</left_val>
- <right_val>-3.4280000254511833e-003</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 6 17 -1.</_>
- <_>17 0 2 17 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.4139997810125351e-003</threshold>
- <left_val>-0.0462919995188713</left_val>
- <right_val>0.2526960074901581</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 6 17 -1.</_>
- <_>5 0 2 17 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0542160011827946</threshold>
- <left_val>-0.0128480000421405</left_val>
- <right_val>-1.4304540157318115</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 17 9 4 -1.</_>
- <_>8 19 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.3799999326001853e-004</threshold>
- <left_val>-0.2667669951915741</left_val>
- <right_val>0.3358829915523529</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 3 18 -1.</_>
- <_>6 11 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0152169996872544</threshold>
- <left_val>-0.5136730074882507</left_val>
- <right_val>0.1300510019063950</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 14 12 -1.</_>
- <_>5 8 14 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0170079991221428</threshold>
- <left_val>0.4157589972019196</left_val>
- <right_val>-0.3124119937419891</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 3 12 -1.</_>
- <_>10 8 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0304969996213913</threshold>
- <left_val>-0.2482099980115891</left_val>
- <right_val>0.7082849740982056</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 14 15 -1.</_>
- <_>10 12 14 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.5430002287030220e-003</threshold>
- <left_val>-0.2263700067996979</left_val>
- <right_val>0.1918459981679916</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 14 15 -1.</_>
- <_>0 12 14 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1416399925947189</threshold>
- <left_val>0.0652270019054413</left_val>
- <right_val>-0.8880950212478638</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 9 6 -1.</_>
- <_>15 2 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0193380005657673</threshold>
- <left_val>0.1889120042324066</left_val>
- <right_val>-0.2739770114421845</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 9 6 -1.</_>
- <_>0 2 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0173240005970001</threshold>
- <left_val>-0.9486669898033142</left_val>
- <right_val>0.0241969991475344</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 6 14 -1.</_>
- <_>14 6 2 14 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.2069999985396862e-003</threshold>
- <left_val>0.3693839907646179</left_val>
- <right_val>-0.1749490052461624</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 7 6 9 -1.</_>
- <_>11 7 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0161090008914471</threshold>
- <left_val>0.9615949988365173</left_val>
- <right_val>-0.2000530064105988</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 6 15 -1.</_>
- <_>14 6 2 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1012250036001205</threshold>
- <left_val>-3.0699110031127930</left_val>
- <right_val>0.1136379987001419</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 6 15 -1.</_>
- <_>8 6 2 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.5509999878704548e-003</threshold>
- <left_val>0.2292100042104721</left_val>
- <right_val>-0.4564509987831116</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 3 8 9 -1.</_>
- <_>15 3 4 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0442479997873306</threshold>
- <left_val>-3.1599999056197703e-004</left_val>
- <right_val>0.3922530114650726</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 9 21 -1.</_>
- <_>3 0 3 21 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1163600012660027</threshold>
- <left_val>0.9523370265960693</left_val>
- <right_val>-0.2020159959793091</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 9 8 12 -1.</_>
- <_>11 13 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.7360002063214779e-003</threshold>
- <left_val>-0.0991770029067993</left_val>
- <right_val>0.2037049978971481</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 10 12 -1.</_>
- <_>6 7 5 6 2.</_>
- <_>11 13 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0224590003490448</threshold>
- <left_val>8.7280003353953362e-003</left_val>
- <right_val>-1.0217070579528809</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 18 -1.</_>
- <_>12 6 2 9 2.</_>
- <_>10 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0121090002357960</threshold>
- <left_val>0.6481260061264038</left_val>
- <right_val>-0.0901490002870560</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 9 -1.</_>
- <_>0 3 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0561200007796288</threshold>
- <left_val>-0.0367599986493587</left_val>
- <right_val>-1.9275590181350708</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 14 18 3 -1.</_>
- <_>3 15 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.7379999458789825e-003</threshold>
- <left_val>0.6926130056381226</left_val>
- <right_val>-0.0683749988675117</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 14 8 10 -1.</_>
- <_>3 14 4 5 2.</_>
- <_>7 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.6399998031556606e-003</threshold>
- <left_val>-0.4056980013847351</left_val>
- <right_val>0.1862570047378540</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 24 4 -1.</_>
- <_>12 12 12 2 2.</_>
- <_>0 14 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0181319992989302</threshold>
- <left_val>-0.6451820135116577</left_val>
- <right_val>0.2197639942169190</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 3 20 -1.</_>
- <_>1 2 1 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0227189995348454</threshold>
- <left_val>0.9777619838714600</left_val>
- <right_val>-0.1865430027246475</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 16 10 8 -1.</_>
- <_>17 16 5 4 2.</_>
- <_>12 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0127050001174212</threshold>
- <left_val>-0.1054660007357597</left_val>
- <right_val>0.3740409910678864</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 16 10 8 -1.</_>
- <_>2 16 5 4 2.</_>
- <_>7 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0136829996481538</threshold>
- <left_val>0.6106410026550293</left_val>
- <right_val>-0.2688109874725342</right_val></_></_></trees>
- <stage_threshold>-3.8700489997863770</stage_threshold>
- <parent>9</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 11 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 10 9 -1.</_>
- <_>7 3 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0313579998910427</threshold>
- <left_val>-1.0183910131454468</left_val>
- <right_val>0.5752859711647034</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 3 -1.</_>
- <_>8 0 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0930500030517578</threshold>
- <left_val>-0.4129750132560730</left_val>
- <right_val>1.0091199874877930</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 8 15 4 -1.</_>
- <_>3 10 15 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0259499996900558</threshold>
- <left_val>-0.5858790278434753</left_val>
- <right_val>0.5660619735717773</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 12 6 -1.</_>
- <_>10 5 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0164720006287098</threshold>
- <left_val>-0.9285749793052673</left_val>
- <right_val>0.3092449903488159</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 13 14 6 -1.</_>
- <_>5 16 14 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.8779999809339643e-003</threshold>
- <left_val>0.1195100024342537</left_val>
- <right_val>-1.1180130243301392</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 14 4 10 -1.</_>
- <_>11 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.0129999443888664e-003</threshold>
- <left_val>-0.5784950256347656</left_val>
- <right_val>0.3315440118312836</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 6 7 -1.</_>
- <_>3 6 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0225479993969202</threshold>
- <left_val>-0.3832510113716126</left_val>
- <right_val>0.5246220231056213</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 0 6 6 -1.</_>
- <_>18 0 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0377800017595291</threshold>
- <left_val>1.1790670156478882</left_val>
- <right_val>-0.0341669991612434</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 18 3 -1.</_>
- <_>3 2 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.3799999877810478e-003</threshold>
- <left_val>-0.8626589775085449</left_val>
- <right_val>0.1186790019273758</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 14 18 -1.</_>
- <_>9 12 14 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0238930005580187</threshold>
- <left_val>-0.7495059967041016</left_val>
- <right_val>0.2101140022277832</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 6 -1.</_>
- <_>3 0 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0265219993889332</threshold>
- <left_val>0.9212859869003296</left_val>
- <right_val>-0.2825280129909515</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 6 6 -1.</_>
- <_>13 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0122800003737211</threshold>
- <left_val>0.2666279971599579</left_val>
- <right_val>-0.7001360058784485</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 20 24 3 -1.</_>
- <_>8 20 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0965949967503548</threshold>
- <left_val>-0.2845399975776672</left_val>
- <right_val>0.7316899895668030</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 6 7 -1.</_>
- <_>13 11 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0274149999022484</threshold>
- <left_val>-0.6149269938468933</left_val>
- <right_val>0.1557620018720627</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 10 6 -1.</_>
- <_>4 14 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0157670006155968</threshold>
- <left_val>0.5755119919776917</left_val>
- <right_val>-0.3436219990253449</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 6 6 -1.</_>
- <_>13 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.1100000012665987e-003</threshold>
- <left_val>0.3259969949722290</left_val>
- <right_val>-0.1300829946994782</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 6 7 -1.</_>
- <_>8 11 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0120069999247789</threshold>
- <left_val>0.0893229991197586</left_val>
- <right_val>-0.9602559804916382</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 4 11 12 -1.</_>
- <_>7 8 11 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0154219996184111</threshold>
- <left_val>0.3444949984550476</left_val>
- <right_val>-0.4671199917793274</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 15 10 4 -1.</_>
- <_>6 17 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.1579999960958958e-003</threshold>
- <left_val>0.2369630038738251</left_val>
- <right_val>-0.5256329774856567</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 6 9 -1.</_>
- <_>16 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0211859997361898</threshold>
- <left_val>-0.7426769733428955</left_val>
- <right_val>0.2170200049877167</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 6 9 -1.</_>
- <_>6 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0170770008116961</threshold>
- <left_val>-0.9047179818153381</left_val>
- <right_val>0.0660120025277138</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 2 4 15 -1.</_>
- <_>11 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0408499985933304</threshold>
- <left_val>-0.3444660007953644</left_val>
- <right_val>0.2150370031595230</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 20 3 -1.</_>
- <_>0 1 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.1930002197623253e-003</threshold>
- <left_val>-0.9338859915733337</left_val>
- <right_val>0.0504710003733635</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 18 10 6 -1.</_>
- <_>13 20 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0192380007356405</threshold>
- <left_val>-0.5320370197296143</left_val>
- <right_val>0.1724060028791428</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 6 11 -1.</_>
- <_>5 7 3 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0441920012235641</threshold>
- <left_val>0.9207500219345093</left_val>
- <right_val>-0.2214850038290024</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 10 9 -1.</_>
- <_>10 17 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0623920001089573</threshold>
- <left_val>-0.7105380296707153</left_val>
- <right_val>0.1832389980554581</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 4 9 -1.</_>
- <_>10 2 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.0079999919980764e-003</threshold>
- <left_val>-0.8706309795379639</left_val>
- <right_val>0.0553300008177757</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 3 10 4 -1.</_>
- <_>14 3 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0238700006157160</threshold>
- <left_val>-0.2285420000553131</left_val>
- <right_val>0.5241559743881226</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 6 -1.</_>
- <_>6 6 6 3 2.</_>
- <_>12 9 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0213910005986691</threshold>
- <left_val>-0.3032589852809906</left_val>
- <right_val>0.5586060285568237</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 8 10 -1.</_>
- <_>12 8 4 5 2.</_>
- <_>8 13 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0202549993991852</threshold>
- <left_val>0.2690150141716003</left_val>
- <right_val>-0.7026180028915405</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 4 4 16 -1.</_>
- <_>7 12 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0287720002233982</threshold>
- <left_val>-1.1835030317306519</left_val>
- <right_val>0.0465120002627373</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 9 4 -1.</_>
- <_>8 10 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.4199999645352364e-003</threshold>
- <left_val>-0.5465210080146790</left_val>
- <right_val>0.2596249878406525</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 14 9 -1.</_>
- <_>5 5 14 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0569830015301704</threshold>
- <left_val>-0.2698290050029755</left_val>
- <right_val>0.5817070007324219</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 16 19 8 -1.</_>
- <_>3 20 19 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0938920006155968</threshold>
- <left_val>-0.9104639887809753</left_val>
- <right_val>0.1967770010232925</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 10 8 -1.</_>
- <_>5 0 5 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0176999997347593</threshold>
- <left_val>-0.4400329887866974</left_val>
- <right_val>0.2134950011968613</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 16 18 -1.</_>
- <_>5 2 8 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2284419983625412</threshold>
- <left_val>0.0236050002276897</left_val>
- <right_val>0.7717159986495972</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 24 11 -1.</_>
- <_>8 11 8 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1828750073909760</threshold>
- <left_val>0.7922859787940979</left_val>
- <right_val>-0.2464479953050613</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 3 18 5 -1.</_>
- <_>3 3 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0698919966816902</threshold>
- <left_val>0.8026779890060425</left_val>
- <right_val>-0.0360720008611679</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 16 18 3 -1.</_>
- <_>1 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0152970002964139</threshold>
- <left_val>-0.2007230073213577</left_val>
- <right_val>1.1030600070953369</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 17 18 3 -1.</_>
- <_>5 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.7500001750886440e-003</threshold>
- <left_val>-0.0459679998457432</left_val>
- <right_val>0.7209450006484985</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 9 6 -1.</_>
- <_>1 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0159830003976822</threshold>
- <left_val>-0.9035720229148865</left_val>
- <right_val>0.0449879989027977</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 9 23 10 -1.</_>
- <_>1 14 23 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0130880000069737</threshold>
- <left_val>0.3529709875583649</left_val>
- <right_val>-0.3771060109138489</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 18 3 -1.</_>
- <_>3 8 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0130610000342131</threshold>
- <left_val>-0.1958359926939011</left_val>
- <right_val>1.1198940277099609</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 12 3 -1.</_>
- <_>6 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0399070009589195</threshold>
- <left_val>-1.3998429775238037</left_val>
- <right_val>0.1914509981870651</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 2 3 22 -1.</_>
- <_>7 2 1 22 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0150269996374846</threshold>
- <left_val>2.3600000422447920e-003</left_val>
- <right_val>-1.1611249446868896</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 17 10 6 -1.</_>
- <_>14 19 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0205179993063211</threshold>
- <left_val>-0.4890809953212738</left_val>
- <right_val>0.1674340069293976</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 18 10 6 -1.</_>
- <_>1 20 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0223590005189180</threshold>
- <left_val>-1.2202980518341064</left_val>
- <right_val>-0.0119759999215603</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 3 6 12 -1.</_>
- <_>13 3 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.9150004312396049e-003</threshold>
- <left_val>0.3722809851169586</left_val>
- <right_val>-0.0850630030035973</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 9 -1.</_>
- <_>12 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0152580002322793</threshold>
- <left_val>-0.2941260039806366</left_val>
- <right_val>0.5940639972686768</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 6 9 -1.</_>
- <_>13 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0316659994423389</threshold>
- <left_val>-1.4395569562911987</left_val>
- <right_val>0.1357879936695099</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0307739991694689</threshold>
- <left_val>-2.2545371055603027</left_val>
- <right_val>-0.0339710004627705</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 10 9 6 -1.</_>
- <_>15 10 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0154830003157258</threshold>
- <left_val>0.3770070075988770</left_val>
- <right_val>0.0158479996025562</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 6 9 -1.</_>
- <_>5 11 3 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0351670011878014</threshold>
- <left_val>-0.2944610118865967</left_val>
- <right_val>0.5315909981727600</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 5 3 19 -1.</_>
- <_>15 5 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0179060008376837</threshold>
- <left_val>-0.9978820085525513</left_val>
- <right_val>0.1623599976301193</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 9 6 -1.</_>
- <_>6 8 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.1799999997019768e-003</threshold>
- <left_val>0.0476570017635822</left_val>
- <right_val>-0.7524989843368530</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 5 3 19 -1.</_>
- <_>15 5 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0157200004905462</threshold>
- <left_val>0.1487379968166351</left_val>
- <right_val>-0.6537539958953857</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 9 -1.</_>
- <_>0 6 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0298640001565218</threshold>
- <left_val>-0.0149520002305508</left_val>
- <right_val>-1.2275190353393555</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 21 18 3 -1.</_>
- <_>5 22 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.9899999499320984e-003</threshold>
- <left_val>-0.1426369994878769</left_val>
- <right_val>0.4327279925346375</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 18 4 -1.</_>
- <_>7 10 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0847499966621399</threshold>
- <left_val>-0.0192809998989105</left_val>
- <right_val>-1.1946409940719604</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 4 8 10 -1.</_>
- <_>17 4 4 5 2.</_>
- <_>13 9 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0587249994277954</threshold>
- <left_val>-1.7328219413757324</left_val>
- <right_val>0.1437470018863678</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 9 6 -1.</_>
- <_>10 8 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0447559989988804</threshold>
- <left_val>-0.2414059937000275</left_val>
- <right_val>0.5401999950408936</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 9 9 8 -1.</_>
- <_>15 9 3 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0403690002858639</threshold>
- <left_val>5.7680001482367516e-003</left_val>
- <right_val>0.5657809972763062</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 5 12 -1.</_>
- <_>0 10 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0377359986305237</threshold>
- <left_val>0.0381809994578362</left_val>
- <right_val>-0.7937039732933044</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 14 6 -1.</_>
- <_>14 6 7 3 2.</_>
- <_>7 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0607529990375042</threshold>
- <left_val>0.0764530003070831</left_val>
- <right_val>1.4813209772109985</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 3 19 -1.</_>
- <_>8 5 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0198320001363754</threshold>
- <left_val>-1.6971720457077026</left_val>
- <right_val>-0.0273700002580881</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 4 15 20 -1.</_>
- <_>13 4 5 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1659269928932190</threshold>
- <left_val>0.6297600269317627</left_val>
- <right_val>0.0317629985511303</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 4 15 20 -1.</_>
- <_>6 4 5 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0690149962902069</threshold>
- <left_val>-0.3346320092678070</left_val>
- <right_val>0.3007670044898987</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 10 6 6 -1.</_>
- <_>13 10 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0113580003380775</threshold>
- <left_val>0.2274149954319000</left_val>
- <right_val>-0.3822470009326935</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 6 6 -1.</_>
- <_>8 10 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.7000000225380063e-003</threshold>
- <left_val>0.1922380030155182</left_val>
- <right_val>-0.5273510217666626</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 2 6 14 -1.</_>
- <_>17 2 3 7 2.</_>
- <_>14 9 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0797690004110336</threshold>
- <left_val>0.0914919972419739</left_val>
- <right_val>2.1049048900604248</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 2 6 14 -1.</_>
- <_>4 2 3 7 2.</_>
- <_>7 9 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0571440011262894</threshold>
- <left_val>-1.7452130317687988</left_val>
- <right_val>-0.0409100018441677</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 4 6 7 -1.</_>
- <_>12 4 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.3830001056194305e-003</threshold>
- <left_val>-0.2421479970216751</left_val>
- <right_val>0.3557780086994171</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 4 6 9 -1.</_>
- <_>11 4 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0180409997701645</threshold>
- <left_val>1.1779999732971191</left_val>
- <right_val>-0.1767670065164566</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 4 8 10 -1.</_>
- <_>11 4 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0945030003786087</threshold>
- <left_val>0.1393609941005707</left_val>
- <right_val>-1.2993700504302979</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 8 10 -1.</_>
- <_>9 4 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.4210000671446323e-003</threshold>
- <left_val>-0.5460860133171082</left_val>
- <right_val>0.1391640007495880</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 10 6 -1.</_>
- <_>8 20 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.0290002040565014e-003</threshold>
- <left_val>-0.2159720063209534</left_val>
- <right_val>0.3925809860229492</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 18 21 6 -1.</_>
- <_>1 20 21 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0345159992575645</threshold>
- <left_val>0.0631889998912811</left_val>
- <right_val>-0.7210810184478760</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 2 12 6 -1.</_>
- <_>9 2 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0519249998033047</threshold>
- <left_val>0.6866760253906250</left_val>
- <right_val>0.0632729977369308</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 12 6 -1.</_>
- <_>9 2 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0691620036959648</threshold>
- <left_val>1.7411810159683228</left_val>
- <right_val>-0.1661929935216904</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 5 12 6 -1.</_>
- <_>18 5 6 3 2.</_>
- <_>12 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.5229999125003815e-003</threshold>
- <left_val>0.3069469928741455</left_val>
- <right_val>-0.1666290014982224</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 6 9 -1.</_>
- <_>8 11 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0685999989509583</threshold>
- <left_val>-0.2140540033578873</left_val>
- <right_val>0.7318500280380249</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 20 6 -1.</_>
- <_>2 9 20 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0670389980077744</threshold>
- <left_val>-0.7936059832572937</left_val>
- <right_val>0.2052579969167709</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 12 6 -1.</_>
- <_>0 5 6 3 2.</_>
- <_>6 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0210050009191036</threshold>
- <left_val>0.3734439909458160</left_val>
- <right_val>-0.2961860001087189</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 14 8 10 -1.</_>
- <_>18 14 4 5 2.</_>
- <_>14 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0202789995819330</threshold>
- <left_val>-0.0152000002563000</left_val>
- <right_val>0.4055530130863190</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 14 8 10 -1.</_>
- <_>2 14 4 5 2.</_>
- <_>6 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0471079982817173</threshold>
- <left_val>1.2116849422454834</left_val>
- <right_val>-0.1746429949998856</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 20 13 -1.</_>
- <_>2 11 10 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1876849979162216</threshold>
- <left_val>-0.0229090005159378</left_val>
- <right_val>0.6964579820632935</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 12 5 -1.</_>
- <_>12 9 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0432289987802505</threshold>
- <left_val>-1.0602480173110962</left_val>
- <right_val>-5.5599998449906707e-004</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 16 6 -1.</_>
- <_>13 6 8 3 2.</_>
- <_>5 9 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0200040005147457</threshold>
- <left_val>-0.0327510014176369</left_val>
- <right_val>0.5380510091781616</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 19 9 4 -1.</_>
- <_>1 21 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.0880001187324524e-003</threshold>
- <left_val>0.0375480018556118</left_val>
- <right_val>-0.7476890087127686</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 12 5 -1.</_>
- <_>11 5 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0271010007709265</threshold>
- <left_val>-0.0817900002002716</left_val>
- <right_val>0.3338710069656372</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 14 12 -1.</_>
- <_>3 5 7 6 2.</_>
- <_>10 11 7 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0917460024356842</threshold>
- <left_val>-1.9213509559631348</left_val>
- <right_val>-0.0389529988169670</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 4 9 6 -1.</_>
- <_>12 4 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0124549996107817</threshold>
- <left_val>0.4836060106754303</left_val>
- <right_val>0.0181680005043745</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 6 19 3 -1.</_>
- <_>2 7 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0146490000188351</threshold>
- <left_val>-0.1990669965744019</left_val>
- <right_val>0.7281540036201477</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 10 6 9 -1.</_>
- <_>18 13 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0291019994765520</threshold>
- <left_val>0.1987109929323196</left_val>
- <right_val>-0.4921680092811585</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 18 2 -1.</_>
- <_>3 8 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.7799998000264168e-003</threshold>
- <left_val>-0.1949959993362427</left_val>
- <right_val>0.7731739878654480</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 2 4 18 -1.</_>
- <_>22 2 2 9 2.</_>
- <_>20 11 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0547400005161762</threshold>
- <left_val>1.8087190389633179</left_val>
- <right_val>0.0683230012655258</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 18 20 3 -1.</_>
- <_>2 19 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0147980004549026</threshold>
- <left_val>0.7806490063667297</left_val>
- <right_val>-0.1870959997177124</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 9 22 3 -1.</_>
- <_>1 10 22 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0250129997730255</threshold>
- <left_val>0.1528529971837997</left_val>
- <right_val>-1.6021020412445068</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 4 18 -1.</_>
- <_>0 2 2 9 2.</_>
- <_>2 11 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0465480014681816</threshold>
- <left_val>-0.1673820018768311</left_val>
- <right_val>1.1902060508728027</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 0 4 23 -1.</_>
- <_>19 0 2 23 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0176240000873804</threshold>
- <left_val>-0.1028549969196320</left_val>
- <right_val>0.3917590081691742</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 19 -1.</_>
- <_>3 3 3 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1631959974765778</threshold>
- <left_val>-0.0356240011751652</left_val>
- <right_val>-1.6098170280456543</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 9 -1.</_>
- <_>20 2 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0131379999220371</threshold>
- <left_val>-0.0563590005040169</left_val>
- <right_val>0.5415890216827393</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 10 6 -1.</_>
- <_>0 7 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0156650003045797</threshold>
- <left_val>0.2806310057640076</left_val>
- <right_val>-0.3170860111713409</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 12 12 -1.</_>
- <_>13 0 6 6 2.</_>
- <_>7 6 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0805540010333061</threshold>
- <left_val>0.1264040023088455</left_val>
- <right_val>-1.0297529697418213</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 24 6 -1.</_>
- <_>0 3 12 3 2.</_>
- <_>12 6 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0353639982640743</threshold>
- <left_val>0.0207529999315739</left_val>
- <right_val>-0.7910559773445129</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 4 10 -1.</_>
- <_>10 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0329869985580444</threshold>
- <left_val>0.1905709952116013</left_val>
- <right_val>-0.8383989930152893</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 9 4 15 -1.</_>
- <_>8 14 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0121950004249811</threshold>
- <left_val>0.0737290009856224</left_val>
- <right_val>-0.6278070211410523</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 11 17 6 -1.</_>
- <_>4 14 17 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0430659987032413</threshold>
- <left_val>0.0473849996924400</left_val>
- <right_val>1.5712939500808716</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 18 8 -1.</_>
- <_>2 5 9 4 2.</_>
- <_>11 9 9 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0303269997239113</threshold>
- <left_val>-0.2731460034847260</left_val>
- <right_val>0.3857200145721436</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 14 6 -1.</_>
- <_>14 6 7 3 2.</_>
- <_>7 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0354930013418198</threshold>
- <left_val>0.0545939989387989</left_val>
- <right_val>0.5258340239524841</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 14 6 -1.</_>
- <_>3 6 7 3 2.</_>
- <_>10 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0145969996228814</threshold>
- <left_val>0.3815259933471680</left_val>
- <right_val>-0.2833240032196045</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 5 3 18 -1.</_>
- <_>17 5 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0126069998368621</threshold>
- <left_val>0.1545509994029999</left_val>
- <right_val>-0.3050149977207184</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 3 18 -1.</_>
- <_>6 5 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0101720001548529</threshold>
- <left_val>0.0236370004713535</left_val>
- <right_val>-0.8721789717674255</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 10 14 4 -1.</_>
- <_>10 12 14 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0288430005311966</threshold>
- <left_val>0.1609099954366684</left_val>
- <right_val>-0.2027759999036789</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 10 9 4 -1.</_>
- <_>4 12 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.5100000463426113e-004</threshold>
- <left_val>-0.6154540181159973</left_val>
- <right_val>0.0809359997510910</right_val></_></_></trees>
- <stage_threshold>-3.7160909175872803</stage_threshold>
- <parent>10</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 12 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 18 9 -1.</_>
- <_>2 3 18 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0483440011739731</threshold>
- <left_val>-0.8490459918975830</left_val>
- <right_val>0.5697439908981323</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 12 8 -1.</_>
- <_>10 3 4 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0324600003659725</threshold>
- <left_val>-0.8141729831695557</left_val>
- <right_val>0.4478169977664948</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 8 5 -1.</_>
- <_>5 1 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0333399996161461</threshold>
- <left_val>-0.3642379939556122</left_val>
- <right_val>0.6793739795684815</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 7 7 8 -1.</_>
- <_>12 11 7 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.4019998535513878e-003</threshold>
- <left_val>-1.1885459423065186</left_val>
- <right_val>0.1923869997262955</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 22 4 -1.</_>
- <_>0 14 22 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.6889997795224190e-003</threshold>
- <left_val>0.3308529853820801</left_val>
- <right_val>-0.7133409976959229</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 6 4 15 -1.</_>
- <_>15 11 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0126980002969503</threshold>
- <left_val>-0.5099080204963684</left_val>
- <right_val>0.1137629970908165</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 7 8 -1.</_>
- <_>5 11 7 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.0549997724592686e-003</threshold>
- <left_val>-1.0470550060272217</left_val>
- <right_val>0.2022259980440140</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 9 4 -1.</_>
- <_>8 20 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.6420000940561295e-003</threshold>
- <left_val>-0.5055940151214600</left_val>
- <right_val>0.3644120097160339</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 22 4 -1.</_>
- <_>1 4 22 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0169259998947382</threshold>
- <left_val>-0.9954190254211426</left_val>
- <right_val>0.1260219961404800</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 3 6 17 -1.</_>
- <_>19 3 2 17 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0282359998673201</threshold>
- <left_val>-0.0941379964351654</left_val>
- <right_val>0.5778040289878845</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 8 18 -1.</_>
- <_>8 11 8 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0104289995506406</threshold>
- <left_val>0.2327290028333664</left_val>
- <right_val>-0.5256969928741455</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 0 6 12 -1.</_>
- <_>20 0 3 6 2.</_>
- <_>17 6 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.8860003054141998e-003</threshold>
- <left_val>-0.1031629964709282</left_val>
- <right_val>0.4765760004520416</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0260150004178286</threshold>
- <left_val>-1.0920000495389104e-003</left_val>
- <right_val>-1.5581729412078857</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 5 9 12 -1.</_>
- <_>15 11 9 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0255379993468523</threshold>
- <left_val>-0.6545140147209168</left_val>
- <right_val>0.1884319931268692</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 22 18 2 -1.</_>
- <_>2 23 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.5310001112520695e-003</threshold>
- <left_val>0.2814059853553772</left_val>
- <right_val>-0.4457530081272125</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 10 12 6 -1.</_>
- <_>16 10 6 3 2.</_>
- <_>10 13 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.2449998483061790e-003</threshold>
- <left_val>0.1561200022697449</left_val>
- <right_val>-0.2137099951505661</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 4 11 -1.</_>
- <_>2 1 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0210309997200966</threshold>
- <left_val>-0.2917029857635498</left_val>
- <right_val>0.5223410129547119</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 0 4 10 -1.</_>
- <_>20 0 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0510630011558533</threshold>
- <left_val>1.3661290407180786</left_val>
- <right_val>0.0304659996181726</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 3 6 17 -1.</_>
- <_>3 3 2 17 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0623300001025200</threshold>
- <left_val>1.2207020521163940</left_val>
- <right_val>-0.2243440002202988</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 15 9 6 -1.</_>
- <_>15 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0329630002379417</threshold>
- <left_val>-0.8201680183410645</left_val>
- <right_val>0.1453189998865128</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 8 9 -1.</_>
- <_>0 16 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0374180004000664</threshold>
- <left_val>-1.2218099832534790</left_val>
- <right_val>0.0194489993155003</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 8 6 12 -1.</_>
- <_>16 12 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1240279972553253</threshold>
- <left_val>0.1208230033516884</left_val>
- <right_val>-0.9872930049896240</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 8 6 12 -1.</_>
- <_>2 12 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.9229997247457504e-003</threshold>
- <left_val>-1.1688489913940430</left_val>
- <right_val>0.0211050007492304</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 15 -1.</_>
- <_>10 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0598799996078014</threshold>
- <left_val>-1.0689330101013184</left_val>
- <right_val>0.1986020058393478</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 19 3 -1.</_>
- <_>1 6 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.2620001845061779e-003</threshold>
- <left_val>-0.3622959852218628</left_val>
- <right_val>0.3800080120563507</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 8 9 7 -1.</_>
- <_>14 8 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0176730006933212</threshold>
- <left_val>0.4909409880638123</left_val>
- <right_val>-0.1460669934749603</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 8 12 9 -1.</_>
- <_>3 11 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0175790004432201</threshold>
- <left_val>0.5872809886932373</left_val>
- <right_val>-0.2777439951896668</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 3 -1.</_>
- <_>3 7 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.1560001447796822e-003</threshold>
- <left_val>-0.0751949995756149</left_val>
- <right_val>0.6019309759140015</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 4 12 -1.</_>
- <_>10 6 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0105999996885657</threshold>
- <left_val>0.2763740122318268</left_val>
- <right_val>-0.3779430091381073</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 18 14 -1.</_>
- <_>3 9 9 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2088409960269928</threshold>
- <left_val>-5.3599998354911804e-003</left_val>
- <right_val>1.0317809581756592</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 4 9 -1.</_>
- <_>2 0 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0264129992574453</threshold>
- <left_val>0.8233640193939209</left_val>
- <right_val>-0.2248059958219528</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 5 4 18 -1.</_>
- <_>12 5 2 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0588920004665852</threshold>
- <left_val>0.1309829950332642</left_val>
- <right_val>-1.1853699684143066</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 5 4 18 -1.</_>
- <_>10 5 2 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0115790003910661</threshold>
- <left_val>-0.9066780209541321</left_val>
- <right_val>0.0441269986331463</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 6 10 -1.</_>
- <_>12 5 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0459880009293556</threshold>
- <left_val>0.0101439999416471</left_val>
- <right_val>1.0740900039672852</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 4 4 11 -1.</_>
- <_>11 4 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0228380002081394</threshold>
- <left_val>1.7791990041732788</left_val>
- <right_val>-0.1731549948453903</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 16 18 3 -1.</_>
- <_>4 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.1709995865821838e-003</threshold>
- <left_val>0.5738630294799805</left_val>
- <right_val>-0.0741060003638268</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 20 3 -1.</_>
- <_>0 17 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.5359999164938927e-003</threshold>
- <left_val>-0.3207289874553680</left_val>
- <right_val>0.4018250107765198</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 9 6 12 -1.</_>
- <_>9 13 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0494449995458126</threshold>
- <left_val>0.1928800046443939</left_val>
- <right_val>-1.2166700363159180</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 13 8 8 -1.</_>
- <_>8 17 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.5139999818056822e-003</threshold>
- <left_val>0.0695680007338524</left_val>
- <right_val>-0.7132369875907898</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 10 3 12 -1.</_>
- <_>13 16 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0309960003942251</threshold>
- <left_val>-0.3886219859123230</left_val>
- <right_val>0.1809879988431931</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 9 14 14 -1.</_>
- <_>5 9 7 7 2.</_>
- <_>12 16 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0864529982209206</threshold>
- <left_val>-0.0257929991930723</left_val>
- <right_val>-1.5453219413757324</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 10 -1.</_>
- <_>12 0 12 5 2.</_>
- <_>0 5 12 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1365260034799576</threshold>
- <left_val>-1.9199420213699341</left_val>
- <right_val>0.1661330014467239</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 11 18 2 -1.</_>
- <_>1 12 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.7689999230206013e-003</threshold>
- <left_val>-1.2822589874267578</left_val>
- <right_val>-0.0159079991281033</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 5 5 12 -1.</_>
- <_>19 9 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0178999993950129</threshold>
- <left_val>-0.4040989875793457</left_val>
- <right_val>0.2359160035848618</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 5 12 -1.</_>
- <_>0 9 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0199699997901917</threshold>
- <left_val>-0.7289190292358398</left_val>
- <right_val>0.0562350004911423</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 6 8 18 -1.</_>
- <_>20 6 4 9 2.</_>
- <_>16 15 4 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0574930012226105</threshold>
- <left_val>0.5783079862594605</left_val>
- <right_val>-0.0157960001379251</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 8 18 -1.</_>
- <_>0 6 4 9 2.</_>
- <_>4 15 4 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0830560028553009</threshold>
- <left_val>0.9151160120964050</left_val>
- <right_val>-0.2112140059471130</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 5 12 12 -1.</_>
- <_>18 5 6 6 2.</_>
- <_>12 11 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0537710003554821</threshold>
- <left_val>-0.5193129777908325</left_val>
- <right_val>0.1857600063085556</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 6 9 -1.</_>
- <_>9 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.3670001477003098e-003</threshold>
- <left_val>0.2410970032215118</left_val>
- <right_val>-0.3964860141277313</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 13 6 11 -1.</_>
- <_>11 13 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0554069988429546</threshold>
- <left_val>0.1677120029926300</left_val>
- <right_val>-2.5664970874786377</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 12 12 -1.</_>
- <_>0 5 6 6 2.</_>
- <_>6 11 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0671809986233711</threshold>
- <left_val>-1.3658570051193237</left_val>
- <right_val>-0.0142320003360510</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 23 3 -1.</_>
- <_>1 3 23 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0239000003784895</threshold>
- <left_val>-1.7084569931030273</left_val>
- <right_val>0.1650779992341995</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 15 19 3 -1.</_>
- <_>1 16 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.5949999950826168e-003</threshold>
- <left_val>-0.3137399852275848</left_val>
- <right_val>0.3283790051937103</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 17 11 4 -1.</_>
- <_>13 19 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0212949998676777</threshold>
- <left_val>0.1495340019464493</left_val>
- <right_val>-0.4857980012893677</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 8 5 -1.</_>
- <_>4 13 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0246130004525185</threshold>
- <left_val>0.7434639930725098</left_val>
- <right_val>-0.2230519950389862</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 10 10 4 -1.</_>
- <_>12 10 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0196260008960962</threshold>
- <left_val>-0.4091829955577850</left_val>
- <right_val>0.1889320015907288</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 9 9 -1.</_>
- <_>4 9 9 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0532660000026226</threshold>
- <left_val>0.8138160109519959</left_val>
- <right_val>-0.2085369974374771</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 14 9 6 -1.</_>
- <_>15 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.1290000341832638e-003</threshold>
- <left_val>0.3299610018730164</left_val>
- <right_val>-0.5993739962577820</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 12 9 6 -1.</_>
- <_>1 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0224869996309280</threshold>
- <left_val>-1.2551610469818115</left_val>
- <right_val>-0.0204130001366138</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 20 8 -1.</_>
- <_>13 10 10 4 2.</_>
- <_>3 14 10 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0823109969496727</threshold>
- <left_val>1.3821430206298828</left_val>
- <right_val>0.0593089982867241</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 9 18 -1.</_>
- <_>5 0 3 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1309700012207031</threshold>
- <left_val>-0.0358439981937408</left_val>
- <right_val>-1.5396369695663452</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 9 10 -1.</_>
- <_>16 11 3 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0142930001020432</threshold>
- <left_val>-0.1847520023584366</left_val>
- <right_val>0.3745500147342682</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 8 5 -1.</_>
- <_>5 2 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.3479999080300331e-003</threshold>
- <left_val>-0.4490109980106354</left_val>
- <right_val>0.1387699991464615</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 21 6 -1.</_>
- <_>10 4 7 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0460550002753735</threshold>
- <left_val>0.6783260107040405</left_val>
- <right_val>-0.0170719996094704</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 10 14 -1.</_>
- <_>7 0 5 7 2.</_>
- <_>12 7 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0576939992606640</threshold>
- <left_val>-0.0119559997692704</left_val>
- <right_val>-1.2261159420013428</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 17 12 4 -1.</_>
- <_>12 19 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.0609998181462288e-003</threshold>
- <left_val>0.3395859897136688</left_val>
- <right_val>6.2800000887364149e-004</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 23 4 -1.</_>
- <_>0 8 23 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0521630011498928</threshold>
- <left_val>-1.0621069669723511</left_val>
- <right_val>-0.0137799996882677</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 10 8 10 -1.</_>
- <_>17 10 4 5 2.</_>
- <_>13 15 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0465729981660843</threshold>
- <left_val>0.1453880071640015</left_val>
- <right_val>-1.2384550571441650</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 18 3 -1.</_>
- <_>0 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.5309998355805874e-003</threshold>
- <left_val>-0.2446770071983337</left_val>
- <right_val>0.5137709975242615</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 16 9 4 -1.</_>
- <_>15 18 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0216150004416704</threshold>
- <left_val>0.1307259947061539</left_val>
- <right_val>-0.7099679708480835</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 9 4 -1.</_>
- <_>0 18 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0178640000522137</threshold>
- <left_val>-1.0474660396575928</left_val>
- <right_val>4.9599999329075217e-004</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 6 6 -1.</_>
- <_>13 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0371950007975101</threshold>
- <left_val>-1.5126730203628540</left_val>
- <right_val>0.1480139940977097</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 6 6 -1.</_>
- <_>8 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.1100001069717109e-004</threshold>
- <left_val>0.1397150009870529</left_val>
- <right_val>-0.4686749875545502</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 24 6 -1.</_>
- <_>12 3 12 3 2.</_>
- <_>0 6 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0250429995357990</threshold>
- <left_val>0.2863200008869171</left_val>
- <right_val>-0.4179469943046570</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 4 18 3 -1.</_>
- <_>2 5 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.3449996784329414e-003</threshold>
- <left_val>-0.2733620107173920</left_val>
- <right_val>0.4344469904899597</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 4 -1.</_>
- <_>12 0 12 2 2.</_>
- <_>0 2 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0323639996349812</threshold>
- <left_val>0.1843889951705933</left_val>
- <right_val>-0.9501929879188538</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 16 18 3 -1.</_>
- <_>1 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.2299999408423901e-003</threshold>
- <left_val>0.3258199989795685</left_val>
- <right_val>-0.3081560134887695</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 15 9 6 -1.</_>
- <_>15 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0514889992773533</threshold>
- <left_val>0.1141600012779236</left_val>
- <right_val>-1.9795479774475098</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 9 6 -1.</_>
- <_>0 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0264490004628897</threshold>
- <left_val>-1.1067299842834473</left_val>
- <right_val>-8.5519999265670776e-003</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 17 18 3 -1.</_>
- <_>6 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0154200000688434</threshold>
- <left_val>0.8013870120048523</left_val>
- <right_val>-0.0320350006222725</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 6 10 -1.</_>
- <_>10 8 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0194569993764162</threshold>
- <left_val>-0.2644949853420258</left_val>
- <right_val>0.3875389993190765</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 6 9 -1.</_>
- <_>12 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0336209982633591</threshold>
- <left_val>0.0160520002245903</left_val>
- <right_val>0.5884090065956116</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 5 8 -1.</_>
- <_>8 12 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0289060007780790</threshold>
- <left_val>0.0152160003781319</left_val>
- <right_val>-0.9472360014915466</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 8 6 8 -1.</_>
- <_>12 12 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.0300000323913991e-004</threshold>
- <left_val>-0.3076600134372711</left_val>
- <right_val>0.2123589962720871</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 6 11 -1.</_>
- <_>8 5 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0491419993340969</threshold>
- <left_val>-1.6058609485626221</left_val>
- <right_val>-0.0310949999839067</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 6 8 9 -1.</_>
- <_>13 9 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0764259994029999</threshold>
- <left_val>0.0747589990496635</left_val>
- <right_val>1.1639410257339478</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 7 21 6 -1.</_>
- <_>1 9 21 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0238979998975992</threshold>
- <left_val>-6.4320000819861889e-003</left_val>
- <right_val>-1.1150749921798706</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 5 3 12 -1.</_>
- <_>15 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.8970001041889191e-003</threshold>
- <left_val>-0.2410569936037064</left_val>
- <right_val>0.2085890024900436</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 11 12 -1.</_>
- <_>6 13 11 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0894450023770332</threshold>
- <left_val>1.9157789945602417</left_val>
- <right_val>-0.1572110056877136</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 8 10 8 -1.</_>
- <_>18 8 5 4 2.</_>
- <_>13 12 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0150089999660850</threshold>
- <left_val>-0.2517409920692444</left_val>
- <right_val>0.1817989945411682</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 12 3 -1.</_>
- <_>11 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0111459996551275</threshold>
- <left_val>-0.6934949755668640</left_val>
- <right_val>0.0449279993772507</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 18 4 -1.</_>
- <_>12 11 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0945789963006973</threshold>
- <left_val>0.1810210049152374</left_val>
- <right_val>-0.7497860193252564</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 22 22 -1.</_>
- <_>0 11 22 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.5503889918327332</threshold>
- <left_val>-0.0309740006923676</left_val>
- <right_val>-1.6746139526367188</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 2 6 8 -1.</_>
- <_>11 6 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0413810014724731</threshold>
- <left_val>0.0639100000262260</left_val>
- <right_val>0.7656120061874390</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 9 -1.</_>
- <_>11 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0247719995677471</threshold>
- <left_val>0.0113800000399351</left_val>
- <right_val>-0.8855940103530884</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 6 9 -1.</_>
- <_>12 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0509990006685257</threshold>
- <left_val>0.1489029973745346</left_val>
- <right_val>-2.4634211063385010</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 3 6 14 -1.</_>
- <_>8 3 3 7 2.</_>
- <_>11 10 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0168939996510744</threshold>
- <left_val>0.3887099921703339</left_val>
- <right_val>-0.2988030016422272</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 18 8 -1.</_>
- <_>9 10 6 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1216230019927025</threshold>
- <left_val>-1.5542800426483154</left_val>
- <right_val>0.1630080044269562</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 3 14 -1.</_>
- <_>10 7 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.6049999762326479e-003</threshold>
- <left_val>0.2184280008077622</left_val>
- <right_val>-0.3731209933757782</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 16 20 -1.</_>
- <_>4 13 16 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1157540008425713</threshold>
- <left_val>-0.0470610000193119</left_val>
- <right_val>0.5940369963645935</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 4 6 10 -1.</_>
- <_>11 4 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0369039997458458</threshold>
- <left_val>-0.2550860047340393</left_val>
- <right_val>0.5539730191230774</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 16 4 -1.</_>
- <_>5 2 16 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0114839999005198</threshold>
- <left_val>-0.1812949925661087</left_val>
- <right_val>0.4068279862403870</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 18 4 -1.</_>
- <_>8 5 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0202339999377728</threshold>
- <left_val>0.5431119799613953</left_val>
- <right_val>-0.2382239997386932</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 6 9 -1.</_>
- <_>15 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0287650004029274</threshold>
- <left_val>-0.6917229890823364</left_val>
- <right_val>0.1594330072402954</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 4 8 5 -1.</_>
- <_>12 4 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.8320001699030399e-003</threshold>
- <left_val>0.2944779992103577</left_val>
- <right_val>-0.3400599956512451</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 10 10 4 -1.</_>
- <_>12 10 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0554689988493919</threshold>
- <left_val>0.9220079779624939</left_val>
- <right_val>0.0940930023789406</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 10 10 4 -1.</_>
- <_>7 10 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0148010002449155</threshold>
- <left_val>-0.7953969836235046</left_val>
- <right_val>0.0315219983458519</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 11 12 5 -1.</_>
- <_>11 11 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.0940000005066395e-003</threshold>
- <left_val>0.3309600055217743</left_val>
- <right_val>-0.0508869998157024</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 8 10 -1.</_>
- <_>3 10 4 5 2.</_>
- <_>7 15 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0451240018010139</threshold>
- <left_val>-1.3719749450683594</left_val>
- <right_val>-0.0214089993387461</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 12 9 8 -1.</_>
- <_>14 12 3 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0643770024180412</threshold>
- <left_val>0.0639019981026649</left_val>
- <right_val>0.9147830009460449</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 21 24 3 -1.</_>
- <_>8 21 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0147270001471043</threshold>
- <left_val>0.3605059981346130</left_val>
- <right_val>-0.2861450016498566</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 20 18 4 -1.</_>
- <_>9 20 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0450070016086102</threshold>
- <left_val>-0.1561969965696335</left_val>
- <right_val>0.5316029787063599</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 15 9 6 -1.</_>
- <_>1 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.1330000124871731e-003</threshold>
- <left_val>0.1342290043830872</left_val>
- <right_val>-0.4435890018939972</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 17 10 4 -1.</_>
- <_>11 19 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0494510009884834</threshold>
- <left_val>0.1057180017232895</left_val>
- <right_val>-2.5589139461517334</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 4 12 -1.</_>
- <_>9 18 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0291029997169971</threshold>
- <left_val>-0.0100880004465580</left_val>
- <right_val>-1.1073939800262451</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 9 6 -1.</_>
- <_>12 6 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0347860008478165</threshold>
- <left_val>-2.7719999197870493e-003</left_val>
- <right_val>0.5670099854469299</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 6 9 -1.</_>
- <_>1 16 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.1309998854994774e-003</threshold>
- <left_val>-0.4688940048217773</left_val>
- <right_val>0.1263639926910400</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 12 4 -1.</_>
- <_>6 18 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0155250001698732</threshold>
- <left_val>-8.4279999136924744e-003</left_val>
- <right_val>0.8746920228004456</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 20 3 -1.</_>
- <_>1 6 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.9249999206513166e-003</threshold>
- <left_val>-0.3443430066108704</left_val>
- <right_val>0.2085160017013550</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 9 9 -1.</_>
- <_>8 4 9 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0535710006952286</threshold>
- <left_val>1.4982949495315552</left_val>
- <right_val>0.0573280006647110</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 19 9 4 -1.</_>
- <_>2 21 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0192179996520281</threshold>
- <left_val>-0.9923409819602966</left_val>
- <right_val>-9.3919998034834862e-003</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 4 18 -1.</_>
- <_>11 7 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0552829988300800</threshold>
- <left_val>-0.5768229961395264</left_val>
- <right_val>0.1686059981584549</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 2 8 12 -1.</_>
- <_>7 2 4 6 2.</_>
- <_>11 8 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0563360005617142</threshold>
- <left_val>-0.0337750017642975</left_val>
- <right_val>-1.3889650106430054</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 10 9 8 -1.</_>
- <_>14 10 3 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0238240007311106</threshold>
- <left_val>0.4018209874629974</left_val>
- <right_val>1.8360000103712082e-003</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 12 5 -1.</_>
- <_>9 11 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.7810000572353601e-003</threshold>
- <left_val>0.1814599931240082</left_val>
- <right_val>-0.4174340069293976</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 9 9 6 -1.</_>
- <_>14 9 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0376890003681183</threshold>
- <left_val>0.5468310117721558</left_val>
- <right_val>0.0182199999690056</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 6 9 -1.</_>
- <_>7 10 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0241449996829033</threshold>
- <left_val>0.6835209727287293</left_val>
- <right_val>-0.1965020000934601</right_val></_></_></trees>
- <stage_threshold>-3.5645289421081543</stage_threshold>
- <parent>11</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 13 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 5 12 -1.</_>
- <_>4 11 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0274449996650219</threshold>
- <left_val>-0.8998420238494873</left_val>
- <right_val>0.5187649726867676</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 21 6 -1.</_>
- <_>9 0 7 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1155410036444664</threshold>
- <left_val>-0.5652440190315247</left_val>
- <right_val>0.7055130004882813</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 10 6 -1.</_>
- <_>7 8 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0222970005124807</threshold>
- <left_val>0.3607999980449677</left_val>
- <right_val>-0.6686459779739380</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 15 -1.</_>
- <_>11 0 2 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0133250001817942</threshold>
- <left_val>-0.5557339787483215</left_val>
- <right_val>0.3578999936580658</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 18 2 -1.</_>
- <_>2 3 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.8060001097619534e-003</threshold>
- <left_val>-1.0713000297546387</left_val>
- <right_val>0.1885000020265579</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 17 8 6 -1.</_>
- <_>8 20 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.6819999329745770e-003</threshold>
- <left_val>-0.7158430218696594</left_val>
- <right_val>0.2634449899196625</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 18 2 -1.</_>
- <_>3 1 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.3819999080151320e-003</threshold>
- <left_val>-0.4693079888820648</left_val>
- <right_val>0.2665840089321137</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 9 6 -1.</_>
- <_>11 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0376430004835129</threshold>
- <left_val>0.2109870016574860</left_val>
- <right_val>-1.0804339647293091</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 18 3 -1.</_>
- <_>0 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0138619998469949</threshold>
- <left_val>0.6691200137138367</left_val>
- <right_val>-0.2794280052185059</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 12 5 -1.</_>
- <_>10 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.7350001037120819e-003</threshold>
- <left_val>-0.9533230066299439</left_val>
- <right_val>0.2405129969120026</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 9 -1.</_>
- <_>2 3 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0383369997143745</threshold>
- <left_val>0.8143280148506165</left_val>
- <right_val>-0.2491939961910248</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 2 4 9 -1.</_>
- <_>20 2 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0346979983150959</threshold>
- <left_val>1.2330100536346436</left_val>
- <right_val>6.8600000813603401e-003</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 4 9 -1.</_>
- <_>2 2 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0233609993010759</threshold>
- <left_val>-0.3079470098018646</left_val>
- <right_val>0.7071449756622315</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 4 -1.</_>
- <_>12 1 12 2 2.</_>
- <_>0 3 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0350579991936684</threshold>
- <left_val>0.2120590060949326</left_val>
- <right_val>-1.4399830102920532</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 9 6 -1.</_>
- <_>0 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0132569996640086</threshold>
- <left_val>-0.9026070237159729</left_val>
- <right_val>0.0486100018024445</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 9 6 -1.</_>
- <_>14 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0127400001510978</threshold>
- <left_val>0.2265519946813583</left_val>
- <right_val>-0.4464380145072937</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 19 3 -1.</_>
- <_>0 16 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.6400000099092722e-003</threshold>
- <left_val>-0.3981789946556091</left_val>
- <right_val>0.3466539978981018</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 22 12 -1.</_>
- <_>12 5 11 6 2.</_>
- <_>1 11 11 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1006470024585724</threshold>
- <left_val>0.1838359981775284</left_val>
- <right_val>-1.3410769701004028</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 13 6 6 -1.</_>
- <_>8 13 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.</threshold>
- <left_val>0.1553640067577362</left_val>
- <right_val>-0.5158249735832214</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 2 20 3 -1.</_>
- <_>4 3 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0117089999839664</threshold>
- <left_val>0.2165140062570572</left_val>
- <right_val>-0.7270519733428955</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 14 6 10 -1.</_>
- <_>10 14 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0359649993479252</threshold>
- <left_val>-1.4789500236511230</left_val>
- <right_val>-0.0243170000612736</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 12 16 6 -1.</_>
- <_>14 12 8 3 2.</_>
- <_>6 15 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0212360005825758</threshold>
- <left_val>-0.1684409976005554</left_val>
- <right_val>0.1952659934759140</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 13 8 9 -1.</_>
- <_>2 16 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0148740001022816</threshold>
- <left_val>0.0373359993100166</left_val>
- <right_val>-0.8755729794502258</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 8 6 14 -1.</_>
- <_>14 8 3 7 2.</_>
- <_>11 15 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.1409997977316380e-003</threshold>
- <left_val>0.3346650004386902</left_val>
- <right_val>-0.2410970032215118</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 16 6 -1.</_>
- <_>2 12 8 3 2.</_>
- <_>10 15 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0234500002115965</threshold>
- <left_val>5.5320002138614655e-003</left_val>
- <right_val>-1.2509720325469971</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 16 16 8 -1.</_>
- <_>5 20 16 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0250620003789663</threshold>
- <left_val>0.4521239995956421</left_val>
- <right_val>-0.0844699963927269</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 4 12 -1.</_>
- <_>9 7 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.7400001464411616e-004</threshold>
- <left_val>0.1524990051984787</left_val>
- <right_val>-0.4848650097846985</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 8 10 -1.</_>
- <_>12 2 4 5 2.</_>
- <_>8 7 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0404839999973774</threshold>
- <left_val>-1.3024920225143433</left_val>
- <right_val>0.1798350065946579</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 6 -1.</_>
- <_>6 6 6 3 2.</_>
- <_>12 9 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0281709991395473</threshold>
- <left_val>-0.2441090047359467</left_val>
- <right_val>0.6227110028266907</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 6 9 -1.</_>
- <_>12 7 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0456929989159107</threshold>
- <left_val>0.0281220003962517</left_val>
- <right_val>0.9239439964294434</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 8 12 -1.</_>
- <_>0 0 4 6 2.</_>
- <_>4 6 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0397070012986660</threshold>
- <left_val>-0.2233279943466187</left_val>
- <right_val>0.7767400145530701</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 8 6 9 -1.</_>
- <_>18 11 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0505170002579689</threshold>
- <left_val>0.2031999975442886</left_val>
- <right_val>-1.0895930528640747</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 6 6 -1.</_>
- <_>5 12 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0172669999301434</threshold>
- <left_val>0.6859840154647827</left_val>
- <right_val>-0.2330449968576431</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 21 3 -1.</_>
- <_>10 21 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0801860019564629</threshold>
- <left_val>-0.0102920001372695</left_val>
- <right_val>0.6188110113143921</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 16 6 -1.</_>
- <_>2 3 16 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0976760014891624</threshold>
- <left_val>-0.2007029950618744</left_val>
- <right_val>1.0088349580764771</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 6 7 6 -1.</_>
- <_>13 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0155720002949238</threshold>
- <left_val>0.4761529862880707</left_val>
- <right_val>0.0456239990890026</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 4 14 -1.</_>
- <_>6 11 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0153050003573298</threshold>
- <left_val>-1.1077369451522827</left_val>
- <right_val>4.5239999890327454e-003</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 7 6 9 -1.</_>
- <_>11 7 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0164850000292063</threshold>
- <left_val>1.0152939558029175</left_val>
- <right_val>0.0163279995322227</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 6 14 -1.</_>
- <_>7 8 3 7 2.</_>
- <_>10 15 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0261419992893934</threshold>
- <left_val>0.4172329902648926</left_val>
- <right_val>-0.2864550054073334</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 8 4 16 -1.</_>
- <_>18 16 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.8679995387792587e-003</threshold>
- <left_val>0.2140499949455261</left_val>
- <right_val>-0.1677280068397522</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 14 6 10 -1.</_>
- <_>11 14 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0268869996070862</threshold>
- <left_val>-1.1564220190048218</left_val>
- <right_val>-0.0103240003809333</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 12 5 -1.</_>
- <_>10 11 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.7789998613297939e-003</threshold>
- <left_val>0.3535949885845184</left_val>
- <right_val>-0.2961130142211914</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 23 3 -1.</_>
- <_>0 13 23 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0159740000963211</threshold>
- <left_val>-1.5374109745025635</left_val>
- <right_val>-0.0299580004066229</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 6 12 -1.</_>
- <_>15 0 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0208669994026423</threshold>
- <left_val>0.2024410068988800</left_val>
- <right_val>-0.7127019762992859</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 12 5 -1.</_>
- <_>4 10 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0854820013046265</threshold>
- <left_val>-0.0259329993277788</left_val>
- <right_val>-1.5156569480895996</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 2 10 4 -1.</_>
- <_>13 4 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0238729994744062</threshold>
- <left_val>0.1680340021848679</left_val>
- <right_val>-0.3880620002746582</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 6 12 -1.</_>
- <_>7 0 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0391050018370152</threshold>
- <left_val>-1.1958349943161011</left_val>
- <right_val>-0.0203610006719828</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 9 6 -1.</_>
- <_>14 6 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0779469981789589</threshold>
- <left_val>-1.0898950099945068</left_val>
- <right_val>0.1453029960393906</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 9 6 -1.</_>
- <_>7 6 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0168760009109974</threshold>
- <left_val>0.2804970145225525</left_val>
- <right_val>-0.4133630096912384</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 18 13 -1.</_>
- <_>12 11 6 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1187560036778450</threshold>
- <left_val>-0.0434909984469414</left_val>
- <right_val>0.4126369953155518</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 18 13 -1.</_>
- <_>6 11 6 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1562419980764389</threshold>
- <left_val>-0.2642959952354431</left_val>
- <right_val>0.5512779951095581</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 16 12 6 -1.</_>
- <_>16 16 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0459080003201962</threshold>
- <left_val>0.6018919944763184</left_val>
- <right_val>0.0189210008829832</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 21 3 -1.</_>
- <_>0 7 21 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0103099998086691</threshold>
- <left_val>0.3815299868583679</left_val>
- <right_val>-0.2950789928436279</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 16 12 6 -1.</_>
- <_>16 16 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0957690030336380</threshold>
- <left_val>0.1324650049209595</left_val>
- <right_val>-0.4626680016517639</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 6 14 -1.</_>
- <_>5 14 6 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0136869996786118</threshold>
- <left_val>0.1173869967460632</left_val>
- <right_val>-0.5166410207748413</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 19 2 -1.</_>
- <_>5 11 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.3990001063793898e-003</threshold>
- <left_val>-0.3400759994983673</left_val>
- <right_val>0.2095350027084351</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 14 4 -1.</_>
- <_>5 6 14 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0332649983465672</threshold>
- <left_val>-0.1705279946327210</left_val>
- <right_val>1.4366799592971802</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 18 4 -1.</_>
- <_>9 18 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0332060009241104</threshold>
- <left_val>0.6129570007324219</left_val>
- <right_val>-0.0415499992668629</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 4 9 -1.</_>
- <_>9 0 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.7979998849332333e-003</threshold>
- <left_val>-0.4855430126190186</left_val>
- <right_val>0.1337269991636276</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 3 11 4 -1.</_>
- <_>13 5 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0657920017838478</threshold>
- <left_val>-4.0257668495178223</left_val>
- <right_val>0.1087670028209686</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 9 6 -1.</_>
- <_>5 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.1430000197142363e-003</threshold>
- <left_val>-0.3917999863624573</left_val>
- <right_val>0.2242709994316101</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 1 4 23 -1.</_>
- <_>19 1 2 23 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0223639998584986</threshold>
- <left_val>-0.0864299982786179</left_val>
- <right_val>0.3778519928455353</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 4 23 -1.</_>
- <_>3 1 2 23 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0574100017547607</threshold>
- <left_val>1.1454069614410400</left_val>
- <right_val>-0.1973659992218018</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 16 18 3 -1.</_>
- <_>5 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.6550001502037048e-003</threshold>
- <left_val>-0.0211050007492304</left_val>
- <right_val>0.5845339894294739</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 11 4 -1.</_>
- <_>0 5 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0123269995674491</threshold>
- <left_val>0.0378170013427734</left_val>
- <right_val>-0.6698700189590454</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 16 20 3 -1.</_>
- <_>2 17 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.1869997084140778e-003</threshold>
- <left_val>0.5636600255966187</left_val>
- <right_val>-0.0768779963254929</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 3 13 4 -1.</_>
- <_>5 5 13 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0366810001432896</threshold>
- <left_val>-0.1734330058097839</left_val>
- <right_val>1.1670149564743042</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 9 22 15 -1.</_>
- <_>1 9 11 15 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.4022040069103241</threshold>
- <left_val>1.2640819549560547</left_val>
- <right_val>0.0433989986777306</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 14 3 -1.</_>
- <_>10 4 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0221260003745556</threshold>
- <left_val>0.6697810292243958</left_val>
- <right_val>-0.2160529941320419</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 10 4 -1.</_>
- <_>8 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0131569998338819</threshold>
- <left_val>-0.4119859933853149</left_val>
- <right_val>0.2021500021219254</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 10 4 -1.</_>
- <_>11 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0128600001335144</threshold>
- <left_val>-0.9158269762992859</left_val>
- <right_val>0.0392329990863800</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 4 6 9 -1.</_>
- <_>12 4 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0216279998421669</threshold>
- <left_val>3.8719999138265848e-003</left_val>
- <right_val>0.3566820025444031</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 12 9 6 -1.</_>
- <_>4 12 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0118960002437234</threshold>
- <left_val>-0.3730390071868897</left_val>
- <right_val>0.1923509985208511</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 3 8 10 -1.</_>
- <_>12 3 4 5 2.</_>
- <_>8 8 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0195489991456270</threshold>
- <left_val>-0.4237489998340607</left_val>
- <right_val>0.2442959994077683</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 16 6 -1.</_>
- <_>3 6 8 3 2.</_>
- <_>11 9 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0644449964165688</threshold>
- <left_val>-0.1655890047550201</left_val>
- <right_val>1.2697030305862427</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 6 -1.</_>
- <_>5 9 14 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1089849993586540</threshold>
- <left_val>0.1489430069923401</left_val>
- <right_val>-2.1534640789031982</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 9 6 -1.</_>
- <_>4 5 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0340779982507229</threshold>
- <left_val>1.3779460191726685</left_val>
- <right_val>-0.1619849950075150</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 18 2 -1.</_>
- <_>6 4 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.7489999085664749e-003</threshold>
- <left_val>-0.3382860124111176</left_val>
- <right_val>0.2115290015935898</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 9 6 -1.</_>
- <_>10 6 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0109719997271895</threshold>
- <left_val>0.7651789784431458</left_val>
- <right_val>-0.1969259977340698</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 3 -1.</_>
- <_>0 2 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0114850001409650</threshold>
- <left_val>-0.6927120089530945</left_val>
- <right_val>0.2165710031986237</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 10 6 -1.</_>
- <_>0 19 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0259840004146099</threshold>
- <left_val>-0.0119839999824762</left_val>
- <right_val>-0.9969729781150818</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 18 3 -1.</_>
- <_>3 19 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.2159999720752239e-003</threshold>
- <left_val>-0.1020570024847984</left_val>
- <right_val>0.4888440072536469</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 6 16 -1.</_>
- <_>2 5 3 8 2.</_>
- <_>5 13 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0476970002055168</threshold>
- <left_val>1.0666010379791260</left_val>
- <right_val>-0.1757629960775375</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 11 6 -1.</_>
- <_>7 8 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.0300001273863018e-004</threshold>
- <left_val>0.1852480024099350</left_val>
- <right_val>-0.7479000091552734</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 12 22 -1.</_>
- <_>5 13 12 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1153960004448891</threshold>
- <left_val>-0.2201970070600510</left_val>
- <right_val>0.5450999736785889</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 4 10 -1.</_>
- <_>10 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0160210002213717</threshold>
- <left_val>0.2548750042915344</left_val>
- <right_val>-0.5074009895324707</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 4 18 -1.</_>
- <_>9 6 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0566320009529591</threshold>
- <left_val>-0.0112560000270605</left_val>
- <right_val>-0.9596809744834900</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 8 6 9 -1.</_>
- <_>18 11 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0107260001823306</threshold>
- <left_val>-0.2854470014572144</left_val>
- <right_val>0.1699479967355728</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 15 10 -1.</_>
- <_>9 7 5 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1242000013589859</threshold>
- <left_val>-0.0361399985849857</left_val>
- <right_val>-1.3132710456848145</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 6 9 -1.</_>
- <_>12 5 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.3799999877810478e-003</threshold>
- <left_val>0.3309270143508911</left_val>
- <right_val>0.0133079998195171</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 9 6 10 -1.</_>
- <_>11 9 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0119080003350973</threshold>
- <left_val>-0.3483029901981354</left_val>
- <right_val>0.2404190003871918</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 14 6 10 -1.</_>
- <_>13 14 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0430079996585846</threshold>
- <left_val>-1.4390469789505005</left_val>
- <right_val>0.1559959948062897</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 14 6 10 -1.</_>
- <_>9 14 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0331499986350536</threshold>
- <left_val>-1.1805850267410278</left_val>
- <right_val>-0.0123479999601841</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 8 16 9 -1.</_>
- <_>4 11 16 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0213419999927282</threshold>
- <left_val>2.2119441032409668</left_val>
- <right_val>0.0627370029687881</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 20 3 -1.</_>
- <_>2 12 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0122189996764064</threshold>
- <left_val>-1.8709750175476074</left_val>
- <right_val>-0.0454999990761280</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 4 13 -1.</_>
- <_>13 0 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0168609991669655</threshold>
- <left_val>-0.7691270112991333</left_val>
- <right_val>0.1533000022172928</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 4 13 -1.</_>
- <_>9 0 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.4999999441206455e-003</threshold>
- <left_val>-0.6298739910125732</left_val>
- <right_val>0.0516000017523766</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 18 7 -1.</_>
- <_>9 1 6 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0450379997491837</threshold>
- <left_val>0.8542889952659607</left_val>
- <right_val>6.2600001692771912e-003</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 11 6 9 -1.</_>
- <_>1 14 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0390579998493195</threshold>
- <left_val>-0.0324589982628822</left_val>
- <right_val>-1.3325669765472412</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 9 6 -1.</_>
- <_>8 20 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.6720000468194485e-003</threshold>
- <left_val>-0.1942359954118729</left_val>
- <right_val>0.3732869923114777</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 15 6 -1.</_>
- <_>3 11 15 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0163610000163317</threshold>
- <left_val>2.0605869293212891</left_val>
- <right_val>-0.1504269987344742</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 19 2 -1.</_>
- <_>5 11 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.1719999648630619e-003</threshold>
- <left_val>-0.1161099970340729</left_val>
- <right_val>0.2545540034770966</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 7 16 -1.</_>
- <_>8 14 7 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0457220003008842</threshold>
- <left_val>-0.0163400005549192</left_val>
- <right_val>-1.0449140071868896</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 14 9 6 -1.</_>
- <_>9 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.1209999471902847e-003</threshold>
- <left_val>-0.0419979989528656</left_val>
- <right_val>0.3968099951744080</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 8 12 -1.</_>
- <_>0 11 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.7800000205170363e-004</threshold>
- <left_val>-0.6642259955406189</left_val>
- <right_val>0.0334430001676083</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 18 3 -1.</_>
- <_>6 5 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.1109998971223831e-003</threshold>
- <left_val>-0.0582319982349873</left_val>
- <right_val>0.3785730004310608</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 12 6 -1.</_>
- <_>4 16 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0498640015721321</threshold>
- <left_val>0.6101940274238586</left_val>
- <right_val>-0.2100570052862167</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 13 9 4 -1.</_>
- <_>13 15 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0250119995325804</threshold>
- <left_val>-0.5710009932518005</left_val>
- <right_val>0.1784839928150177</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 14 14 -1.</_>
- <_>5 8 7 7 2.</_>
- <_>12 15 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0309399999678135</threshold>
- <left_val>0.0563630014657974</left_val>
- <right_val>-0.6473100185394287</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 16 22 6 -1.</_>
- <_>12 16 11 3 2.</_>
- <_>1 19 11 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0462710000574589</threshold>
- <left_val>0.1748239994049072</left_val>
- <right_val>-0.9890940189361572</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 9 -1.</_>
- <_>11 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.1870000530034304e-003</threshold>
- <left_val>-0.6680480241775513</left_val>
- <right_val>0.0322670005261898</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 10 10 -1.</_>
- <_>14 5 5 5 2.</_>
- <_>9 10 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0243519991636276</threshold>
- <left_val>0.2944490015506744</left_val>
- <right_val>-1.3599999947473407e-003</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 10 10 -1.</_>
- <_>5 5 5 5 2.</_>
- <_>10 10 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0119740003719926</threshold>
- <left_val>-0.2834509909152985</left_val>
- <right_val>0.4717119932174683</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 16 6 -1.</_>
- <_>12 6 8 3 2.</_>
- <_>4 9 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0130700003355742</threshold>
- <left_val>-0.1083460003137589</left_val>
- <right_val>0.5719329714775085</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 6 9 -1.</_>
- <_>0 10 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0591630004346371</threshold>
- <left_val>-0.0509390011429787</left_val>
- <right_val>-1.9059720039367676</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 10 8 14 -1.</_>
- <_>20 10 4 7 2.</_>
- <_>16 17 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0410949997603893</threshold>
- <left_val>0.4510459899902344</left_val>
- <right_val>-9.7599998116493225e-003</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 12 -1.</_>
- <_>9 18 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0839890018105507</threshold>
- <left_val>-2.0349199771881104</left_val>
- <right_val>-0.0510190017521381</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 10 8 12 -1.</_>
- <_>12 10 4 6 2.</_>
- <_>8 16 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0446190014481544</threshold>
- <left_val>0.1704110056161881</left_val>
- <right_val>-1.2278720140457153</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 4 9 -1.</_>
- <_>10 0 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0244190003722906</threshold>
- <left_val>-0.0217969994992018</left_val>
- <right_val>-1.0822949409484863</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 4 8 16 -1.</_>
- <_>14 4 4 8 2.</_>
- <_>10 12 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.3870001100003719e-003</threshold>
- <left_val>0.3046669960021973</left_val>
- <right_val>-0.3706659972667694</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 10 10 6 -1.</_>
- <_>7 12 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0246079992502928</threshold>
- <left_val>-0.3116950094699860</left_val>
- <right_val>0.2365729957818985</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 14 -1.</_>
- <_>12 6 7 7 2.</_>
- <_>5 13 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0851820036768913</threshold>
- <left_val>-1.7982350587844849</left_val>
- <right_val>0.1525429934263229</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 20 2 -1.</_>
- <_>2 12 20 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0218449998646975</threshold>
- <left_val>-0.0518880002200603</left_val>
- <right_val>-1.9017189741134644</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 8 4 16 -1.</_>
- <_>18 16 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0168290007859468</threshold>
- <left_val>0.2102590054273605</left_val>
- <right_val>0.0216569993644953</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 11 12 10 -1.</_>
- <_>1 11 6 5 2.</_>
- <_>7 16 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0325479991734028</threshold>
- <left_val>-0.2029259949922562</left_val>
- <right_val>0.6094400286674500</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 12 4 -1.</_>
- <_>6 11 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.4709999561309814e-003</threshold>
- <left_val>-0.9537119865417481</left_val>
- <right_val>0.1856839954853058</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 7 -1.</_>
- <_>12 12 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0554159991443157</threshold>
- <left_val>-0.1440529972314835</left_val>
- <right_val>2.1506340503692627</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 4 8 16 -1.</_>
- <_>14 4 4 8 2.</_>
- <_>10 12 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1063549965620041</threshold>
- <left_val>-1.0911970138549805</left_val>
- <right_val>0.1322800070047379</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 8 16 -1.</_>
- <_>6 4 4 8 2.</_>
- <_>10 12 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.9889995977282524e-003</threshold>
- <left_val>0.1025340035557747</left_val>
- <right_val>-0.5174490213394165</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 9 9 6 -1.</_>
- <_>11 9 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0755679979920387</threshold>
- <left_val>0.0589650012552738</left_val>
- <right_val>1.2354209423065186</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 16 12 -1.</_>
- <_>1 5 8 6 2.</_>
- <_>9 11 8 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0928059965372086</threshold>
- <left_val>-1.3431650400161743</left_val>
- <right_val>-0.0344629995524883</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 9 6 8 -1.</_>
- <_>9 9 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0494319982826710</threshold>
- <left_val>0.0496019981801510</left_val>
- <right_val>1.6054730415344238</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 3 18 -1.</_>
- <_>7 0 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0117729995399714</threshold>
- <left_val>-1.0261050462722778</left_val>
- <right_val>-4.1559999808669090e-003</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 9 5 14 -1.</_>
- <_>17 16 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0858860015869141</threshold>
- <left_val>0.0846429988741875</left_val>
- <right_val>0.9522079825401306</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 9 5 14 -1.</_>
- <_>2 16 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0810310021042824</threshold>
- <left_val>-0.1468710005283356</left_val>
- <right_val>1.9359990358352661</right_val></_></_></trees>
- <stage_threshold>-3.7025990486145020</stage_threshold>
- <parent>12</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 14 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 4 10 6 -1.</_>
- <_>7 7 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0338409990072250</threshold>
- <left_val>0.6588950157165527</left_val>
- <right_val>-0.6975529789924622</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 3 23 18 -1.</_>
- <_>1 9 23 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0154100004583597</threshold>
- <left_val>-0.9072840213775635</left_val>
- <right_val>0.3047859966754913</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 21 3 -1.</_>
- <_>8 1 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0549059994518757</threshold>
- <left_val>-0.4977479875087738</left_val>
- <right_val>0.5713260173797607</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0213900003582239</threshold>
- <left_val>-0.4256519973278046</left_val>
- <right_val>0.5809680223464966</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 12 6 -1.</_>
- <_>3 18 6 3 2.</_>
- <_>9 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.8849997371435165e-003</threshold>
- <left_val>-0.4790599942207336</left_val>
- <right_val>0.4301649928092957</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 8 8 16 -1.</_>
- <_>20 8 4 8 2.</_>
- <_>16 16 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0375449992716312</threshold>
- <left_val>0.5086159706115723</left_val>
- <right_val>-0.1998589932918549</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 19 24 4 -1.</_>
- <_>8 19 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1592579931020737</threshold>
- <left_val>-0.2326360046863556</left_val>
- <right_val>1.0993319749832153</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 8 8 16 -1.</_>
- <_>20 8 4 8 2.</_>
- <_>16 16 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0689399987459183</threshold>
- <left_val>0.4056900143623352</left_val>
- <right_val>0.0568550005555153</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 8 16 -1.</_>
- <_>0 8 4 8 2.</_>
- <_>4 16 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0336950011551380</threshold>
- <left_val>0.4513280093669891</left_val>
- <right_val>-0.3333280086517334</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 12 8 10 -1.</_>
- <_>8 17 8 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0633149966597557</threshold>
- <left_val>-0.8501570224761963</left_val>
- <right_val>0.2234169989824295</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 5 8 -1.</_>
- <_>5 11 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.3699997738003731e-003</threshold>
- <left_val>-0.9308220148086548</left_val>
- <right_val>0.0592169985175133</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 19 2 -1.</_>
- <_>4 2 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.5969997346401215e-003</threshold>
- <left_val>-1.2794899940490723</left_val>
- <right_val>0.1844729930162430</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 24 9 -1.</_>
- <_>8 12 8 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1306799948215485</threshold>
- <left_val>0.5842689871788025</left_val>
- <right_val>-0.2600719928741455</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 13 8 -1.</_>
- <_>6 4 13 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0574029982089996</threshold>
- <left_val>-0.0537890009582043</left_val>
- <right_val>0.7117559909820557</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 3 -1.</_>
- <_>0 1 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.2340001352131367e-003</threshold>
- <left_val>-0.8696219921112061</left_val>
- <right_val>0.0752149969339371</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 3 4 11 -1.</_>
- <_>20 3 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0310989990830421</threshold>
- <left_val>-0.0750069990754128</left_val>
- <right_val>0.9078159928321838</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 6 9 -1.</_>
- <_>10 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0358540005981922</threshold>
- <left_val>-0.2479549944400787</left_val>
- <right_val>0.7227209806442261</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 12 8 -1.</_>
- <_>12 11 6 4 2.</_>
- <_>6 15 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0315349996089935</threshold>
- <left_val>-1.1238329410552979</left_val>
- <right_val>0.2098830044269562</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 12 6 -1.</_>
- <_>0 8 6 3 2.</_>
- <_>6 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0194370001554489</threshold>
- <left_val>-1.4499390125274658</left_val>
- <right_val>-0.0151000004261732</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 17 18 3 -1.</_>
- <_>6 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.2420001961290836e-003</threshold>
- <left_val>0.5386490225791931</left_val>
- <right_val>-0.1137539967894554</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 9 6 -1.</_>
- <_>0 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.1639997661113739e-003</threshold>
- <left_val>0.0668890029191971</left_val>
- <right_val>-0.7687289714813232</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 3 4 9 -1.</_>
- <_>20 3 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0436530001461506</threshold>
- <left_val>1.1413530111312866</left_val>
- <right_val>0.0402170009911060</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 4 9 -1.</_>
- <_>2 3 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0265699997544289</threshold>
- <left_val>-0.2471909970045090</left_val>
- <right_val>0.5929509997367859</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 9 19 -1.</_>
- <_>18 0 3 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0322169996798038</threshold>
- <left_val>-0.0400249995291233</left_val>
- <right_val>0.3268800079822540</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 9 19 -1.</_>
- <_>3 0 3 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0722360014915466</threshold>
- <left_val>0.5872939825057983</left_val>
- <right_val>-0.2539600133895874</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 6 8 -1.</_>
- <_>13 11 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0314249992370605</threshold>
- <left_val>0.1531510055065155</left_val>
- <right_val>-0.5604209899902344</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 6 8 -1.</_>
- <_>8 11 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.7699999413453043e-004</threshold>
- <left_val>0.1695889979600906</left_val>
- <right_val>-0.5262669920921326</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 19 3 -1.</_>
- <_>5 12 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.7189999818801880e-003</threshold>
- <left_val>-0.1494459956884384</left_val>
- <right_val>0.2965869903564453</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 20 18 4 -1.</_>
- <_>9 20 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0328750014305115</threshold>
- <left_val>-0.3994350135326386</left_val>
- <right_val>0.2515659928321838</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 16 6 -1.</_>
- <_>6 8 16 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0145530002191663</threshold>
- <left_val>0.2797259986400604</left_val>
- <right_val>-0.4720380008220673</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 9 6 -1.</_>
- <_>9 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0380179993808270</threshold>
- <left_val>-2.9200001154094934e-003</left_val>
- <right_val>-1.1300059556961060</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 3 4 14 -1.</_>
- <_>10 10 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.8659999370574951e-003</threshold>
- <left_val>0.4111180007457733</left_val>
- <right_val>-0.2622080147266388</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 15 12 -1.</_>
- <_>1 11 15 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0416069999337196</threshold>
- <left_val>-1.4293819665908813</left_val>
- <right_val>-0.0191329997032881</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 12 8 5 -1.</_>
- <_>11 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0248029995709658</threshold>
- <left_val>-0.2501359879970551</left_val>
- <right_val>0.1597869992256165</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 6 9 -1.</_>
- <_>7 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0100980000570416</threshold>
- <left_val>0.0437389984726906</left_val>
- <right_val>-0.6998609900474548</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 6 9 -1.</_>
- <_>14 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0209470000118017</threshold>
- <left_val>-0.9413779973983765</left_val>
- <right_val>0.2320400029420853</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 12 8 -1.</_>
- <_>5 5 6 4 2.</_>
- <_>11 9 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0224580001085997</threshold>
- <left_val>-0.2718580067157745</left_val>
- <right_val>0.4531919956207275</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 12 11 6 -1.</_>
- <_>13 14 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0371109992265701</threshold>
- <left_val>-1.0314660072326660</left_val>
- <right_val>0.1442179977893829</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 21 3 -1.</_>
- <_>0 14 21 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0106480000540614</threshold>
- <left_val>0.6310700178146362</left_val>
- <right_val>-0.2552079856395721</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 8 12 -1.</_>
- <_>12 1 4 6 2.</_>
- <_>8 7 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0554229989647865</threshold>
- <left_val>0.1620659977197647</left_val>
- <right_val>-1.7722640037536621</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 6 12 -1.</_>
- <_>1 0 3 6 2.</_>
- <_>4 6 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0216019991785288</threshold>
- <left_val>-0.2501609921455383</left_val>
- <right_val>0.5411980152130127</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 21 2 -1.</_>
- <_>2 3 21 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.7000000348780304e-005</threshold>
- <left_val>-0.2900890111923218</left_val>
- <right_val>0.3350799977779388</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 19 3 -1.</_>
- <_>2 3 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0144060002639890</threshold>
- <left_val>-7.8840004280209541e-003</left_val>
- <right_val>-1.1677219867706299</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 10 6 14 -1.</_>
- <_>20 10 3 7 2.</_>
- <_>17 17 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1077739968895912</threshold>
- <left_val>0.1129200011491776</left_val>
- <right_val>-2.4940319061279297</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 6 14 -1.</_>
- <_>1 10 3 7 2.</_>
- <_>4 17 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0359439998865128</threshold>
- <left_val>-0.1948059946298599</left_val>
- <right_val>0.9575750231742859</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 14 14 -1.</_>
- <_>14 6 7 7 2.</_>
- <_>7 13 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.9510000497102737e-003</threshold>
- <left_val>0.3092780113220215</left_val>
- <right_val>-0.2553020119667053</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 9 6 -1.</_>
- <_>0 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0209420006722212</threshold>
- <left_val>-7.6319999061524868e-003</left_val>
- <right_val>-1.0086350440979004</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 14 8 9 -1.</_>
- <_>15 17 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0298779997974634</threshold>
- <left_val>-0.4602769911289215</left_val>
- <right_val>0.1950719952583313</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 22 4 -1.</_>
- <_>1 1 11 2 2.</_>
- <_>12 3 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0259719993919134</threshold>
- <left_val>-0.0121879996731877</left_val>
- <right_val>-1.0035500526428223</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 11 9 6 -1.</_>
- <_>9 13 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0106030004099011</threshold>
- <left_val>-0.0759690031409264</left_val>
- <right_val>0.4166989922523499</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 18 3 -1.</_>
- <_>0 16 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.5819996893405914e-003</threshold>
- <left_val>-0.2664859890937805</left_val>
- <right_val>0.3911150097846985</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 14 7 9 -1.</_>
- <_>16 17 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0212709996849298</threshold>
- <left_val>0.1827390044927597</left_val>
- <right_val>-0.3605229854583740</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 16 4 -1.</_>
- <_>12 3 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0745180025696754</threshold>
- <left_val>-0.1893839985132217</left_val>
- <right_val>0.9265800118446350</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 12 5 -1.</_>
- <_>7 6 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.6569998376071453e-003</threshold>
- <left_val>-0.1450619995594025</left_val>
- <right_val>0.3329460024833679</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 4 9 -1.</_>
- <_>11 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.7119999974966049e-003</threshold>
- <left_val>-0.5246400237083435</left_val>
- <right_val>0.0898799970746040</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 4 10 -1.</_>
- <_>12 1 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.8500004969537258e-004</threshold>
- <left_val>-0.3838199973106384</left_val>
- <right_val>0.2439299970865250</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 4 10 -1.</_>
- <_>10 1 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0282339993864298</threshold>
- <left_val>-5.7879998348653316e-003</left_val>
- <right_val>-1.2617139816284180</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 15 6 9 -1.</_>
- <_>15 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0326780006289482</threshold>
- <left_val>-0.5795329809188843</left_val>
- <right_val>0.1695529967546463</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 15 6 9 -1.</_>
- <_>3 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0225360002368689</threshold>
- <left_val>0.0222810003906488</left_val>
- <right_val>-0.8786960244178772</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 1 3 19 -1.</_>
- <_>16 1 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0216579996049404</threshold>
- <left_val>-0.6510850191116333</left_val>
- <right_val>0.1296689957380295</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 3 6 9 -1.</_>
- <_>3 3 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.6799998059868813e-003</threshold>
- <left_val>-0.3396520018577576</left_val>
- <right_val>0.2201330065727234</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 3 19 -1.</_>
- <_>16 0 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0145920002833009</threshold>
- <left_val>0.1507730036973953</left_val>
- <right_val>-0.5045239925384522</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 12 4 -1.</_>
- <_>12 3 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0278680007904768</threshold>
- <left_val>-0.2504529953002930</left_val>
- <right_val>0.4574199914932251</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 4 9 -1.</_>
- <_>10 5 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.6940000504255295e-003</threshold>
- <left_val>-0.1094850003719330</left_val>
- <right_val>0.5575780272483826</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 3 19 -1.</_>
- <_>7 0 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0100029995664954</threshold>
- <left_val>-0.9736629724502564</left_val>
- <right_val>0.0184679999947548</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 3 12 -1.</_>
- <_>11 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.0719998069107533e-003</threshold>
- <left_val>0.3822219967842102</left_val>
- <right_val>-0.1692110002040863</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 10 5 -1.</_>
- <_>11 7 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0225939992815256</threshold>
- <left_val>-1.0391089916229248</left_val>
- <right_val>5.1839998923242092e-003</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 3 3 18 -1.</_>
- <_>12 3 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0395799987018108</threshold>
- <left_val>-5.5109229087829590</left_val>
- <right_val>0.1116399988532066</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 3 6 12 -1.</_>
- <_>11 3 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0175379998981953</threshold>
- <left_val>0.9548580050468445</left_val>
- <right_val>-0.1858450025320053</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 19 3 -1.</_>
- <_>3 8 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.0300003066658974e-003</threshold>
- <left_val>0.0104360003024340</left_val>
- <right_val>0.8211479783058167</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 18 3 -1.</_>
- <_>2 8 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.9539995640516281e-003</threshold>
- <left_val>0.2263289988040924</left_val>
- <right_val>-0.3456819951534271</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 13 18 4 -1.</_>
- <_>12 13 9 2 2.</_>
- <_>3 15 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0270910002291203</threshold>
- <left_val>0.1643009930849075</left_val>
- <right_val>-1.3926379680633545</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 6 9 -1.</_>
- <_>5 5 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0206259991973639</threshold>
- <left_val>-0.8636609911918640</left_val>
- <right_val>2.3880000226199627e-003</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 20 4 -1.</_>
- <_>14 1 10 2 2.</_>
- <_>4 3 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0719899982213974</threshold>
- <left_val>-2.8192629814147949</left_val>
- <right_val>0.1157049983739853</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 20 4 -1.</_>
- <_>0 1 10 2 2.</_>
- <_>10 3 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0269649997353554</threshold>
- <left_val>-1.2946130037307739</left_val>
- <right_val>-0.0246610008180141</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 15 6 6 -1.</_>
- <_>10 15 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0473779998719692</threshold>
- <left_val>-0.8130639791488648</left_val>
- <right_val>0.1183139979839325</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 8 -1.</_>
- <_>8 2 8 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1089560016989708</threshold>
- <left_val>0.6593790054321289</left_val>
- <right_val>-0.2084390074014664</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 18 3 -1.</_>
- <_>5 6 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0135740004479885</threshold>
- <left_val>7.4240001849830151e-003</left_val>
- <right_val>0.5315219759941101</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 15 6 6 -1.</_>
- <_>11 15 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.6920001991093159e-003</threshold>
- <left_val>0.3065580129623413</left_val>
- <right_val>-0.3108429908752441</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 12 8 5 -1.</_>
- <_>11 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.9070001803338528e-003</threshold>
- <left_val>0.2557649910449982</left_val>
- <right_val>-0.0529320016503334</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 12 8 5 -1.</_>
- <_>9 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0376130007207394</threshold>
- <left_val>-1.4350049495697021</left_val>
- <right_val>-0.0154480002820492</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 14 6 -1.</_>
- <_>5 2 14 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.6329998448491096e-003</threshold>
- <left_val>-0.1688439995050430</left_val>
- <right_val>0.4212490022182465</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 15 -1.</_>
- <_>10 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0320970006287098</threshold>
- <left_val>-0.6497939825057983</left_val>
- <right_val>0.0411100015044212</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 5 12 -1.</_>
- <_>10 11 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0584959983825684</threshold>
- <left_val>-0.0529639981687069</left_val>
- <right_val>0.6336830258369446</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 9 8 14 -1.</_>
- <_>7 9 4 7 2.</_>
- <_>11 16 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0409019999206066</threshold>
- <left_val>-0.9210109710693359</left_val>
- <right_val>9.0640000998973846e-003</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 22 6 -1.</_>
- <_>12 5 11 3 2.</_>
- <_>1 8 11 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0199250001460314</threshold>
- <left_val>0.5375999808311462</left_val>
- <right_val>-0.0629969984292984</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 6 6 -1.</_>
- <_>0 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.6020001173019409e-003</threshold>
- <left_val>-0.5433350205421448</left_val>
- <right_val>0.0841049998998642</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 17 9 4 -1.</_>
- <_>12 19 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0168249998241663</threshold>
- <left_val>0.1556369960308075</left_val>
- <right_val>-0.4017120003700256</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 18 19 3 -1.</_>
- <_>2 19 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.4790002331137657e-003</threshold>
- <left_val>-0.2424529939889908</left_val>
- <right_val>0.5150949954986572</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 17 9 4 -1.</_>
- <_>12 19 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0195349995046854</threshold>
- <left_val>-0.5111839771270752</left_val>
- <right_val>0.1383199989795685</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 17 18 3 -1.</_>
- <_>1 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0107460003346205</threshold>
- <left_val>-0.2185499966144562</left_val>
- <right_val>0.6282870173454285</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 17 9 4 -1.</_>
- <_>12 19 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0379270017147064</threshold>
- <left_val>0.1164029985666275</left_val>
- <right_val>-2.7301959991455078</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 3 -1.</_>
- <_>0 1 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0163909997791052</threshold>
- <left_val>-0.0146359996870160</left_val>
- <right_val>-1.0797250270843506</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 14 4 -1.</_>
- <_>5 2 14 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0197850000113249</threshold>
- <left_val>1.2166420221328735</left_val>
- <right_val>0.0332750007510185</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 14 9 6 -1.</_>
- <_>6 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0110670002177358</threshold>
- <left_val>-0.2538830041885376</left_val>
- <right_val>0.4403859972953796</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 6 9 -1.</_>
- <_>14 16 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.2479999139904976e-003</threshold>
- <left_val>0.2249680012464523</left_val>
- <right_val>-0.2421649992465973</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 20 13 4 -1.</_>
- <_>5 22 13 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0111419996246696</threshold>
- <left_val>0.2501809895038605</left_val>
- <right_val>-0.3081150054931641</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 9 6 12 -1.</_>
- <_>9 13 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0106669999659061</threshold>
- <left_val>-0.3272910118103027</left_val>
- <right_val>0.2616829872131348</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 21 3 -1.</_>
- <_>8 10 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1054529994726181</threshold>
- <left_val>-0.0557500012218952</left_val>
- <right_val>-1.9605729579925537</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 9 6 -1.</_>
- <_>11 8 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0548279993236065</threshold>
- <left_val>-1.9519999623298645e-003</left_val>
- <right_val>0.7386609911918640</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 9 7 -1.</_>
- <_>6 10 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0177609995007515</threshold>
- <left_val>-0.3064720034599304</left_val>
- <right_val>0.2634699940681458</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 10 10 8 -1.</_>
- <_>17 10 5 4 2.</_>
- <_>12 14 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0311859995126724</threshold>
- <left_val>-0.2460090070962906</left_val>
- <right_val>0.1708219945430756</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 24 3 -1.</_>
- <_>8 15 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0572960004210472</threshold>
- <left_val>0.4703350067138672</left_val>
- <right_val>-0.2604829967021942</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 5 9 6 -1.</_>
- <_>8 7 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0113120004534721</threshold>
- <left_val>0.3862890005111694</left_val>
- <right_val>-0.2881700098514557</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 6 9 -1.</_>
- <_>4 16 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0305920001119375</threshold>
- <left_val>-0.0488260015845299</left_val>
- <right_val>-1.7638969421386719</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 17 9 4 -1.</_>
- <_>12 19 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.8489999929443002e-003</threshold>
- <left_val>0.2109989970922470</left_val>
- <right_val>-0.0259409993886948</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 6 -1.</_>
- <_>9 15 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0114190001040697</threshold>
- <left_val>-0.1682959944009781</left_val>
- <right_val>1.0278660058975220</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 9 14 10 -1.</_>
- <_>16 9 7 5 2.</_>
- <_>9 14 7 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0814030021429062</threshold>
- <left_val>0.1153199970722199</left_val>
- <right_val>-1.2482399940490723</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 9 14 10 -1.</_>
- <_>1 9 7 5 2.</_>
- <_>8 14 7 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0534959994256496</threshold>
- <left_val>-0.0463039986789227</left_val>
- <right_val>-1.7165969610214233</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 9 17 -1.</_>
- <_>11 7 3 17 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0239480007439852</threshold>
- <left_val>-0.4024659991264343</left_val>
- <right_val>0.2056210041046143</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 6 20 -1.</_>
- <_>3 4 3 10 2.</_>
- <_>6 14 3 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.7690000869333744e-003</threshold>
- <left_val>-0.3315230011940002</left_val>
- <right_val>0.2068340033292770</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 10 4 -1.</_>
- <_>7 8 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0323439985513687</threshold>
- <left_val>-0.7263280153274536</left_val>
- <right_val>0.2007350027561188</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 4 9 -1.</_>
- <_>12 7 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0378630012273788</threshold>
- <left_val>-0.1563100069761276</left_val>
- <right_val>1.6697460412979126</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 15 6 9 -1.</_>
- <_>12 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0154400002211332</threshold>
- <left_val>0.1948740035295487</left_val>
- <right_val>-0.3538419902324677</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 8 6 16 -1.</_>
- <_>3 8 3 8 2.</_>
- <_>6 16 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0443760007619858</threshold>
- <left_val>0.8209360241889954</left_val>
- <right_val>-0.1819359958171845</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 17 9 4 -1.</_>
- <_>12 19 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0231020003557205</threshold>
- <left_val>-0.4304409921169281</left_val>
- <right_val>0.1237540021538734</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 17 9 4 -1.</_>
- <_>3 19 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0194000005722046</threshold>
- <left_val>-0.0297260005027056</left_val>
- <right_val>-1.1597590446472168</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 1 9 6 -1.</_>
- <_>13 1 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1038570031523705</threshold>
- <left_val>0.1114989966154099</left_val>
- <right_val>-4.6835222244262695</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 4 10 -1.</_>
- <_>5 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0189640000462532</threshold>
- <left_val>2.1773819923400879</left_val>
- <right_val>-0.1454440057277679</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 12 6 -1.</_>
- <_>11 5 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0387509986758232</threshold>
- <left_val>-0.0494460016489029</left_val>
- <right_val>0.3401829898357391</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 9 8 -1.</_>
- <_>9 4 3 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0227669999003410</threshold>
- <left_val>-0.3280299901962280</left_val>
- <right_val>0.3053140044212341</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 16 10 8 -1.</_>
- <_>17 16 5 4 2.</_>
- <_>12 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0313570015132427</threshold>
- <left_val>1.1520819664001465</left_val>
- <right_val>0.0273059997707605</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 16 10 8 -1.</_>
- <_>2 16 5 4 2.</_>
- <_>7 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.6909999847412109e-003</threshold>
- <left_val>-0.3879950046539307</left_val>
- <right_val>0.2151259928941727</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 4 -1.</_>
- <_>12 0 12 2 2.</_>
- <_>0 2 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0492849983274937</threshold>
- <left_val>-1.6774909496307373</left_val>
- <right_val>0.1577419936656952</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 9 6 -1.</_>
- <_>0 8 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0395109988749027</threshold>
- <left_val>-0.9764789938926697</left_val>
- <right_val>-0.0105520002543926</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 24 6 -1.</_>
- <_>12 4 12 3 2.</_>
- <_>0 7 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0479979999363422</threshold>
- <left_val>0.2084390074014664</left_val>
- <right_val>-0.6899279952049255</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 11 4 -1.</_>
- <_>5 2 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0514229983091354</threshold>
- <left_val>-0.1666530072689056</left_val>
- <right_val>1.2149239778518677</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 22 4 -1.</_>
- <_>12 1 11 2 2.</_>
- <_>1 3 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0142799997702241</threshold>
- <left_val>0.2362769991159439</left_val>
- <right_val>-0.4139679968357086</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 18 -1.</_>
- <_>9 15 6 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0916119962930679</threshold>
- <left_val>-0.9283090233802795</left_val>
- <right_val>-0.0183450002223253</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 9 20 4 -1.</_>
- <_>2 11 20 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.5080001950263977e-003</threshold>
- <left_val>-0.7364720106124878</left_val>
- <right_val>0.1949709951877594</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 14 14 -1.</_>
- <_>5 9 14 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0357230007648468</threshold>
- <left_val>0.1419779956340790</left_val>
- <right_val>-0.4208930134773254</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 2 16 6 -1.</_>
- <_>4 5 16 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0506380014121532</threshold>
- <left_val>0.0116440001875162</left_val>
- <right_val>0.7848659753799439</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 3 19 3 -1.</_>
- <_>2 4 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0146139999851584</threshold>
- <left_val>-1.1909500360488892</left_val>
- <right_val>-0.0351280011236668</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 10 4 -1.</_>
- <_>7 3 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0386629998683929</threshold>
- <left_val>2.4314730167388916</left_val>
- <right_val>0.0656479969620705</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 4 15 -1.</_>
- <_>0 14 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0403469987213612</threshold>
- <left_val>0.7175530195236206</left_val>
- <right_val>-0.1910829991102219</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 10 21 3 -1.</_>
- <_>2 11 21 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0239020008593798</threshold>
- <left_val>0.1564619988203049</left_val>
- <right_val>-0.7929480075836182</right_val></_></_></trees>
- <stage_threshold>-3.4265899658203125</stage_threshold>
- <parent>13</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 15 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 6 6 -1.</_>
- <_>6 0 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.5640000179409981e-003</threshold>
- <left_val>-0.8145070075988770</left_val>
- <right_val>0.5887529850006104</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 14 9 -1.</_>
- <_>6 7 14 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1329260021448135</threshold>
- <left_val>0.9321339726448059</left_val>
- <right_val>-0.2936730086803436</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 6 9 -1.</_>
- <_>11 1 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.8400004208087921e-003</threshold>
- <left_val>-0.5646290183067322</left_val>
- <right_val>0.4164769947528839</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 8 9 9 -1.</_>
- <_>15 11 9 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.0889998674392700e-003</threshold>
- <left_val>-0.7923280000686646</left_val>
- <right_val>0.1697500050067902</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 4 21 -1.</_>
- <_>8 7 4 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0610390007495880</threshold>
- <left_val>-1.4169000387191772</left_val>
- <right_val>0.0250209998339415</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 22 19 2 -1.</_>
- <_>3 23 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.6599999768659472e-004</threshold>
- <left_val>0.3798249959945679</left_val>
- <right_val>-0.4156709909439087</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 15 20 3 -1.</_>
- <_>2 16 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.3889999613165855e-003</threshold>
- <left_val>-0.4076859951019287</left_val>
- <right_val>0.3554849922657013</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 0 4 13 -1.</_>
- <_>19 0 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0210069995373487</threshold>
- <left_val>-0.2408010065555573</left_val>
- <right_val>0.8611270189285278</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 7 8 8 -1.</_>
- <_>1 11 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.5559997931122780e-003</threshold>
- <left_val>-0.8746719956398010</left_val>
- <right_val>0.0985720008611679</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 14 6 9 -1.</_>
- <_>14 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0247799996286631</threshold>
- <left_val>0.1556620001792908</left_val>
- <right_val>-0.6922979950904846</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 14 6 9 -1.</_>
- <_>4 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0356200002133846</threshold>
- <left_val>-1.1472270488739014</left_val>
- <right_val>0.0363599993288517</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 5 4 10 -1.</_>
- <_>14 5 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0198100004345179</threshold>
- <left_val>0.1551620066165924</left_val>
- <right_val>-0.6952009797096252</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 4 10 -1.</_>
- <_>8 5 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0150199998170137</threshold>
- <left_val>0.0419900007545948</left_val>
- <right_val>-0.9662280082702637</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 5 6 6 -1.</_>
- <_>14 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0231379996985197</threshold>
- <left_val>0.4339689910411835</left_val>
- <right_val>2.4160000029951334e-003</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 5 6 6 -1.</_>
- <_>4 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0187430009245873</threshold>
- <left_val>0.4348109960556030</left_val>
- <right_val>-0.3252249956130981</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 21 -1.</_>
- <_>8 2 8 21 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.4508000016212463</threshold>
- <left_val>-0.0945739969611168</left_val>
- <right_val>0.7242130041122437</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 6 13 -1.</_>
- <_>3 2 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0118549996986985</threshold>
- <left_val>-0.3813309967517853</left_val>
- <right_val>0.3009839951992035</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 0 4 21 -1.</_>
- <_>20 0 2 21 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0248300004750490</threshold>
- <left_val>0.8930060267448425</left_val>
- <right_val>-0.1029589995741844</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 4 20 -1.</_>
- <_>2 4 2 20 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0447430014610291</threshold>
- <left_val>0.8628029823303223</left_val>
- <right_val>-0.2171649932861328</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 16 9 6 -1.</_>
- <_>8 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0146000003442168</threshold>
- <left_val>0.6006940007209778</left_val>
- <right_val>-0.1590629965066910</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0245270002633333</threshold>
- <left_val>-1.5872869491577148</left_val>
- <right_val>-0.0218170005828142</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 12 7 9 -1.</_>
- <_>16 15 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0230240002274513</threshold>
- <left_val>0.1685339957475662</left_val>
- <right_val>-0.3810690045356751</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 21 14 3 -1.</_>
- <_>12 21 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0249170009046793</threshold>
- <left_val>0.5081089735031128</left_val>
- <right_val>-0.2727989852428436</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 5 6 9 -1.</_>
- <_>11 5 3 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.0130000300705433e-003</threshold>
- <left_val>-0.4313879907131195</left_val>
- <right_val>0.2643809914588928</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 4 10 -1.</_>
- <_>12 5 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0156030002981424</threshold>
- <left_val>-0.3162420094013214</left_val>
- <right_val>0.5571590065956116</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 6 9 -1.</_>
- <_>12 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0266859997063875</threshold>
- <left_val>1.0553920269012451</left_val>
- <right_val>0.0290740001946688</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 6 9 -1.</_>
- <_>10 5 3 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.3940000208094716e-003</threshold>
- <left_val>-0.7187380194664002</left_val>
- <right_val>0.0653909966349602</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 14 10 4 -1.</_>
- <_>14 16 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.4799998654052615e-004</threshold>
- <left_val>0.2488439977169037</left_val>
- <right_val>-0.2097820043563843</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 14 14 -1.</_>
- <_>5 5 7 7 2.</_>
- <_>12 12 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0318880006670952</threshold>
- <left_val>-0.6884449720382690</left_val>
- <right_val>0.0635899975895882</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 8 12 6 -1.</_>
- <_>18 8 6 3 2.</_>
- <_>12 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.9290000461041927e-003</threshold>
- <left_val>-0.5915250182151794</left_val>
- <right_val>0.2794359922409058</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 12 -1.</_>
- <_>6 6 6 6 2.</_>
- <_>12 12 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0311680007725954</threshold>
- <left_val>0.0452239997684956</left_val>
- <right_val>-0.8863919973373413</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 13 6 10 -1.</_>
- <_>13 13 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0336630009114742</threshold>
- <left_val>-0.6159020066261292</left_val>
- <right_val>0.1574929952621460</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 20 8 -1.</_>
- <_>1 10 10 4 2.</_>
- <_>11 14 10 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0119669996201992</threshold>
- <left_val>-0.3060669898986816</left_val>
- <right_val>0.4229330122470856</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 13 9 6 -1.</_>
- <_>15 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0346800014376640</threshold>
- <left_val>-1.3734940290451050</left_val>
- <right_val>0.1590870022773743</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 9 -1.</_>
- <_>9 3 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.9290004000067711e-003</threshold>
- <left_val>-0.5586019754409790</left_val>
- <right_val>0.1211920008063316</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 1 5 14 -1.</_>
- <_>10 8 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0595749989151955</threshold>
- <left_val>4.9720001406967640e-003</left_val>
- <right_val>0.8205540180206299</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 16 6 -1.</_>
- <_>3 6 16 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0654280036687851</threshold>
- <left_val>1.5651429891586304</left_val>
- <right_val>-0.1681749969720841</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 3 8 9 -1.</_>
- <_>16 6 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0928959995508194</threshold>
- <left_val>-1.5794529914855957</left_val>
- <right_val>0.1466179937124252</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 13 6 10 -1.</_>
- <_>9 13 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0411840006709099</threshold>
- <left_val>-1.5518720149993896</left_val>
- <right_val>-0.0299699995666742</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 13 9 6 -1.</_>
- <_>15 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0214479994028807</threshold>
- <left_val>0.1719630062580109</left_val>
- <right_val>-0.6934319734573364</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 9 6 -1.</_>
- <_>0 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0255699995905161</threshold>
- <left_val>-1.3061310052871704</left_val>
- <right_val>-0.0243369992822409</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 16 9 6 -1.</_>
- <_>13 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0412009991705418</threshold>
- <left_val>-1.3821059465408325</left_val>
- <right_val>0.1480180025100708</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 16 9 6 -1.</_>
- <_>2 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0176689997315407</threshold>
- <left_val>-0.7088999748229981</left_val>
- <right_val>0.0365240015089512</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 16 18 3 -1.</_>
- <_>5 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.0060001239180565e-003</threshold>
- <left_val>-0.0409139990806580</left_val>
- <right_val>0.8037310242652893</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 16 18 3 -1.</_>
- <_>1 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0116529995575547</threshold>
- <left_val>0.5754680037498474</left_val>
- <right_val>-0.2499170005321503</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 18 3 -1.</_>
- <_>5 1 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.4780001305043697e-003</threshold>
- <left_val>-0.4928089976310730</left_val>
- <right_val>0.1981090009212494</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 19 2 -1.</_>
- <_>1 2 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.5499999113380909e-004</threshold>
- <left_val>-0.4885810017585754</left_val>
- <right_val>0.1356309950351715</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 2 6 11 -1.</_>
- <_>16 2 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0305380001664162</threshold>
- <left_val>-0.6027839779853821</left_val>
- <right_val>0.1852200031280518</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 15 15 6 -1.</_>
- <_>9 15 5 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0188469998538494</threshold>
- <left_val>0.2356559932231903</left_val>
- <right_val>-0.3513630032539368</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 2 6 11 -1.</_>
- <_>16 2 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.1129996106028557e-003</threshold>
- <left_val>-0.0813049972057343</left_val>
- <right_val>0.2106959968805313</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 2 6 11 -1.</_>
- <_>6 2 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0348300002515316</threshold>
- <left_val>-1.2065670490264893</left_val>
- <right_val>-0.0142519995570183</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 9 -1.</_>
- <_>18 5 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0190210007131100</threshold>
- <left_val>0.2334990054368973</left_val>
- <right_val>-0.4566490054130554</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 22 4 -1.</_>
- <_>1 2 11 2 2.</_>
- <_>12 4 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0190040003508329</threshold>
- <left_val>-0.8107579946517944</left_val>
- <right_val>0.0131400004029274</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 21 12 -1.</_>
- <_>9 0 7 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0890579968690872</threshold>
- <left_val>0.6154239773750305</left_val>
- <right_val>0.0329830013215542</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 18 3 -1.</_>
- <_>0 13 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.8620000965893269e-003</threshold>
- <left_val>-0.2958309948444367</left_val>
- <right_val>0.2700369954109192</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 2 6 9 -1.</_>
- <_>14 2 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0282409992069006</threshold>
- <left_val>-0.6110270023345947</left_val>
- <right_val>0.1735749989748001</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 18 3 -1.</_>
- <_>3 11 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.2099999953061342e-004</threshold>
- <left_val>-0.5332289934158325</left_val>
- <right_val>0.0685390010476112</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 3 8 9 -1.</_>
- <_>16 6 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1082910001277924</threshold>
- <left_val>-1.2879559993743896</left_val>
- <right_val>0.1180170029401779</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 18 3 -1.</_>
- <_>3 8 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0158789996057749</threshold>
- <left_val>-0.1707260012626648</left_val>
- <right_val>1.1103910207748413</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 11 6 9 -1.</_>
- <_>11 11 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.6859995499253273e-003</threshold>
- <left_val>-0.1099509969353676</left_val>
- <right_val>0.4601050019264221</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 6 9 -1.</_>
- <_>11 8 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0252349991351366</threshold>
- <left_val>1.0220669507980347</left_val>
- <right_val>-0.1869429945945740</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 2 18 -1.</_>
- <_>15 0 1 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0135089997202158</threshold>
- <left_val>-0.7831659913063049</left_val>
- <right_val>0.1420260071754456</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 2 18 -1.</_>
- <_>8 0 1 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.7149998396635056e-003</threshold>
- <left_val>-0.8806070089340210</left_val>
- <right_val>0.0110600003972650</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 3 7 9 -1.</_>
- <_>17 6 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0715800002217293</threshold>
- <left_val>0.1136939972639084</left_val>
- <right_val>-1.1032789945602417</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 9 6 -1.</_>
- <_>3 20 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0135540002956986</threshold>
- <left_val>-0.8109650015830994</left_val>
- <right_val>3.4080001059919596e-003</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 21 3 -1.</_>
- <_>3 19 21 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.9450000729411840e-003</threshold>
- <left_val>-0.0728799998760223</left_val>
- <right_val>0.3499810099601746</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 7 9 -1.</_>
- <_>0 6 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0508330017328262</threshold>
- <left_val>-1.2868590354919434</left_val>
- <right_val>-0.0288420002907515</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 22 3 -1.</_>
- <_>2 8 22 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.7989997118711472e-003</threshold>
- <left_val>0.4761359989643097</left_val>
- <right_val>-0.1469040066003799</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 24 16 -1.</_>
- <_>0 3 12 8 2.</_>
- <_>12 11 12 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2142439931631088</threshold>
- <left_val>-0.0597020015120506</left_val>
- <right_val>-2.4802260398864746</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 17 9 4 -1.</_>
- <_>13 19 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0139629999175668</threshold>
- <left_val>0.1742029935121536</left_val>
- <right_val>-0.4391100108623505</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 12 8 -1.</_>
- <_>5 5 6 4 2.</_>
- <_>11 9 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0425020009279251</threshold>
- <left_val>-0.1996529996395111</left_val>
- <right_val>0.7065479755401611</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 6 -1.</_>
- <_>12 6 7 3 2.</_>
- <_>5 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0198279991745949</threshold>
- <left_val>-0.0691360011696815</left_val>
- <right_val>0.6164339780807495</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 16 14 6 -1.</_>
- <_>5 16 7 3 2.</_>
- <_>12 19 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0335600003600121</threshold>
- <left_val>-1.2740780115127563</left_val>
- <right_val>-0.0256730001419783</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 9 -1.</_>
- <_>18 5 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0635429993271828</threshold>
- <left_val>0.1240350008010864</left_val>
- <right_val>-1.0776289701461792</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 9 -1.</_>
- <_>0 5 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0219330005347729</threshold>
- <left_val>0.0149520002305508</left_val>
- <right_val>-0.7102349996566773</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 20 10 -1.</_>
- <_>13 4 10 5 2.</_>
- <_>3 9 10 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0784249976277351</threshold>
- <left_val>0.6203399896621704</left_val>
- <right_val>0.0336109995841980</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 13 9 8 -1.</_>
- <_>5 13 3 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0143900001421571</threshold>
- <left_val>-0.3632459938526154</left_val>
- <right_val>0.1730830073356628</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 1 21 15 -1.</_>
- <_>9 1 7 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0673099979758263</threshold>
- <left_val>0.5237410068511963</left_val>
- <right_val>0.0127999996766448</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 12 14 8 -1.</_>
- <_>12 12 7 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1304749995470047</threshold>
- <left_val>-0.1712249964475632</left_val>
- <right_val>1.1235200166702271</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 12 4 -1.</_>
- <_>6 7 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0462459996342659</threshold>
- <left_val>-1.1908329725265503</left_val>
- <right_val>0.1742559969425201</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 9 6 -1.</_>
- <_>9 5 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0298420004546642</threshold>
- <left_val>0.8393059968948364</left_val>
- <right_val>-0.1806419938802719</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 6 6 -1.</_>
- <_>13 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.8099999073892832e-004</threshold>
- <left_val>0.3553279936313629</left_val>
- <right_val>-0.2384230047464371</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 6 6 -1.</_>
- <_>8 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0223789997398853</threshold>
- <left_val>-0.8794389963150024</left_val>
- <right_val>-7.8399997437372804e-004</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 18 2 -1.</_>
- <_>6 5 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.5569999814033508e-003</threshold>
- <left_val>-0.1425330042839050</left_val>
- <right_val>0.2587620019912720</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 11 -1.</_>
- <_>2 2 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0120130004361272</threshold>
- <left_val>-0.2901549935340881</left_val>
- <right_val>0.2605110108852387</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 0 6 15 -1.</_>
- <_>20 0 2 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0243849996477365</threshold>
- <left_val>-0.0314389988780022</left_val>
- <right_val>0.5869590044021606</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 13 -1.</_>
- <_>2 0 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0471809990704060</threshold>
- <left_val>0.6943010091781616</left_val>
- <right_val>-0.2181610018014908</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 6 9 -1.</_>
- <_>14 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0248939990997314</threshold>
- <left_val>-0.6459929943084717</left_val>
- <right_val>0.1561159938573837</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 6 9 -1.</_>
- <_>8 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0219449996948242</threshold>
- <left_val>-0.0277420002967119</left_val>
- <right_val>-1.1346880197525024</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 4 -1.</_>
- <_>8 2 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1880989968776703</threshold>
- <left_val>-0.0100760003551841</left_val>
- <right_val>1.2429029941558838</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 13 18 4 -1.</_>
- <_>12 13 9 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0778720006346703</threshold>
- <left_val>0.8500800132751465</left_val>
- <right_val>-0.1901549994945526</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 7 10 4 -1.</_>
- <_>9 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0487690009176731</threshold>
- <left_val>-2.0763080120086670</left_val>
- <right_val>0.1217940002679825</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 12 3 -1.</_>
- <_>11 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0171150006353855</threshold>
- <left_val>-0.8568729758262634</left_val>
- <right_val>7.8760003671050072e-003</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 14 19 3 -1.</_>
- <_>4 15 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.7499999850988388e-003</threshold>
- <left_val>0.3864549994468689</left_val>
- <right_val>-0.1139149963855743</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 4 20 -1.</_>
- <_>10 10 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0987939983606339</threshold>
- <left_val>-1.7233899831771851</left_val>
- <right_val>-0.0560630001127720</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 15 9 6 -1.</_>
- <_>8 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0219369996339083</threshold>
- <left_val>0.5474939942359924</left_val>
- <right_val>-0.0424819998443127</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 9 15 4 -1.</_>
- <_>7 9 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0610969997942448</threshold>
- <left_val>-0.0389450006186962</left_val>
- <right_val>-1.0807880163192749</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 4 12 7 -1.</_>
- <_>12 4 4 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0245639998465776</threshold>
- <left_val>0.5831109881401062</left_val>
- <right_val>-9.7599998116493225e-004</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 6 9 -1.</_>
- <_>0 13 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0337520018219948</threshold>
- <left_val>-0.0137959998100996</left_val>
- <right_val>-0.8473029732704163</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 5 6 9 -1.</_>
- <_>18 8 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0381990000605583</threshold>
- <left_val>0.1511429995298386</left_val>
- <right_val>-0.7947340011596680</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 18 16 6 -1.</_>
- <_>0 18 8 3 2.</_>
- <_>8 21 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0201179999858141</threshold>
- <left_val>0.5157909989356995</left_val>
- <right_val>-0.2144539952278137</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 18 14 6 -1.</_>
- <_>16 18 7 3 2.</_>
- <_>9 21 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0247349999845028</threshold>
- <left_val>-0.0221050009131432</left_val>
- <right_val>0.4291769862174988</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 20 20 4 -1.</_>
- <_>1 20 10 2 2.</_>
- <_>11 22 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0243570003658533</threshold>
- <left_val>-0.8620129823684692</left_val>
- <right_val>-3.6760000512003899e-003</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 8 20 6 -1.</_>
- <_>12 8 10 3 2.</_>
- <_>2 11 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0264420006424189</threshold>
- <left_val>-0.4539749920368195</left_val>
- <right_val>0.2246280014514923</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 6 9 -1.</_>
- <_>9 8 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.4429999068379402e-003</threshold>
- <left_val>0.1307300031185150</left_val>
- <right_val>-0.3862270116806030</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 5 12 8 -1.</_>
- <_>12 5 4 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1070170029997826</threshold>
- <left_val>0.1315860003232956</left_val>
- <right_val>-0.7930690050125122</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 5 12 8 -1.</_>
- <_>8 5 4 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0451529994606972</threshold>
- <left_val>-0.2529680132865906</left_val>
- <right_val>0.4067240059375763</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 6 9 -1.</_>
- <_>12 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0443499982357025</threshold>
- <left_val>0.0226130001246929</left_val>
- <right_val>0.7961810231208801</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 6 16 -1.</_>
- <_>4 0 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.0839999886229634e-003</threshold>
- <left_val>-0.3915840089321137</left_val>
- <right_val>0.1163910031318665</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 4 6 12 -1.</_>
- <_>15 8 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0714330002665520</threshold>
- <left_val>0.0824669972062111</left_val>
- <right_val>1.2530590295791626</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 6 12 -1.</_>
- <_>3 8 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0358380004763603</threshold>
- <left_val>-0.1820330023765564</left_val>
- <right_val>0.7707870006561279</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 12 9 6 -1.</_>
- <_>15 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0208390001207590</threshold>
- <left_val>-0.6174439787864685</left_val>
- <right_val>0.1589139997959137</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 15 22 -1.</_>
- <_>4 11 15 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.4252580106258392</threshold>
- <left_val>-0.0489780008792877</left_val>
- <right_val>-1.8422030210494995</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 12 9 6 -1.</_>
- <_>15 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0114080002531409</threshold>
- <left_val>0.1791819930076599</left_val>
- <right_val>-0.1538349986076355</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 9 6 -1.</_>
- <_>0 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0153649998828769</threshold>
- <left_val>-0.8401650190353394</left_val>
- <right_val>-1.0280000278726220e-003</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 15 9 6 -1.</_>
- <_>15 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0152120003476739</threshold>
- <left_val>-0.1899569928646088</left_val>
- <right_val>0.1713099926710129</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 9 6 -1.</_>
- <_>0 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0189720001071692</threshold>
- <left_val>-0.7954199910163879</left_val>
- <right_val>6.6800001077353954e-003</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 8 10 -1.</_>
- <_>14 0 4 5 2.</_>
- <_>10 5 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.3330000005662441e-003</threshold>
- <left_val>-0.2353080064058304</left_val>
- <right_val>0.2473009973764420</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 4 16 -1.</_>
- <_>3 0 2 16 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0932480022311211</threshold>
- <left_val>-0.0547580011188984</left_val>
- <right_val>-1.8324300050735474</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 10 6 -1.</_>
- <_>7 8 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0125550003722310</threshold>
- <left_val>0.2638520002365112</left_val>
- <right_val>-0.3852640092372894</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 12 4 10 -1.</_>
- <_>10 17 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0270700007677078</threshold>
- <left_val>-0.6692979931831360</left_val>
- <right_val>0.0203409995883703</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 4 10 6 -1.</_>
- <_>8 6 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0236770007759333</threshold>
- <left_val>0.6726530194282532</left_val>
- <right_val>-0.0143440002575517</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 22 18 2 -1.</_>
- <_>12 22 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0142750004306436</threshold>
- <left_val>0.3018639981746674</left_val>
- <right_val>-0.2851440012454987</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 11 6 -1.</_>
- <_>7 9 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0280969999730587</threshold>
- <left_val>0.1476600021123886</left_val>
- <right_val>-1.4078520536422729</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 12 10 -1.</_>
- <_>0 0 6 5 2.</_>
- <_>6 5 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0508400015532970</threshold>
- <left_val>-0.1861360073089600</left_val>
- <right_val>0.7995300292968750</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 1 12 6 -1.</_>
- <_>16 1 6 3 2.</_>
- <_>10 4 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0115059996023774</threshold>
- <left_val>0.1911839991807938</left_val>
- <right_val>-0.0850350037217140</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 16 9 4 -1.</_>
- <_>7 18 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0146610001102090</threshold>
- <left_val>0.4523929953575134</left_val>
- <right_val>-0.2220519930124283</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 15 16 -1.</_>
- <_>10 7 5 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2284249961376190</threshold>
- <left_val>0.1348839998245239</left_val>
- <right_val>-1.2894610166549683</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 12 13 -1.</_>
- <_>11 10 6 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1110690012574196</threshold>
- <left_val>-0.2075379937887192</left_val>
- <right_val>0.5456159710884094</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 2 12 6 -1.</_>
- <_>12 2 6 3 2.</_>
- <_>6 5 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.2450000289827585e-003</threshold>
- <left_val>0.3205370008945465</left_val>
- <right_val>-0.1640350073575974</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 12 9 -1.</_>
- <_>3 12 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0853099972009659</threshold>
- <left_val>-0.2021050006151199</left_val>
- <right_val>0.5329679846763611</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 2 8 6 -1.</_>
- <_>16 5 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0220480002462864</threshold>
- <left_val>0.1569859981536865</left_val>
- <right_val>-0.1701409965753555</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 8 6 -1.</_>
- <_>0 5 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0156769994646311</threshold>
- <left_val>-0.6286349892616272</left_val>
- <right_val>0.0407619997859001</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 24 11 -1.</_>
- <_>0 3 12 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.3311290144920349</threshold>
- <left_val>0.1660930067300797</left_val>
- <right_val>-1.0326379537582397</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 8 10 -1.</_>
- <_>0 13 4 5 2.</_>
- <_>4 18 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.8470000773668289e-003</threshold>
- <left_val>-0.2507619857788086</left_val>
- <right_val>0.3166059851646423</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 4 10 -1.</_>
- <_>10 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0460800006985664</threshold>
- <left_val>0.1535210013389587</left_val>
- <right_val>-1.6333500146865845</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 21 -1.</_>
- <_>10 9 4 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0377030000090599</threshold>
- <left_val>0.5687379837036133</left_val>
- <right_val>-0.2010259926319122</right_val></_></_></trees>
- <stage_threshold>-3.5125269889831543</stage_threshold>
- <parent>14</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 16 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 15 9 -1.</_>
- <_>4 7 15 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0818089991807938</threshold>
- <left_val>0.5712479948997498</left_val>
- <right_val>-0.6743879914283752</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 6 -1.</_>
- <_>8 1 8 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2176119983196259</threshold>
- <left_val>-0.3861019909381867</left_val>
- <right_val>0.9034399986267090</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 5 16 -1.</_>
- <_>9 14 5 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0148780001327395</threshold>
- <left_val>0.2224159985780716</left_val>
- <right_val>-1.2779350280761719</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 18 3 -1.</_>
- <_>9 21 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0524349994957447</threshold>
- <left_val>-0.2869040071964264</left_val>
- <right_val>0.7574229836463928</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 3 12 -1.</_>
- <_>6 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.1429995372891426e-003</threshold>
- <left_val>-0.6488040089607239</left_val>
- <right_val>0.2226880043745041</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 4 9 -1.</_>
- <_>11 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.9169999808073044e-003</threshold>
- <left_val>-0.2925359904766083</left_val>
- <right_val>0.3103019893169403</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 9 8 -1.</_>
- <_>8 6 3 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0260840002447367</threshold>
- <left_val>0.4553270041942596</left_val>
- <right_val>-0.3850060105323792</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 20 2 -1.</_>
- <_>4 4 20 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.9400000348687172e-003</threshold>
- <left_val>-0.5126439929008484</left_val>
- <right_val>0.2743229866027832</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 10 18 3 -1.</_>
- <_>8 10 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0571300014853477</threshold>
- <left_val>0.0157880000770092</left_val>
- <right_val>-1.2133100032806396</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 15 10 6 -1.</_>
- <_>7 17 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.1309998854994774e-003</threshold>
- <left_val>0.3917460143566132</left_val>
- <right_val>-0.3086679875850678</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 4 4 18 -1.</_>
- <_>1 4 2 9 2.</_>
- <_>3 13 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0404050014913082</threshold>
- <left_val>1.1901949644088745</left_val>
- <right_val>-0.2034710049629211</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 6 9 -1.</_>
- <_>15 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0202970001846552</threshold>
- <left_val>-0.6823949813842773</left_val>
- <right_val>0.2045869976282120</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 6 9 -1.</_>
- <_>7 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0171889998018742</threshold>
- <left_val>-0.8493989706039429</left_val>
- <right_val>0.0384330004453659</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 6 9 -1.</_>
- <_>13 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0242159999907017</threshold>
- <left_val>-1.1039420366287231</left_val>
- <right_val>0.1597509980201721</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 9 6 -1.</_>
- <_>9 7 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0568690001964569</threshold>
- <left_val>-0.1959529966115952</left_val>
- <right_val>1.1806850433349609</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 18 2 -1.</_>
- <_>3 1 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.6199999158270657e-004</threshold>
- <left_val>-0.4084779918193817</left_val>
- <right_val>0.3293859958648682</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 20 4 -1.</_>
- <_>0 10 10 2 2.</_>
- <_>10 12 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.9790003150701523e-003</threshold>
- <left_val>-0.2967300117015839</left_val>
- <right_val>0.4154790043830872</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 12 -1.</_>
- <_>10 8 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0526250004768372</threshold>
- <left_val>-1.3069299459457397</left_val>
- <right_val>0.1786260008811951</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 6 12 -1.</_>
- <_>6 5 3 6 2.</_>
- <_>9 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0137489996850491</threshold>
- <left_val>0.2366580069065094</left_val>
- <right_val>-0.4453659951686859</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 18 22 -1.</_>
- <_>15 0 9 11 2.</_>
- <_>6 11 9 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0305170007050037</threshold>
- <left_val>0.2901830077171326</left_val>
- <right_val>-0.1121010035276413</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 18 22 -1.</_>
- <_>0 0 9 11 2.</_>
- <_>9 11 9 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.3003750145435333</threshold>
- <left_val>-2.4237680435180664</left_val>
- <right_val>-0.0428309999406338</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 11 -1.</_>
- <_>20 2 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0359909981489182</threshold>
- <left_val>0.8820649981498718</left_val>
- <right_val>-0.0470129996538162</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 11 -1.</_>
- <_>2 2 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0551120005548000</threshold>
- <left_val>0.8011900186538696</left_val>
- <right_val>-0.2049099951982498</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 6 9 -1.</_>
- <_>13 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0337620005011559</threshold>
- <left_val>0.1461759954690933</left_val>
- <right_val>-1.1349489688873291</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 20 3 -1.</_>
- <_>0 1 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.2710003480315208e-003</threshold>
- <left_val>-0.8160489797592163</left_val>
- <right_val>0.0189880002290010</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 20 2 -1.</_>
- <_>2 3 20 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.4399999789893627e-003</threshold>
- <left_val>-0.7098090052604675</left_val>
- <right_val>0.2234369963407517</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 18 2 -1.</_>
- <_>1 11 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.1059999018907547e-003</threshold>
- <left_val>-0.7280859947204590</left_val>
- <right_val>0.0402249991893768</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 7 6 9 -1.</_>
- <_>18 10 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0536519996821880</threshold>
- <left_val>0.1717090010643005</left_val>
- <right_val>-1.1163710355758667</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 22 9 -1.</_>
- <_>0 3 22 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1254139989614487</threshold>
- <left_val>2.7680370807647705</left_val>
- <right_val>-0.1461150050163269</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 3 6 9 -1.</_>
- <_>17 6 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0925420001149178</threshold>
- <left_val>0.1160980015993118</left_val>
- <right_val>-3.9635529518127441</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 6 9 -1.</_>
- <_>0 10 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0385139994323254</threshold>
- <left_val>-7.6399999670684338e-003</left_val>
- <right_val>-0.9878090023994446</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 24 6 -1.</_>
- <_>0 8 24 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.0200000144541264e-003</threshold>
- <left_val>0.2305999994277954</left_val>
- <right_val>-0.7497029900550842</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 10 -1.</_>
- <_>2 2 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.7599998116493225e-003</threshold>
- <left_val>-0.3113799989223480</left_val>
- <right_val>0.3028779923915863</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 6 9 -1.</_>
- <_>12 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0240950006991625</threshold>
- <left_val>-0.0495299994945526</left_val>
- <right_val>0.5269010066986084</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0179820004850626</threshold>
- <left_val>-1.1610640287399292</left_val>
- <right_val>-5.7000000961124897e-003</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 6 9 -1.</_>
- <_>17 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0105550000444055</threshold>
- <left_val>-0.2718909978866577</left_val>
- <right_val>0.2359769940376282</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 6 9 -1.</_>
- <_>5 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.2889998555183411e-003</threshold>
- <left_val>-0.5421910285949707</left_val>
- <right_val>0.0819140002131462</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 6 -1.</_>
- <_>15 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0239390004426241</threshold>
- <left_val>0.1797579973936081</left_val>
- <right_val>-0.6704949736595154</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 18 3 -1.</_>
- <_>0 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0183659996837378</threshold>
- <left_val>0.6266430020332336</left_val>
- <right_val>-0.2097010016441345</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 14 9 6 -1.</_>
- <_>15 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0157159995287657</threshold>
- <left_val>0.2419369965791702</left_val>
- <right_val>-1.0444309711456299</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 23 6 -1.</_>
- <_>0 17 23 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0488040000200272</threshold>
- <left_val>-0.9406059980392456</left_val>
- <right_val>-3.7519999314099550e-003</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 15 18 3 -1.</_>
- <_>5 16 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.7130001261830330e-003</threshold>
- <left_val>-0.0754320025444031</left_val>
- <right_val>0.6157529950141907</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 9 6 -1.</_>
- <_>0 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.7770001739263535e-003</threshold>
- <left_val>0.0392850004136562</left_val>
- <right_val>-0.8481029868125916</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 8 10 -1.</_>
- <_>13 8 4 5 2.</_>
- <_>9 13 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0147449998185039</threshold>
- <left_val>0.1696899980306625</left_val>
- <right_val>-0.5090640187263489</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 15 6 -1.</_>
- <_>8 7 5 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0970790013670921</threshold>
- <left_val>-0.0331030003726482</left_val>
- <right_val>-1.2706379890441895</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 8 10 -1.</_>
- <_>13 8 4 5 2.</_>
- <_>9 13 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0482859984040260</threshold>
- <left_val>0.0943299978971481</left_val>
- <right_val>2.7203190326690674</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 6 12 -1.</_>
- <_>8 0 3 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.7810002043843269e-003</threshold>
- <left_val>-0.3953340053558350</left_val>
- <right_val>0.1536380052566528</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 8 10 -1.</_>
- <_>13 8 4 5 2.</_>
- <_>9 13 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0398939996957779</threshold>
- <left_val>-0.2276740074157715</left_val>
- <right_val>0.1391399949789047</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 5 6 9 -1.</_>
- <_>10 5 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0228480007499456</threshold>
- <left_val>-0.2739199995994568</left_val>
- <right_val>0.3419950008392334</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 18 -1.</_>
- <_>12 6 2 9 2.</_>
- <_>10 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.7179999314248562e-003</threshold>
- <left_val>-0.1087429970502853</left_val>
- <right_val>0.4812540113925934</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 12 4 -1.</_>
- <_>11 7 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0595999993383884</threshold>
- <left_val>-0.0495220012962818</left_val>
- <right_val>-2.0117089748382568</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 8 10 -1.</_>
- <_>13 8 4 5 2.</_>
- <_>9 13 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.9340001791715622e-003</threshold>
- <left_val>0.1503749936819077</left_val>
- <right_val>-0.1127189993858337</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 8 10 -1.</_>
- <_>7 8 4 5 2.</_>
- <_>11 13 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0157570000737906</threshold>
- <left_val>-0.0208850000053644</left_val>
- <right_val>-1.1651979684829712</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 10 6 14 -1.</_>
- <_>14 10 3 7 2.</_>
- <_>11 17 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0496900007128716</threshold>
- <left_val>-0.8021349906921387</left_val>
- <right_val>0.1437229961156845</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 6 19 -1.</_>
- <_>12 5 3 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0523470006883144</threshold>
- <left_val>-0.2083670049905777</left_val>
- <right_val>0.6167759895324707</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 12 12 6 -1.</_>
- <_>12 12 6 3 2.</_>
- <_>6 15 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0224309992045164</threshold>
- <left_val>0.2030590027570725</left_val>
- <right_val>-0.7532619833946228</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 9 18 6 -1.</_>
- <_>1 9 9 3 2.</_>
- <_>10 12 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0411420017480850</threshold>
- <left_val>-0.1811819970607758</left_val>
- <right_val>1.0033359527587891</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 14 8 10 -1.</_>
- <_>20 14 4 5 2.</_>
- <_>16 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0216320008039474</threshold>
- <left_val>0.4999899864196777</left_val>
- <right_val>-0.0346629992127419</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 22 8 -1.</_>
- <_>0 9 11 4 2.</_>
- <_>11 13 11 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0828080028295517</threshold>
- <left_val>1.1711900234222412</left_val>
- <right_val>-0.1843360066413879</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 12 6 -1.</_>
- <_>14 18 6 3 2.</_>
- <_>8 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.5060000419616699e-003</threshold>
- <left_val>-0.0632250010967255</left_val>
- <right_val>0.2902489900588989</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 20 18 -1.</_>
- <_>0 6 10 9 2.</_>
- <_>10 15 10 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0789050012826920</threshold>
- <left_val>-0.2327450066804886</left_val>
- <right_val>0.5969579815864563</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 20 12 -1.</_>
- <_>13 6 10 6 2.</_>
- <_>3 12 10 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0902070030570030</threshold>
- <left_val>-0.8221189975738525</left_val>
- <right_val>0.1777220070362091</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 10 8 -1.</_>
- <_>0 16 5 4 2.</_>
- <_>5 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0292690005153418</threshold>
- <left_val>0.6086069941520691</left_val>
- <right_val>-0.2146890014410019</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 18 3 -1.</_>
- <_>6 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.9499998353421688e-003</threshold>
- <left_val>-0.0426659993827343</left_val>
- <right_val>0.6051210165023804</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 19 3 -1.</_>
- <_>0 12 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.0629996955394745e-003</threshold>
- <left_val>-1.1508270502090454</left_val>
- <right_val>-0.0272860005497932</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 6 6 9 -1.</_>
- <_>14 9 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0195959992706776</threshold>
- <left_val>-9.1880001127719879e-003</left_val>
- <right_val>0.5685780048370361</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 7 22 4 -1.</_>
- <_>1 7 11 2 2.</_>
- <_>12 9 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0148849999532104</threshold>
- <left_val>0.3765879869461060</left_val>
- <right_val>-0.2714950144290924</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 6 7 12 -1.</_>
- <_>13 10 7 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0252170003950596</threshold>
- <left_val>-0.0999910011887550</left_val>
- <right_val>0.2466470003128052</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 11 9 -1.</_>
- <_>4 10 11 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0158559996634722</threshold>
- <left_val>0.6682670116424561</left_val>
- <right_val>-0.2061470001935959</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 10 10 8 -1.</_>
- <_>17 10 5 4 2.</_>
- <_>12 14 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0294410008937120</threshold>
- <left_val>0.1583220064640045</left_val>
- <right_val>-0.7606089711189270</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 9 7 -1.</_>
- <_>5 12 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.5279997438192368e-003</threshold>
- <left_val>0.3821229934692383</left_val>
- <right_val>-0.2540780007839203</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 14 6 9 -1.</_>
- <_>16 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0244219992309809</threshold>
- <left_val>0.1510509997606278</left_val>
- <right_val>-0.2875289916992188</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 12 6 12 -1.</_>
- <_>3 16 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0338869988918304</threshold>
- <left_val>-0.6800280213356018</left_val>
- <right_val>0.0343270003795624</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 6 6 -1.</_>
- <_>14 16 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.0810000132769346e-003</threshold>
- <left_val>0.2541390061378479</left_val>
- <right_val>-0.2685909867286682</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 6 9 -1.</_>
- <_>10 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0303589999675751</threshold>
- <left_val>-0.0308420006185770</left_val>
- <right_val>-1.1476809978485107</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 6 23 -1.</_>
- <_>11 1 2 23 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.0210001170635223e-003</threshold>
- <left_val>-0.3525379896163940</left_val>
- <right_val>0.2986809909343720</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 9 6 -1.</_>
- <_>0 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0276810005307198</threshold>
- <left_val>-0.0381489992141724</left_val>
- <right_val>-1.3262039422988892</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 17 18 3 -1.</_>
- <_>4 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.9039996489882469e-003</threshold>
- <left_val>-0.0237370003014803</left_val>
- <right_val>0.7050300240516663</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 13 14 -1.</_>
- <_>5 9 13 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0440310016274452</threshold>
- <left_val>0.1067489981651306</left_val>
- <right_val>-0.4526120126247406</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 8 12 -1.</_>
- <_>19 0 4 6 2.</_>
- <_>15 6 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0323709994554520</threshold>
- <left_val>0.4667490124702454</left_val>
- <right_val>-0.0615469999611378</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 8 12 -1.</_>
- <_>0 0 4 6 2.</_>
- <_>4 6 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0209330003708601</threshold>
- <left_val>-0.2844789922237396</left_val>
- <right_val>0.4384559988975525</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 8 7 -1.</_>
- <_>8 2 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0252279993146658</threshold>
- <left_val>-0.0225370004773140</left_val>
- <right_val>0.7038909792900085</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 6 9 -1.</_>
- <_>3 1 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.5520000644028187e-003</threshold>
- <left_val>-0.3255490064620972</left_val>
- <right_val>0.2402369976043701</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 8 6 12 -1.</_>
- <_>17 8 3 6 2.</_>
- <_>14 14 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0585579983890057</threshold>
- <left_val>-1.2227720022201538</left_val>
- <right_val>0.1166879981756210</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 8 6 12 -1.</_>
- <_>4 8 3 6 2.</_>
- <_>7 14 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0318999998271465</threshold>
- <left_val>-0.0193050000816584</left_val>
- <right_val>-1.0973169803619385</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 5 5 15 -1.</_>
- <_>16 10 5 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0304450001567602</threshold>
- <left_val>0.6558250188827515</left_val>
- <right_val>0.0750909969210625</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 5 15 -1.</_>
- <_>3 10 5 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0149330003187060</threshold>
- <left_val>-0.5215579867362976</left_val>
- <right_val>0.1152309998869896</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 4 6 9 -1.</_>
- <_>18 7 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0490080006420612</threshold>
- <left_val>-0.7830399870872498</left_val>
- <right_val>0.1665720045566559</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 7 6 15 -1.</_>
- <_>1 12 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0831589996814728</threshold>
- <left_val>-2.6879999786615372e-003</left_val>
- <right_val>-0.8528230190277100</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 15 12 8 -1.</_>
- <_>17 15 6 4 2.</_>
- <_>11 19 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0239029992371798</threshold>
- <left_val>-0.0510109998285770</left_val>
- <right_val>0.4199909865856171</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 4 -1.</_>
- <_>0 2 12 2 2.</_>
- <_>12 4 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0164289996027946</threshold>
- <left_val>0.0192329995334148</left_val>
- <right_val>-0.6504909992218018</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 1 2 19 -1.</_>
- <_>15 1 1 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0118380002677441</threshold>
- <left_val>-0.6240980029106140</left_val>
- <right_val>0.1541119962930679</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 2 19 -1.</_>
- <_>8 1 1 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.6799999866634607e-004</threshold>
- <left_val>0.1758919954299927</left_val>
- <right_val>-0.3433870077133179</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>22 1 2 20 -1.</_>
- <_>22 1 1 20 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0191939994692802</threshold>
- <left_val>0.0434189997613430</left_val>
- <right_val>0.7906919717788696</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 2 20 -1.</_>
- <_>1 1 1 20 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0100320000201464</threshold>
- <left_val>0.4564889967441559</left_val>
- <right_val>-0.2249480038881302</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 11 6 12 -1.</_>
- <_>20 11 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0140040004625916</threshold>
- <left_val>0.3357099890708923</left_val>
- <right_val>-4.8799999058246613e-003</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 6 12 -1.</_>
- <_>2 11 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1031989976763725</threshold>
- <left_val>-2.3378000259399414</left_val>
- <right_val>-0.0589330010116100</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 14 -1.</_>
- <_>3 13 18 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0956970006227493</threshold>
- <left_val>-0.6615390181541443</left_val>
- <right_val>0.2009859979152679</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 10 7 8 -1.</_>
- <_>6 14 7 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0414809994399548</threshold>
- <left_val>0.4593920111656189</left_val>
- <right_val>-0.2231409996747971</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 9 12 12 -1.</_>
- <_>7 13 12 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.4099999573081732e-003</threshold>
- <left_val>-0.2689859867095947</left_val>
- <right_val>0.2492299973964691</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 18 18 5 -1.</_>
- <_>11 18 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1072499975562096</threshold>
- <left_val>-0.1864019930362701</left_val>
- <right_val>0.7276980280876160</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 21 20 3 -1.</_>
- <_>4 22 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.1870000530034304e-003</threshold>
- <left_val>-0.0246089994907379</left_val>
- <right_val>0.2864390015602112</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 12 -1.</_>
- <_>9 12 3 6 2.</_>
- <_>12 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0291670002043247</threshold>
- <left_val>-0.0346830002963543</left_val>
- <right_val>-1.1162580251693726</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 18 3 -1.</_>
- <_>4 7 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0112870000302792</threshold>
- <left_val>6.3760001212358475e-003</left_val>
- <right_val>0.6663209795951843</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 3 -1.</_>
- <_>3 7 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0120010003447533</threshold>
- <left_val>0.4242010116577148</left_val>
- <right_val>-0.2627980113029480</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 4 6 9 -1.</_>
- <_>18 7 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0126959998160601</threshold>
- <left_val>-0.0219570007175207</left_val>
- <right_val>0.1893679946660996</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 9 6 -1.</_>
- <_>2 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0245970003306866</threshold>
- <left_val>-0.0349639989435673</left_val>
- <right_val>-1.0989320278167725</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 14 18 4 -1.</_>
- <_>13 14 9 2 2.</_>
- <_>4 16 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0459530018270016</threshold>
- <left_val>0.1110979989171028</left_val>
- <right_val>-2.9306049346923828</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 6 14 -1.</_>
- <_>7 7 3 7 2.</_>
- <_>10 14 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0272410009056330</threshold>
- <left_val>0.2910169959068298</left_val>
- <right_val>-0.2740789949893951</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 13 12 6 -1.</_>
- <_>13 13 6 3 2.</_>
- <_>7 16 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0400639995932579</threshold>
- <left_val>0.1187790036201477</left_val>
- <right_val>-0.6280180215835571</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 12 9 -1.</_>
- <_>10 7 4 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0230550002306700</threshold>
- <left_val>0.1481380015611649</left_val>
- <right_val>-0.3700749874114990</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 12 6 6 -1.</_>
- <_>12 12 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0237370003014803</threshold>
- <left_val>-0.5372480154037476</left_val>
- <right_val>0.1935819983482361</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 4 10 -1.</_>
- <_>0 7 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0775220021605492</threshold>
- <left_val>-0.0601940006017685</left_val>
- <right_val>-1.9489669799804688</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 9 6 -1.</_>
- <_>11 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0133450003340840</threshold>
- <left_val>-0.4522959887981415</left_val>
- <right_val>0.1874150037765503</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 9 12 6 -1.</_>
- <_>2 12 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0217199996113777</threshold>
- <left_val>1.2144249677658081</left_val>
- <right_val>-0.1536580026149750</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 10 6 9 -1.</_>
- <_>13 13 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0714749991893768</threshold>
- <left_val>-2.3047130107879639</left_val>
- <right_val>0.1099990010261536</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 6 9 -1.</_>
- <_>5 13 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.4999999701976776e-003</threshold>
- <left_val>-0.7185519933700562</left_val>
- <right_val>0.0201009996235371</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 15 9 6 -1.</_>
- <_>9 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0267409998923540</threshold>
- <left_val>0.0735450014472008</left_val>
- <right_val>0.9878600239753723</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 16 12 6 -1.</_>
- <_>5 19 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0394079983234406</threshold>
- <left_val>-1.2227380275726318</left_val>
- <right_val>-0.0435069985687733</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 20 3 -1.</_>
- <_>3 3 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0258889999240637</threshold>
- <left_val>0.1340930014848709</left_val>
- <right_val>-1.1770780086517334</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 12 6 -1.</_>
- <_>6 5 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0489250011742115</threshold>
- <left_val>-0.0308100003749132</left_val>
- <right_val>-0.9347950220108032</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 3 24 -1.</_>
- <_>12 0 1 24 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0368929989635944</threshold>
- <left_val>0.1333370059728622</left_val>
- <right_val>-1.4998290538787842</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 16 15 4 -1.</_>
- <_>8 16 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0789299979805946</threshold>
- <left_val>-0.1453880071640015</left_val>
- <right_val>1.5631790161132813</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 12 -1.</_>
- <_>9 18 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0290060006082058</threshold>
- <left_val>0.1938370019197464</left_val>
- <right_val>-0.6764280200004578</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 15 12 8 -1.</_>
- <_>1 15 6 4 2.</_>
- <_>7 19 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.3089998438954353e-003</threshold>
- <left_val>-0.3746539950370789</left_val>
- <right_val>0.1085750013589859</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 10 8 14 -1.</_>
- <_>19 10 4 7 2.</_>
- <_>15 17 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0658309981226921</threshold>
- <left_val>0.8105940222740173</left_val>
- <right_val>0.0302019994705915</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 9 8 14 -1.</_>
- <_>1 9 4 7 2.</_>
- <_>5 16 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0689650028944016</threshold>
- <left_val>0.8377259969711304</left_val>
- <right_val>-0.1714099943637848</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 11 9 10 -1.</_>
- <_>9 16 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1166910007596016</threshold>
- <left_val>-0.9464719891548157</left_val>
- <right_val>0.1312319934368134</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 12 6 -1.</_>
- <_>6 9 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.3060000492259860e-003</threshold>
- <left_val>0.0460079982876778</left_val>
- <right_val>-0.5201159715652466</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 15 6 9 -1.</_>
- <_>12 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0445589981973171</threshold>
- <left_val>-1.9423669576644897</left_val>
- <right_val>0.1320070028305054</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 9 7 -1.</_>
- <_>10 8 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0510330013930798</threshold>
- <left_val>-0.2148099988698959</left_val>
- <right_val>0.4867390096187592</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 4 8 10 -1.</_>
- <_>14 4 4 5 2.</_>
- <_>10 9 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0315780006349087</threshold>
- <left_val>0.5998979806900024</left_val>
- <right_val>7.9159997403621674e-003</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 6 9 -1.</_>
- <_>4 9 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0210200008004904</threshold>
- <left_val>-0.2206950038671494</left_val>
- <right_val>0.5404620170593262</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 24 12 -1.</_>
- <_>8 6 8 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1382420063018799</threshold>
- <left_val>0.6295750141143799</left_val>
- <right_val>-0.0217129997909069</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 6 14 -1.</_>
- <_>6 7 3 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0522289983928204</threshold>
- <left_val>-0.2336090058088303</left_val>
- <right_val>0.4976080060005188</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 8 5 8 -1.</_>
- <_>19 12 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0258840005844831</threshold>
- <left_val>0.1804199963808060</left_val>
- <right_val>-0.2203920036554337</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 5 8 -1.</_>
- <_>0 12 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0121389999985695</threshold>
- <left_val>-0.6973189711570740</left_val>
- <right_val>0.0157120004296303</right_val></_></_>
- <_>
- <!-- tree 137 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 3 6 6 -1.</_>
- <_>17 6 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0242379996925592</threshold>
- <left_val>0.3459329903125763</left_val>
- <right_val>0.0714699998497963</right_val></_></_>
- <_>
- <!-- tree 138 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 3 6 6 -1.</_>
- <_>1 6 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0252720005810261</threshold>
- <left_val>-0.8758329749107361</left_val>
- <right_val>-9.8240002989768982e-003</right_val></_></_>
- <_>
- <!-- tree 139 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 9 -1.</_>
- <_>18 5 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0125970002263784</threshold>
- <left_val>0.2364999949932098</left_val>
- <right_val>-0.2873120009899139</right_val></_></_>
- <_>
- <!-- tree 140 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 9 -1.</_>
- <_>0 5 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0573309995234013</threshold>
- <left_val>-0.0615309998393059</left_val>
- <right_val>-2.2326040267944336</right_val></_></_>
- <_>
- <!-- tree 141 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 3 18 6 -1.</_>
- <_>3 5 18 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0166710000485182</threshold>
- <left_val>-0.1985010057687759</left_val>
- <right_val>0.4081070125102997</right_val></_></_>
- <_>
- <!-- tree 142 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 3 9 6 -1.</_>
- <_>2 5 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0228189993649721</threshold>
- <left_val>0.9648759961128235</left_val>
- <right_val>-0.2024569958448410</right_val></_></_>
- <_>
- <!-- tree 143 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 3 10 8 -1.</_>
- <_>14 3 5 4 2.</_>
- <_>9 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.7000001611886546e-005</threshold>
- <left_val>-0.0589089989662170</left_val>
- <right_val>0.2705540060997009</right_val></_></_>
- <_>
- <!-- tree 144 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 3 10 8 -1.</_>
- <_>5 3 5 4 2.</_>
- <_>10 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.6700001955032349e-003</threshold>
- <left_val>-0.4531710147857666</left_val>
- <right_val>0.0896280035376549</right_val></_></_>
- <_>
- <!-- tree 145 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 11 6 12 -1.</_>
- <_>10 11 3 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0940859988331795</threshold>
- <left_val>0.1160459965467453</left_val>
- <right_val>-1.0951169729232788</right_val></_></_>
- <_>
- <!-- tree 146 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 11 6 11 -1.</_>
- <_>11 11 3 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0622670017182827</threshold>
- <left_val>1.8096530437469482</left_val>
- <right_val>-0.1477320045232773</right_val></_></_>
- <_>
- <!-- tree 147 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 10 4 -1.</_>
- <_>7 8 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0174160003662109</threshold>
- <left_val>0.2306820005178452</left_val>
- <right_val>-0.4241760075092316</right_val></_></_>
- <_>
- <!-- tree 148 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 7 -1.</_>
- <_>12 6 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0220660008490086</threshold>
- <left_val>0.4927029907703400</left_val>
- <right_val>-0.2063090056180954</right_val></_></_>
- <_>
- <!-- tree 149 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 18 18 3 -1.</_>
- <_>5 19 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0104040000587702</threshold>
- <left_val>0.6092429757118225</left_val>
- <right_val>0.0281300004571676</right_val></_></_>
- <_>
- <!-- tree 150 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 4 6 9 -1.</_>
- <_>10 4 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.3670003116130829e-003</threshold>
- <left_val>0.4017120003700256</left_val>
- <right_val>-0.2168170064687729</right_val></_></_>
- <_>
- <!-- tree 151 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 9 7 -1.</_>
- <_>11 1 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0290399994701147</threshold>
- <left_val>-0.8487650156021118</left_val>
- <right_val>0.1424680054187775</right_val></_></_>
- <_>
- <!-- tree 152 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 6 6 -1.</_>
- <_>9 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0210619997233152</threshold>
- <left_val>-0.7919830083847046</left_val>
- <right_val>-0.0125959999859333</right_val></_></_>
- <_>
- <!-- tree 153 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 12 4 11 -1.</_>
- <_>14 12 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0370009988546371</threshold>
- <left_val>-0.6748890280723572</left_val>
- <right_val>0.1283040046691895</right_val></_></_>
- <_>
- <!-- tree 154 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 12 4 11 -1.</_>
- <_>8 12 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0107359997928143</threshold>
- <left_val>0.0367799997329712</left_val>
- <right_val>-0.6339300274848938</right_val></_></_>
- <_>
- <!-- tree 155 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 12 18 -1.</_>
- <_>12 0 4 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1636759936809540</threshold>
- <left_val>0.1380389928817749</left_val>
- <right_val>-0.4718900024890900</right_val></_></_>
- <_>
- <!-- tree 156 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 10 5 -1.</_>
- <_>7 12 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0949179977178574</threshold>
- <left_val>-0.1385570019483566</left_val>
- <right_val>1.9492419958114624</right_val></_></_>
- <_>
- <!-- tree 157 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 20 22 3 -1.</_>
- <_>2 21 22 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0352619998157024</threshold>
- <left_val>0.1372189968824387</left_val>
- <right_val>-2.1186530590057373</right_val></_></_>
- <_>
- <!-- tree 158 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 2 20 -1.</_>
- <_>1 4 1 20 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0128110004588962</threshold>
- <left_val>-0.2000810056924820</left_val>
- <right_val>0.4950779974460602</right_val></_></_></trees>
- <stage_threshold>-3.5939640998840332</stage_threshold>
- <parent>15</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 17 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 4 -1.</_>
- <_>8 2 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1390440016984940</threshold>
- <left_val>-0.4658119976520538</left_val>
- <right_val>0.7643160223960877</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 10 4 -1.</_>
- <_>7 10 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0119169997051358</threshold>
- <left_val>-0.9439899921417236</left_val>
- <right_val>0.3972629904747009</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 8 10 -1.</_>
- <_>6 7 4 5 2.</_>
- <_>10 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0100069995969534</threshold>
- <left_val>0.3271879851818085</left_val>
- <right_val>-0.6336740255355835</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 6 14 -1.</_>
- <_>17 0 3 7 2.</_>
- <_>14 7 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.0479999519884586e-003</threshold>
- <left_val>0.2742789983749390</left_val>
- <right_val>-0.5744699835777283</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 11 5 8 -1.</_>
- <_>4 15 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.2489999644458294e-003</threshold>
- <left_val>0.2362930029630661</left_val>
- <right_val>-0.6859350204467773</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 20 9 -1.</_>
- <_>2 3 20 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0323820002377033</threshold>
- <left_val>-0.5763019919395447</left_val>
- <right_val>0.2749269902706146</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 12 8 -1.</_>
- <_>6 7 6 4 2.</_>
- <_>12 11 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0139579996466637</threshold>
- <left_val>-0.6106150150299072</left_val>
- <right_val>0.2454160004854202</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 17 6 6 -1.</_>
- <_>9 20 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.1159999994561076e-003</threshold>
- <left_val>-0.5653910040855408</left_val>
- <right_val>0.2717930078506470</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 10 10 4 -1.</_>
- <_>7 12 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.7000000045518391e-005</threshold>
- <left_val>-0.8023599982261658</left_val>
- <right_val>0.1150910034775734</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 12 9 -1.</_>
- <_>10 5 4 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.5700000696815550e-004</threshold>
- <left_val>-0.8120589852333069</left_val>
- <right_val>0.2384469956159592</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 6 8 -1.</_>
- <_>8 11 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.0460000745952129e-003</threshold>
- <left_val>0.1390960067510605</left_val>
- <right_val>-0.6616320013999939</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 4 4 17 -1.</_>
- <_>18 4 2 17 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0143560003489256</threshold>
- <left_val>-0.1648519933223724</left_val>
- <right_val>0.4190169870853424</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 6 -1.</_>
- <_>3 0 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0553749985992908</threshold>
- <left_val>1.4425870180130005</left_val>
- <right_val>-0.1882019937038422</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 4 4 17 -1.</_>
- <_>18 4 2 17 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0935949981212616</threshold>
- <left_val>0.1354829967021942</left_val>
- <right_val>-0.9163609743118286</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 4 4 17 -1.</_>
- <_>4 4 2 17 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0266249999403954</threshold>
- <left_val>-0.3374829888343811</left_val>
- <right_val>0.3923360109329224</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 18 19 3 -1.</_>
- <_>5 19 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.7469998933374882e-003</threshold>
- <left_val>-0.1161540001630783</left_val>
- <right_val>0.4439930021762848</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 2 18 -1.</_>
- <_>11 9 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0318860001862049</threshold>
- <left_val>-0.9949830174446106</left_val>
- <right_val>1.6120000509545207e-003</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 4 2 18 -1.</_>
- <_>15 13 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0226000007241964</threshold>
- <left_val>-0.4806739985942841</left_val>
- <right_val>0.1700730025768280</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 4 2 18 -1.</_>
- <_>7 13 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0252020005136728</threshold>
- <left_val>0.0355800017714500</left_val>
- <right_val>-0.8021540045738220</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 11 10 8 -1.</_>
- <_>12 11 5 4 2.</_>
- <_>7 15 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0310369990766048</threshold>
- <left_val>-1.0895340442657471</left_val>
- <right_val>0.1808190047740936</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 9 -1.</_>
- <_>12 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0264759995043278</threshold>
- <left_val>0.9567120075225830</left_val>
- <right_val>-0.2104939967393875</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 6 9 -1.</_>
- <_>12 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0138539997860789</threshold>
- <left_val>-1.0370320081710815</left_val>
- <right_val>0.2216670066118240</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 9 16 8 -1.</_>
- <_>2 9 8 4 2.</_>
- <_>10 13 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0629250034689903</threshold>
- <left_val>0.9019939899444580</left_val>
- <right_val>-0.1908529996871948</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 6 9 -1.</_>
- <_>14 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0447509996592999</threshold>
- <left_val>-1.0119110345840454</left_val>
- <right_val>0.1469119936227799</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 6 9 -1.</_>
- <_>10 7 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0204280000180006</threshold>
- <left_val>0.6162449717521668</left_val>
- <right_val>-0.2355269938707352</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 6 9 -1.</_>
- <_>14 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.0329999327659607e-003</threshold>
- <left_val>-0.0832799971103668</left_val>
- <right_val>0.2172870039939880</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 12 12 6 -1.</_>
- <_>3 14 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.7280003353953362e-003</threshold>
- <left_val>0.0654589980840683</left_val>
- <right_val>-0.6031870245933533</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 12 9 6 -1.</_>
- <_>14 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0272020008414984</threshold>
- <left_val>-0.9344739913940430</left_val>
- <right_val>0.1527000069618225</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 12 9 6 -1.</_>
- <_>1 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0164710003882647</threshold>
- <left_val>-0.8417710065841675</left_val>
- <right_val>0.0133320000022650</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 18 3 -1.</_>
- <_>3 8 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0137440003454685</threshold>
- <left_val>0.6056720018386841</left_val>
- <right_val>-0.0920210033655167</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 7 22 6 -1.</_>
- <_>1 9 22 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0291649997234344</threshold>
- <left_val>-0.0281140003353357</left_val>
- <right_val>-1.4014569520950317</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 4 6 6 -1.</_>
- <_>18 7 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0374570004642010</threshold>
- <left_val>0.1308059990406036</left_val>
- <right_val>-0.4938249886035919</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 6 6 -1.</_>
- <_>0 7 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0250700004398823</threshold>
- <left_val>-1.1289390325546265</left_val>
- <right_val>-0.0146000003442168</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 16 6 -1.</_>
- <_>5 14 16 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0638120025396347</threshold>
- <left_val>0.7587159872055054</left_val>
- <right_val>-1.8200000049546361e-003</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 9 4 -1.</_>
- <_>6 18 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.3900002539157867e-003</threshold>
- <left_val>0.2993640005588532</left_val>
- <right_val>-0.2948780059814453</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 6 9 -1.</_>
- <_>14 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.6000002445653081e-004</threshold>
- <left_val>0.0197250004857779</left_val>
- <right_val>0.1999389976263046</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 15 6 9 -1.</_>
- <_>4 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0217409990727901</threshold>
- <left_val>-0.8524789810180664</left_val>
- <right_val>0.0491699986159801</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 1 6 23 -1.</_>
- <_>17 1 2 23 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0178699996322393</threshold>
- <left_val>-0.0599859990179539</left_val>
- <right_val>0.1522250026464462</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 21 24 3 -1.</_>
- <_>8 21 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0248310007154942</threshold>
- <left_val>0.3560340106487274</left_val>
- <right_val>-0.2625989913940430</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 20 24 4 -1.</_>
- <_>8 20 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1571550071239471</threshold>
- <left_val>1.5599999460391700e-004</left_val>
- <right_val>1.0428730249404907</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 6 23 -1.</_>
- <_>5 1 2 23 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0690269991755486</threshold>
- <left_val>-0.0330069996416569</left_val>
- <right_val>-1.1796669960021973</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 17 18 3 -1.</_>
- <_>3 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0110219996422529</threshold>
- <left_val>0.5898770093917847</left_val>
- <right_val>-0.0576479993760586</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 18 3 -1.</_>
- <_>0 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0138349998742342</threshold>
- <left_val>0.5950279831886292</left_val>
- <right_val>-0.2441859990358353</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 16 22 4 -1.</_>
- <_>12 16 11 2 2.</_>
- <_>1 18 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0309410002082586</threshold>
- <left_val>-1.1723799705505371</left_val>
- <right_val>0.1690700054168701</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 9 6 -1.</_>
- <_>0 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0212580002844334</threshold>
- <left_val>-0.0189009997993708</left_val>
- <right_val>-1.0684759616851807</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 10 21 3 -1.</_>
- <_>9 10 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0930799990892410</threshold>
- <left_val>0.1630560010671616</left_val>
- <right_val>-1.3375270366668701</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 18 12 6 -1.</_>
- <_>2 18 6 3 2.</_>
- <_>8 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0296359993517399</threshold>
- <left_val>-0.2252479940652847</left_val>
- <right_val>0.4540010094642639</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 24 4 -1.</_>
- <_>0 7 24 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.2199999764561653e-004</threshold>
- <left_val>0.2740910053253174</left_val>
- <right_val>-0.3737139999866486</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 15 -1.</_>
- <_>10 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0420980006456375</threshold>
- <left_val>-0.7582880258560181</left_val>
- <right_val>0.0171370003372431</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 6 12 -1.</_>
- <_>10 13 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0225050002336502</threshold>
- <left_val>-0.2275930047035217</left_val>
- <right_val>0.2369869947433472</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 6 9 -1.</_>
- <_>8 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0128629999235272</threshold>
- <left_val>0.1925240010023117</left_val>
- <right_val>-0.3212710022926331</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 6 9 -1.</_>
- <_>13 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0278600007295609</threshold>
- <left_val>0.1672369986772537</left_val>
- <right_val>-1.0209059715270996</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 7 6 9 -1.</_>
- <_>11 7 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0278079994022846</threshold>
- <left_val>1.2824759483337402</left_val>
- <right_val>-0.1722529977560043</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 1 20 3 -1.</_>
- <_>2 2 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.1630001291632652e-003</threshold>
- <left_val>-0.5407289862632752</left_val>
- <right_val>0.2388570010662079</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 18 12 6 -1.</_>
- <_>1 18 6 3 2.</_>
- <_>7 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0204360000789166</threshold>
- <left_val>0.6335539817810059</left_val>
- <right_val>-0.2109059989452362</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 2 4 13 -1.</_>
- <_>13 2 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0123079996556044</threshold>
- <left_val>-0.4977819919586182</left_val>
- <right_val>0.1740259975194931</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 12 4 -1.</_>
- <_>12 7 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0404939986765385</threshold>
- <left_val>-1.1848740577697754</left_val>
- <right_val>-0.0338909998536110</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 1 4 13 -1.</_>
- <_>10 1 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0296570006757975</threshold>
- <left_val>0.0217409990727901</left_val>
- <right_val>1.0069919824600220</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 3 18 -1.</_>
- <_>7 0 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.8379999138414860e-003</threshold>
- <left_val>0.0292179994285107</left_val>
- <right_val>-0.5990629792213440</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 3 10 5 -1.</_>
- <_>14 3 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0161649994552135</threshold>
- <left_val>-0.2100079953670502</left_val>
- <right_val>0.3763729929924011</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 15 12 8 -1.</_>
- <_>10 15 4 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0501930005848408</threshold>
- <left_val>2.5319999549537897e-003</left_val>
- <right_val>-0.7166820168495178</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 10 6 9 -1.</_>
- <_>11 10 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.9680000841617584e-003</threshold>
- <left_val>-0.2192140072584152</left_val>
- <right_val>0.3229869902133942</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 3 4 9 -1.</_>
- <_>10 3 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0249799992889166</threshold>
- <left_val>-9.6840001642704010e-003</left_val>
- <right_val>-0.7757290005683899</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 0 6 14 -1.</_>
- <_>20 0 3 7 2.</_>
- <_>17 7 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0158099997788668</threshold>
- <left_val>0.4463750123977661</left_val>
- <right_val>-0.0617600008845329</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 6 14 -1.</_>
- <_>1 0 3 7 2.</_>
- <_>4 7 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0372069999575615</threshold>
- <left_val>-0.2049539983272553</left_val>
- <right_val>0.5772219896316528</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 6 16 -1.</_>
- <_>17 0 3 8 2.</_>
- <_>14 8 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0792649984359741</threshold>
- <left_val>-0.7674540281295776</left_val>
- <right_val>0.1255040019750595</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 4 4 10 -1.</_>
- <_>9 4 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0171520002186298</threshold>
- <left_val>-1.4121830463409424</left_val>
- <right_val>-0.0517040006816387</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 17 18 6 -1.</_>
- <_>12 17 9 3 2.</_>
- <_>3 20 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0327400006353855</threshold>
- <left_val>0.1933400034904480</left_val>
- <right_val>-0.6363369822502136</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 20 22 4 -1.</_>
- <_>12 20 11 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1175699979066849</threshold>
- <left_val>0.8432540297508240</left_val>
- <right_val>-0.1801860034465790</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 3 10 5 -1.</_>
- <_>14 3 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1205720007419586</threshold>
- <left_val>0.1253000050783157</left_val>
- <right_val>-2.1213600635528564</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 10 5 -1.</_>
- <_>5 3 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.2779999785125256e-003</threshold>
- <left_val>-0.4660440087318420</left_val>
- <right_val>0.0896439999341965</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 12 16 -1.</_>
- <_>16 6 4 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0725449994206429</threshold>
- <left_val>0.5182650089263916</left_val>
- <right_val>0.0168239995837212</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 12 16 -1.</_>
- <_>4 6 4 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1771059930324554</threshold>
- <left_val>-0.0309100002050400</left_val>
- <right_val>-1.1046639680862427</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 9 5 15 -1.</_>
- <_>10 14 5 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.4229996427893639e-003</threshold>
- <left_val>0.2444580048322678</left_val>
- <right_val>-0.3861309885978699</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 18 21 2 -1.</_>
- <_>1 19 21 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0130350003018975</threshold>
- <left_val>0.9800440073013306</left_val>
- <right_val>-0.1701650023460388</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 9 6 -1.</_>
- <_>15 2 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0189120005816221</threshold>
- <left_val>0.2024849951267242</left_val>
- <right_val>-0.3854590058326721</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 12 4 -1.</_>
- <_>12 1 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0214479994028807</threshold>
- <left_val>-0.2571719884872437</left_val>
- <right_val>0.3518120050430298</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 12 12 -1.</_>
- <_>12 0 6 6 2.</_>
- <_>6 6 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0633570030331612</threshold>
- <left_val>0.1699479967355728</left_val>
- <right_val>-0.9138380289077759</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 10 8 12 -1.</_>
- <_>8 10 4 6 2.</_>
- <_>12 16 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0324359983205795</threshold>
- <left_val>-0.8568159937858582</left_val>
- <right_val>-0.0216809995472431</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 16 10 8 -1.</_>
- <_>19 16 5 4 2.</_>
- <_>14 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0235649999231100</threshold>
- <left_val>0.5611559748649597</left_val>
- <right_val>-2.2400000307243317e-004</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 10 8 -1.</_>
- <_>0 16 5 4 2.</_>
- <_>5 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0187890008091927</threshold>
- <left_val>-0.2545979917049408</left_val>
- <right_val>0.3451290130615234</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 12 12 5 -1.</_>
- <_>14 12 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0310420002788305</threshold>
- <left_val>7.5719999149441719e-003</left_val>
- <right_val>0.3480019867420197</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 10 8 -1.</_>
- <_>6 16 5 4 2.</_>
- <_>11 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0112269995734096</threshold>
- <left_val>-0.6021980047225952</left_val>
- <right_val>0.0428149998188019</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 12 6 -1.</_>
- <_>13 6 6 3 2.</_>
- <_>7 9 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0128459995612502</threshold>
- <left_val>0.4202040135860443</left_val>
- <right_val>-0.0538010001182556</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 4 18 -1.</_>
- <_>9 6 2 9 2.</_>
- <_>11 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0127919996157289</threshold>
- <left_val>0.2272450029850006</left_val>
- <right_val>-0.3239800035953522</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 9 6 14 -1.</_>
- <_>13 9 3 7 2.</_>
- <_>10 16 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0686519965529442</threshold>
- <left_val>0.0935320034623146</left_val>
- <right_val>10.</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 9 6 14 -1.</_>
- <_>8 9 3 7 2.</_>
- <_>11 16 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.2789999172091484e-003</threshold>
- <left_val>-0.2692629992961884</left_val>
- <right_val>0.3330320119857788</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 4 11 12 -1.</_>
- <_>7 10 11 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0387790016829968</threshold>
- <left_val>-0.7236530184745789</left_val>
- <right_val>0.1780650019645691</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 8 6 16 -1.</_>
- <_>4 8 3 8 2.</_>
- <_>7 16 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.1820000410079956e-003</threshold>
- <left_val>-0.3511939942836762</left_val>
- <right_val>0.1658630073070526</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 3 4 21 -1.</_>
- <_>17 10 4 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1751520037651062</threshold>
- <left_val>0.1162310019135475</left_val>
- <right_val>-1.5419290065765381</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 3 4 21 -1.</_>
- <_>3 10 4 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1162799969315529</threshold>
- <left_val>-9.1479998081922531e-003</left_val>
- <right_val>-0.9984260201454163</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 1 8 18 -1.</_>
- <_>14 1 4 9 2.</_>
- <_>10 10 4 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0229640007019043</threshold>
- <left_val>0.2056539952754974</left_val>
- <right_val>0.0154320001602173</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 16 8 -1.</_>
- <_>2 5 8 4 2.</_>
- <_>10 9 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0514100007712841</threshold>
- <left_val>0.5807240009307861</left_val>
- <right_val>-0.2011840045452118</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 12 -1.</_>
- <_>3 10 18 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2247419953346252</threshold>
- <left_val>0.0187289994210005</left_val>
- <right_val>1.0829299688339233</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 10 16 12 -1.</_>
- <_>4 14 16 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.4860000535845757e-003</threshold>
- <left_val>-0.3317129909992218</left_val>
- <right_val>0.1990299969911575</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 4 8 20 -1.</_>
- <_>19 4 4 10 2.</_>
- <_>15 14 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1184630021452904</threshold>
- <left_val>1.3711010217666626</left_val>
- <right_val>0.0689269974827766</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 2 9 6 -1.</_>
- <_>10 2 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0378109999001026</threshold>
- <left_val>-9.3600002583116293e-004</left_val>
- <right_val>-0.8399699926376343</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 4 8 20 -1.</_>
- <_>19 4 4 10 2.</_>
- <_>15 14 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0222020000219345</threshold>
- <left_val>-0.0119639998301864</left_val>
- <right_val>0.3667399883270264</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 4 8 20 -1.</_>
- <_>1 4 4 10 2.</_>
- <_>5 14 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0363660007715225</threshold>
- <left_val>0.3786650002002716</left_val>
- <right_val>-0.2771480083465576</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 8 8 14 -1.</_>
- <_>15 8 4 7 2.</_>
- <_>11 15 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1318469941616058</threshold>
- <left_val>-2.7481179237365723</left_val>
- <right_val>0.1066690012812614</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 8 14 -1.</_>
- <_>5 8 4 7 2.</_>
- <_>9 15 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0416559986770153</threshold>
- <left_val>0.4752430021762848</left_val>
- <right_val>-0.2324980050325394</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 13 5 8 -1.</_>
- <_>10 17 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0331519991159439</threshold>
- <left_val>-0.5792940258979797</left_val>
- <right_val>0.1743440032005310</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 7 9 -1.</_>
- <_>4 16 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0157699994742870</threshold>
- <left_val>-0.0112840002402663</left_val>
- <right_val>-0.8370140194892883</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 24 10 -1.</_>
- <_>0 18 24 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0393630005419254</threshold>
- <left_val>0.3482159972190857</left_val>
- <right_val>-0.1745540052652359</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 2 8 11 -1.</_>
- <_>8 2 4 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0678490027785301</threshold>
- <left_val>1.4225699901580811</left_val>
- <right_val>-0.1476559937000275</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 8 16 -1.</_>
- <_>14 2 4 8 2.</_>
- <_>10 10 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0267750006169081</threshold>
- <left_val>0.2394700050354004</left_val>
- <right_val>0.0132719995453954</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 6 -1.</_>
- <_>0 2 12 3 2.</_>
- <_>12 5 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0399190001189709</threshold>
- <left_val>-8.9999996125698090e-003</left_val>
- <right_val>-0.7593889832496643</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 12 9 -1.</_>
- <_>6 3 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1006560027599335</threshold>
- <left_val>-0.0186850000172853</left_val>
- <right_val>0.7624530196189880</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 12 12 -1.</_>
- <_>1 2 6 6 2.</_>
- <_>7 8 6 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0810220018029213</threshold>
- <left_val>-0.9043909907341003</left_val>
- <right_val>-8.5880002006888390e-003</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 5 6 9 -1.</_>
- <_>18 8 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0212580002844334</threshold>
- <left_val>-0.2131959944963455</left_val>
- <right_val>0.2191970050334930</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 8 10 -1.</_>
- <_>4 3 4 5 2.</_>
- <_>8 8 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0106309996917844</threshold>
- <left_val>0.1959809958934784</left_val>
- <right_val>-0.3576810061931610</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 21 18 3 -1.</_>
- <_>6 22 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.1300002057105303e-004</threshold>
- <left_val>-0.0927949994802475</left_val>
- <right_val>0.2614589929580689</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 18 2 -1.</_>
- <_>1 11 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.4650000743567944e-003</threshold>
- <left_val>-0.5533609986305237</left_val>
- <right_val>0.0273860003799200</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 22 3 -1.</_>
- <_>1 11 22 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0188359990715981</threshold>
- <left_val>0.1844609975814819</left_val>
- <right_val>-0.6693429946899414</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 8 12 9 -1.</_>
- <_>2 11 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0256319995969534</threshold>
- <left_val>1.9382879734039307</left_val>
- <right_val>-0.1470890045166016</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 8 12 6 -1.</_>
- <_>18 8 6 3 2.</_>
- <_>12 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.0939999744296074e-003</threshold>
- <left_val>-0.2645159959793091</left_val>
- <right_val>0.2073320001363754</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 12 6 -1.</_>
- <_>0 8 6 3 2.</_>
- <_>6 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.9199998183175921e-004</threshold>
- <left_val>-0.5503159761428833</left_val>
- <right_val>0.0503749996423721</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 15 6 9 -1.</_>
- <_>12 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0495180003345013</threshold>
- <left_val>-2.5615389347076416</left_val>
- <right_val>0.1314170062541962</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 13 9 6 -1.</_>
- <_>7 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0116809997707605</threshold>
- <left_val>-0.2481980025768280</left_val>
- <right_val>0.3998270034790039</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 7 12 -1.</_>
- <_>9 14 7 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0345639996230602</threshold>
- <left_val>0.1617880016565323</left_val>
- <right_val>-0.7141889929771423</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 9 6 -1.</_>
- <_>7 13 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.2909995689988136e-003</threshold>
- <left_val>0.2218009978532791</left_val>
- <right_val>-0.2918170094490051</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 15 18 4 -1.</_>
- <_>12 15 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0223580002784729</threshold>
- <left_val>0.3104409873485565</left_val>
- <right_val>-2.7280000504106283e-003</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 4 16 -1.</_>
- <_>7 4 2 16 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0308010000735521</threshold>
- <left_val>-0.9567270278930664</left_val>
- <right_val>-8.3400001749396324e-003</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 15 6 9 -1.</_>
- <_>12 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0437790006399155</threshold>
- <left_val>0.1255690008401871</left_val>
- <right_val>-1.1759619712829590</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 15 6 9 -1.</_>
- <_>10 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0430460013449192</threshold>
- <left_val>-0.0588769987225533</left_val>
- <right_val>-1.8568470478057861</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 11 12 10 -1.</_>
- <_>15 11 6 5 2.</_>
- <_>9 16 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0271889995783567</threshold>
- <left_val>0.0428580008447170</left_val>
- <right_val>0.3903670012950897</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 14 6 -1.</_>
- <_>3 8 14 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.4149997457861900e-003</threshold>
- <left_val>-0.0435670018196106</left_val>
- <right_val>-1.1094470024108887</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 2 17 8 -1.</_>
- <_>4 6 17 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0943119972944260</threshold>
- <left_val>0.0402569994330406</left_val>
- <right_val>0.9844229817390442</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 2 12 21 -1.</_>
- <_>6 9 12 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1702509969472885</threshold>
- <left_val>0.0295100007206202</left_val>
- <right_val>-0.6950929760932922</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 9 9 -1.</_>
- <_>8 4 9 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0471480004489422</threshold>
- <left_val>1.0338569879531860</left_val>
- <right_val>0.0676020011305809</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 24 3 -1.</_>
- <_>12 7 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1118630021810532</threshold>
- <left_val>-0.0686829984188080</left_val>
- <right_val>-2.4985830783843994</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 9 10 -1.</_>
- <_>11 11 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0143539998680353</threshold>
- <left_val>-0.5948190093040466</left_val>
- <right_val>0.1500169932842255</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 18 3 -1.</_>
- <_>2 12 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0340240001678467</threshold>
- <left_val>-0.0648230016231537</left_val>
- <right_val>-2.1382639408111572</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 16 9 4 -1.</_>
- <_>8 18 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0216019991785288</threshold>
- <left_val>0.0553099997341633</left_val>
- <right_val>0.7829290032386780</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 9 6 -1.</_>
- <_>0 2 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0217719990760088</threshold>
- <left_val>-7.1279997937381268e-003</left_val>
- <right_val>-0.7214810252189636</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 24 6 -1.</_>
- <_>0 13 24 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0824169963598251</threshold>
- <left_val>0.1460949927568436</left_val>
- <right_val>-1.3636670112609863</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 9 20 6 -1.</_>
- <_>2 12 20 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0846719965338707</threshold>
- <left_val>-0.1778469979763031</left_val>
- <right_val>0.7285770177841187</right_val></_></_>
- <_>
- <!-- tree 137 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 5 16 12 -1.</_>
- <_>12 5 8 6 2.</_>
- <_>4 11 8 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0551280006766319</threshold>
- <left_val>-0.5940240025520325</left_val>
- <right_val>0.1935780048370361</right_val></_></_>
- <_>
- <!-- tree 138 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 15 -1.</_>
- <_>10 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0648230016231537</threshold>
- <left_val>-1.0783840417861938</left_val>
- <right_val>-0.0407340005040169</right_val></_></_>
- <_>
- <!-- tree 139 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 3 10 4 -1.</_>
- <_>7 5 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0227690003812313</threshold>
- <left_val>0.7790020108222961</left_val>
- <right_val>3.4960000775754452e-003</right_val></_></_>
- <_>
- <!-- tree 140 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 15 6 8 -1.</_>
- <_>9 19 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0547560006380081</threshold>
- <left_val>-0.0656839981675148</left_val>
- <right_val>-1.8188409805297852</right_val></_></_>
- <_>
- <!-- tree 141 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 0 7 10 -1.</_>
- <_>17 5 7 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.9000001025851816e-005</threshold>
- <left_val>-0.0178919993340969</left_val>
- <right_val>0.2076829969882965</right_val></_></_>
- <_>
- <!-- tree 142 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 7 10 -1.</_>
- <_>0 5 7 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0983619987964630</threshold>
- <left_val>-0.0559469982981682</left_val>
- <right_val>-1.4153920412063599</right_val></_></_>
- <_>
- <!-- tree 143 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 1 6 12 -1.</_>
- <_>19 1 3 6 2.</_>
- <_>16 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.0930002257227898e-003</threshold>
- <left_val>0.3413529992103577</left_val>
- <right_val>-0.1208989992737770</right_val></_></_>
- <_>
- <!-- tree 144 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 19 8 -1.</_>
- <_>1 4 19 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0502780005335808</threshold>
- <left_val>-0.2628670036792755</left_val>
- <right_val>0.2579729855060577</right_val></_></_>
- <_>
- <!-- tree 145 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 2 9 4 -1.</_>
- <_>12 4 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.7870000600814819e-003</threshold>
- <left_val>-0.1317860037088394</left_val>
- <right_val>0.1735019981861115</right_val></_></_>
- <_>
- <!-- tree 146 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 9 4 -1.</_>
- <_>3 4 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0139739997684956</threshold>
- <left_val>0.0285180006176233</left_val>
- <right_val>-0.6115220189094544</right_val></_></_>
- <_>
- <!-- tree 147 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 2 10 6 -1.</_>
- <_>12 4 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0214499998837709</threshold>
- <left_val>0.0261819995939732</left_val>
- <right_val>0.3030659854412079</right_val></_></_>
- <_>
- <!-- tree 148 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 18 2 -1.</_>
- <_>12 4 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0292140003293753</threshold>
- <left_val>0.4494059979915619</left_val>
- <right_val>-0.2280309945344925</right_val></_></_>
- <_>
- <!-- tree 149 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 4 9 -1.</_>
- <_>12 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.8099999548867345e-004</threshold>
- <left_val>-0.1987999975681305</left_val>
- <right_val>0.2074449956417084</right_val></_></_>
- <_>
- <!-- tree 150 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 4 9 -1.</_>
- <_>10 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.7109999898821115e-003</threshold>
- <left_val>-0.5403720140457153</left_val>
- <right_val>0.0678659975528717</right_val></_></_>
- <_>
- <!-- tree 151 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 8 10 -1.</_>
- <_>14 5 4 5 2.</_>
- <_>10 10 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.6660003289580345e-003</threshold>
- <left_val>-0.0131280003115535</left_val>
- <right_val>0.5229790210723877</right_val></_></_>
- <_>
- <!-- tree 152 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 13 -1.</_>
- <_>10 4 4 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0636579990386963</threshold>
- <left_val>0.0682990029454231</left_val>
- <right_val>-0.4923509955406189</right_val></_></_>
- <_>
- <!-- tree 153 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 5 6 6 -1.</_>
- <_>13 5 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0279680006206036</threshold>
- <left_val>0.6818389892578125</left_val>
- <right_val>0.0787810012698174</right_val></_></_>
- <_>
- <!-- tree 154 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 12 3 -1.</_>
- <_>7 5 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0489539988338947</threshold>
- <left_val>-0.2062239944934845</left_val>
- <right_val>0.5038809776306152</right_val></_></_></trees>
- <stage_threshold>-3.3933560848236084</stage_threshold>
- <parent>16</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 18 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 10 6 -1.</_>
- <_>7 7 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0293129999190569</threshold>
- <left_val>0.7128469944000244</left_val>
- <right_val>-0.5823069810867310</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 21 5 -1.</_>
- <_>9 0 7 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1241509988903999</threshold>
- <left_val>-0.3686349987983704</left_val>
- <right_val>0.6006720066070557</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 9 9 -1.</_>
- <_>0 11 9 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.9349996522068977e-003</threshold>
- <left_val>-0.8600829839706421</left_val>
- <right_val>0.2172469943761826</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0303659997880459</threshold>
- <left_val>-0.2718699872493744</left_val>
- <right_val>0.6124789714813232</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 7 -1.</_>
- <_>3 3 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0252180006355047</threshold>
- <left_val>-0.3474830090999603</left_val>
- <right_val>0.5042769908905029</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 18 12 6 -1.</_>
- <_>15 18 6 3 2.</_>
- <_>9 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0100140003487468</threshold>
- <left_val>-0.3189899921417236</left_val>
- <right_val>0.4137679934501648</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 8 20 6 -1.</_>
- <_>2 8 10 3 2.</_>
- <_>12 11 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0167750008404255</threshold>
- <left_val>-0.6904810070991516</left_val>
- <right_val>0.0948309972882271</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 2 10 4 -1.</_>
- <_>13 4 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.6950000319629908e-003</threshold>
- <left_val>-0.2082979977130890</left_val>
- <right_val>0.2373719960451126</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 5 5 18 -1.</_>
- <_>4 11 5 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0422579981386662</threshold>
- <left_val>-0.4936670064926148</left_val>
- <right_val>0.1817059963941574</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 4 4 9 -1.</_>
- <_>20 4 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0485050007700920</threshold>
- <left_val>1.3429640531539917</left_val>
- <right_val>0.0397690013051033</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 8 14 -1.</_>
- <_>8 13 8 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0289929993450642</threshold>
- <left_val>0.0464960001409054</left_val>
- <right_val>-0.8164349794387817</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 6 -1.</_>
- <_>12 1 12 3 2.</_>
- <_>0 4 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0400890000164509</threshold>
- <left_val>-0.7119780182838440</left_val>
- <right_val>0.2255389988422394</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 4 9 -1.</_>
- <_>2 4 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0410219989717007</threshold>
- <left_val>1.0057929754257202</left_val>
- <right_val>-0.1969020068645477</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 3 -1.</_>
- <_>3 7 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0118380002677441</threshold>
- <left_val>-0.0126000000163913</left_val>
- <right_val>0.8076710104942322</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 17 16 6 -1.</_>
- <_>3 19 16 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0213280003517866</threshold>
- <left_val>-0.8202390074729919</left_val>
- <right_val>0.0205249991267920</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 6 6 9 -1.</_>
- <_>13 9 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0239049997180700</threshold>
- <left_val>0.5421050190925598</left_val>
- <right_val>-0.0747670009732246</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 6 -1.</_>
- <_>5 6 7 3 2.</_>
- <_>12 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0180089995265007</threshold>
- <left_val>-0.3382770121097565</left_val>
- <right_val>0.4235860109329224</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 5 8 10 -1.</_>
- <_>17 5 4 5 2.</_>
- <_>13 10 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0436140000820160</threshold>
- <left_val>-1.1983489990234375</left_val>
- <right_val>0.1556620001792908</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 20 3 -1.</_>
- <_>2 3 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.2449998483061790e-003</threshold>
- <left_val>-0.8902999758720398</left_val>
- <right_val>0.0110039999708533</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 2 9 6 -1.</_>
- <_>12 2 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0474850013852119</threshold>
- <left_val>0.1666409969329834</left_val>
- <right_val>-0.9076449871063232</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 6 9 -1.</_>
- <_>10 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0142339998856187</threshold>
- <left_val>0.6269519925117493</left_val>
- <right_val>-0.2579120099544525</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 3 4 11 -1.</_>
- <_>12 3 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.8010000716894865e-003</threshold>
- <left_val>-0.2822999954223633</left_val>
- <right_val>0.2662459909915924</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 3 4 11 -1.</_>
- <_>10 3 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.4330000635236502e-003</threshold>
- <left_val>-0.6377199888229370</left_val>
- <right_val>0.0984229966998100</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 3 8 10 -1.</_>
- <_>12 3 4 5 2.</_>
- <_>8 8 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0292210001498461</threshold>
- <left_val>-0.7676990032196045</left_val>
- <right_val>0.2263450026512146</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 2 18 -1.</_>
- <_>12 1 1 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.4949998632073402e-003</threshold>
- <left_val>0.4560010135173798</left_val>
- <right_val>-0.2652890086174011</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 2 9 6 -1.</_>
- <_>12 2 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0300340000540018</threshold>
- <left_val>-0.7655109763145447</left_val>
- <right_val>0.1400929987430573</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 19 3 -1.</_>
- <_>0 3 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.8360000625252724e-003</threshold>
- <left_val>0.0467559993267059</left_val>
- <right_val>-0.7235620021820068</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 14 9 6 -1.</_>
- <_>9 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.8550001382827759e-003</threshold>
- <left_val>-0.0491419993340969</left_val>
- <right_val>0.5147269964218140</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 8 18 5 -1.</_>
- <_>7 8 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0959739983081818</threshold>
- <left_val>-0.0200689993798733</left_val>
- <right_val>-1.0850950479507446</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 6 9 -1.</_>
- <_>14 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0328769981861115</threshold>
- <left_val>-0.9587529897689819</left_val>
- <right_val>0.1454360038042069</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 6 9 -1.</_>
- <_>8 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0133840003982186</threshold>
- <left_val>-0.7001360058784485</left_val>
- <right_val>0.0291579999029636</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 6 4 15 -1.</_>
- <_>13 11 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0152359995990992</threshold>
- <left_val>-0.2823570072650909</left_val>
- <right_val>0.2536799907684326</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 18 3 -1.</_>
- <_>1 6 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0120540000498295</threshold>
- <left_val>-0.2530339956283569</left_val>
- <right_val>0.4652670025825501</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 7 14 6 -1.</_>
- <_>9 9 14 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0762950032949448</threshold>
- <left_val>-0.6991580128669739</left_val>
- <right_val>0.1321720033884049</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 16 18 3 -1.</_>
- <_>2 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0120400004088879</threshold>
- <left_val>0.4589459896087647</left_val>
- <right_val>-0.2385649979114533</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 6 -1.</_>
- <_>15 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0219160001724958</threshold>
- <left_val>0.1826860010623932</left_val>
- <right_val>-0.6162970066070557</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 12 6 -1.</_>
- <_>0 8 6 3 2.</_>
- <_>6 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.7330000884830952e-003</threshold>
- <left_val>-0.6325790286064148</left_val>
- <right_val>0.0342190004885197</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 13 7 8 -1.</_>
- <_>9 17 7 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0486520007252693</threshold>
- <left_val>-1.0297729969024658</left_val>
- <right_val>0.1738650053739548</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 17 20 3 -1.</_>
- <_>2 18 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0104639995843172</threshold>
- <left_val>0.3475730121135712</left_val>
- <right_val>-0.2746410071849823</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 6 -1.</_>
- <_>15 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.6550001502037048e-003</threshold>
- <left_val>-0.2898029983043671</left_val>
- <right_val>0.2403790056705475</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 15 4 -1.</_>
- <_>4 2 15 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.5469996556639671e-003</threshold>
- <left_val>-0.4434050023555756</left_val>
- <right_val>0.1426739990711212</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 2 6 6 -1.</_>
- <_>17 5 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0199139993637800</threshold>
- <left_val>0.1774040013551712</left_val>
- <right_val>-0.2409629970788956</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 9 -1.</_>
- <_>0 6 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0220129992812872</threshold>
- <left_val>-0.0108120003715158</left_val>
- <right_val>-0.9469079971313477</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 6 -1.</_>
- <_>15 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0521790012717247</threshold>
- <left_val>1.6547499895095825</left_val>
- <right_val>0.0964870005846024</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 9 6 -1.</_>
- <_>0 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0196989998221397</threshold>
- <left_val>-6.7560002207756042e-003</left_val>
- <right_val>-0.8631150126457214</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 18 12 6 -1.</_>
- <_>15 18 6 3 2.</_>
- <_>9 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0230400003492832</threshold>
- <left_val>-2.3519999813288450e-003</left_val>
- <right_val>0.3853130042552948</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 15 6 9 -1.</_>
- <_>3 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0150380004197359</threshold>
- <left_val>-0.6190569996833801</left_val>
- <right_val>0.0310779996216297</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 13 8 10 -1.</_>
- <_>20 13 4 5 2.</_>
- <_>16 18 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0499560013413429</threshold>
- <left_val>0.7065749764442444</left_val>
- <right_val>0.0478809997439384</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 24 4 -1.</_>
- <_>8 14 8 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0692699998617172</threshold>
- <left_val>0.3921290040016174</left_val>
- <right_val>-0.2384800016880035</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 18 6 6 -1.</_>
- <_>13 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.7399997711181641e-003</threshold>
- <left_val>-0.0243090000003576</left_val>
- <right_val>0.2538630068302155</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 8 10 -1.</_>
- <_>0 13 4 5 2.</_>
- <_>4 18 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0339239984750748</threshold>
- <left_val>0.4693039953708649</left_val>
- <right_val>-0.2332189977169037</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 24 6 -1.</_>
- <_>0 17 24 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0162310004234314</threshold>
- <left_val>0.3231920003890991</left_val>
- <right_val>-0.2054560035467148</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 12 8 -1.</_>
- <_>5 2 6 4 2.</_>
- <_>11 6 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0501930005848408</threshold>
- <left_val>-1.2277870178222656</left_val>
- <right_val>-0.0407980009913445</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 9 9 6 -1.</_>
- <_>11 9 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0569440014660358</threshold>
- <left_val>0.0451840013265610</left_val>
- <right_val>0.6019750237464905</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 16 4 -1.</_>
- <_>4 5 16 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0409369990229607</threshold>
- <left_val>-0.1677280068397522</left_val>
- <right_val>0.8981930017471314</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 10 -1.</_>
- <_>10 7 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.0839999672025442e-003</threshold>
- <left_val>0.3371619880199432</left_val>
- <right_val>-0.2724080085754395</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 4 5 8 -1.</_>
- <_>8 8 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0326000005006790</threshold>
- <left_val>-0.8544650077819824</left_val>
- <right_val>0.0196649990975857</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 5 9 12 -1.</_>
- <_>11 9 9 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0984809994697571</threshold>
- <left_val>0.0547420009970665</left_val>
- <right_val>0.6382730007171631</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 5 9 12 -1.</_>
- <_>4 9 9 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0381850004196167</threshold>
- <left_val>0.5227469801902771</left_val>
- <right_val>-0.2338480055332184</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 6 6 9 -1.</_>
- <_>14 9 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0459170006215572</threshold>
- <left_val>0.6282920241355896</left_val>
- <right_val>0.0328590013086796</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 4 20 12 -1.</_>
- <_>2 8 20 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1195549964904785</threshold>
- <left_val>-0.6157270073890686</left_val>
- <right_val>0.0346800014376640</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 17 16 -1.</_>
- <_>4 12 17 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1204439997673035</threshold>
- <left_val>-0.8438000082969666</left_val>
- <right_val>0.1653070002794266</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 7 6 -1.</_>
- <_>8 10 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0706190019845963</threshold>
- <left_val>-0.0632610023021698</left_val>
- <right_val>-1.9863929748535156</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 9 23 2 -1.</_>
- <_>1 10 23 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.4889996796846390e-003</threshold>
- <left_val>-0.1766339987516403</left_val>
- <right_val>0.3801119923591614</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0227109994739294</threshold>
- <left_val>-0.0276059992611408</left_val>
- <right_val>-0.9192140102386475</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 3 4 9 -1.</_>
- <_>13 3 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.9700000090524554e-004</threshold>
- <left_val>-0.2429320067167282</left_val>
- <right_val>0.2287890017032623</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 6 13 -1.</_>
- <_>10 1 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0346519984304905</threshold>
- <left_val>-0.2370599955320358</left_val>
- <right_val>0.5401099920272827</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 22 18 2 -1.</_>
- <_>4 23 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.4700000435113907e-003</threshold>
- <left_val>0.3907899856567383</left_val>
- <right_val>-0.1269380003213882</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 9 6 -1.</_>
- <_>6 10 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0236430000513792</threshold>
- <left_val>-0.2666369974613190</left_val>
- <right_val>0.3231259882450104</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 2 24 -1.</_>
- <_>14 0 1 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0128130000084639</threshold>
- <left_val>0.1754080057144165</left_val>
- <right_val>-0.6078799962997437</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 2 24 -1.</_>
- <_>9 0 1 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0112509997561574</threshold>
- <left_val>-1.0852589607238770</left_val>
- <right_val>-0.0280460007488728</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 18 10 -1.</_>
- <_>9 2 6 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0415350012481213</threshold>
- <left_val>0.7188739776611328</left_val>
- <right_val>0.0279820002615452</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 15 6 -1.</_>
- <_>9 13 5 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0934709981083870</threshold>
- <left_val>-1.1906319856643677</left_val>
- <right_val>-0.0448109991848469</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 18 3 -1.</_>
- <_>9 21 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0272499993443489</threshold>
- <left_val>0.6294249892234802</left_val>
- <right_val>9.5039997249841690e-003</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 4 11 -1.</_>
- <_>11 1 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0217599999159575</threshold>
- <left_val>1.3233649730682373</left_val>
- <right_val>-0.1502700001001358</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 7 10 4 -1.</_>
- <_>9 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.6890004351735115e-003</threshold>
- <left_val>-0.3394710123538971</left_val>
- <right_val>0.1708579957485199</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 10 18 -1.</_>
- <_>12 0 5 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0693959966301918</threshold>
- <left_val>-0.2565779983997345</left_val>
- <right_val>0.4765209853649139</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 6 16 -1.</_>
- <_>14 1 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0312089994549751</threshold>
- <left_val>0.1415400058031082</left_val>
- <right_val>-0.3494200110435486</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 6 16 -1.</_>
- <_>8 1 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0497270002961159</threshold>
- <left_val>-1.1675560474395752</left_val>
- <right_val>-0.0407579988241196</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 6 -1.</_>
- <_>18 5 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0203019995242357</threshold>
- <left_val>-0.3948639929294586</left_val>
- <right_val>0.1581490039825440</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 18 2 -1.</_>
- <_>3 6 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0153670003637671</threshold>
- <left_val>0.4930000007152557</left_val>
- <right_val>-0.2009209990501404</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 6 -1.</_>
- <_>18 5 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0507350005209446</threshold>
- <left_val>1.8736059665679932</left_val>
- <right_val>0.0867300033569336</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 6 -1.</_>
- <_>0 5 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0207260008901358</threshold>
- <left_val>-0.8893839716911316</left_val>
- <right_val>-7.3199998587369919e-003</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 11 6 -1.</_>
- <_>13 13 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0309939999133348</threshold>
- <left_val>-1.1664899587631226</left_val>
- <right_val>0.1427460014820099</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 10 4 -1.</_>
- <_>10 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.4269999489188194e-003</threshold>
- <left_val>-0.6681510210037231</left_val>
- <right_val>4.4120000675320625e-003</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 9 10 7 -1.</_>
- <_>11 9 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0457439981400967</threshold>
- <left_val>-0.4795520007610321</left_val>
- <right_val>0.1512199938297272</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 10 7 -1.</_>
- <_>8 9 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0166989993304014</threshold>
- <left_val>0.1204859986901283</left_val>
- <right_val>-0.4523589909076691</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 4 6 6 -1.</_>
- <_>16 4 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.2210000790655613e-003</threshold>
- <left_val>-0.0776150003075600</left_val>
- <right_val>0.2784659862518311</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 10 8 -1.</_>
- <_>5 6 5 4 2.</_>
- <_>10 10 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0244340002536774</threshold>
- <left_val>-0.1998710036277771</left_val>
- <right_val>0.6725370287895203</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 21 16 3 -1.</_>
- <_>7 21 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0796779990196228</threshold>
- <left_val>0.9222239851951599</left_val>
- <right_val>0.0925579965114594</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 21 16 3 -1.</_>
- <_>9 21 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0445300005376339</threshold>
- <left_val>-0.2669050097465515</left_val>
- <right_val>0.3332050144672394</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 22 14 -1.</_>
- <_>13 5 11 7 2.</_>
- <_>2 12 11 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1252830028533936</threshold>
- <left_val>-0.5425310134887695</left_val>
- <right_val>0.1397629976272583</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 8 10 -1.</_>
- <_>3 10 4 5 2.</_>
- <_>7 15 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0179719999432564</threshold>
- <left_val>0.0182199999690056</left_val>
- <right_val>-0.6804850101470947</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 0 6 12 -1.</_>
- <_>20 0 3 6 2.</_>
- <_>17 6 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0191840007901192</threshold>
- <left_val>-0.0125839998945594</left_val>
- <right_val>0.5412669777870178</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 6 18 -1.</_>
- <_>7 2 2 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0400240011513233</threshold>
- <left_val>-0.1763879954814911</left_val>
- <right_val>0.7881039977073669</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 6 9 -1.</_>
- <_>15 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0135589996352792</threshold>
- <left_val>0.2073760032653809</left_val>
- <right_val>-0.4774430096149445</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 7 9 -1.</_>
- <_>0 15 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0162209998816252</threshold>
- <left_val>0.0230769999325275</left_val>
- <right_val>-0.6118209958076477</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 13 8 10 -1.</_>
- <_>19 13 4 5 2.</_>
- <_>15 18 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0112290000542998</threshold>
- <left_val>-0.0177280008792877</left_val>
- <right_val>0.4176419973373413</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 6 12 -1.</_>
- <_>1 0 3 6 2.</_>
- <_>4 6 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0391930006444454</threshold>
- <left_val>-0.1894849985837936</left_val>
- <right_val>0.7401930093765259</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 3 12 -1.</_>
- <_>12 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.5539996400475502e-003</threshold>
- <left_val>0.4094710052013397</left_val>
- <right_val>-0.1350889950990677</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 8 10 -1.</_>
- <_>1 13 4 5 2.</_>
- <_>5 18 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0278789997100830</threshold>
- <left_val>-0.2035070061683655</left_val>
- <right_val>0.6162539720535278</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 19 2 -1.</_>
- <_>3 22 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0236009992659092</threshold>
- <left_val>-1.6967060565948486</left_val>
- <right_val>0.1463319957256317</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 4 13 -1.</_>
- <_>8 3 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0269300006330013</threshold>
- <left_val>-0.0304019991308451</left_val>
- <right_val>-1.0909470319747925</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 18 3 -1.</_>
- <_>5 11 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.8999999631196260e-004</threshold>
- <left_val>-0.2007600069046021</left_val>
- <right_val>0.2231409996747971</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 3 5 12 -1.</_>
- <_>9 7 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0411249995231628</threshold>
- <left_val>-0.4524219930171967</left_val>
- <right_val>0.0573920011520386</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 2 4 15 -1.</_>
- <_>11 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.6789998672902584e-003</threshold>
- <left_val>0.2382490038871765</left_val>
- <right_val>-0.2126210033893585</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 16 4 -1.</_>
- <_>4 3 16 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0478649996221066</threshold>
- <left_val>-0.1819480061531067</left_val>
- <right_val>0.6191840171813965</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 18 3 -1.</_>
- <_>6 1 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.1679999083280563e-003</threshold>
- <left_val>-0.2739320099353790</left_val>
- <right_val>0.2501730024814606</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 1 10 8 -1.</_>
- <_>5 1 5 4 2.</_>
- <_>10 5 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.6230002343654633e-003</threshold>
- <left_val>-0.4628030061721802</left_val>
- <right_val>0.0423979982733727</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 18 12 6 -1.</_>
- <_>17 18 6 3 2.</_>
- <_>11 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.4350000359117985e-003</threshold>
- <left_val>0.4179680049419403</left_val>
- <right_val>-1.7079999670386314e-003</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 15 12 3 -1.</_>
- <_>11 15 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.8769999733194709e-003</threshold>
- <left_val>0.1460230052471161</left_val>
- <right_val>-0.3372110128402710</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 22 4 -1.</_>
- <_>1 10 11 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0862260013818741</threshold>
- <left_val>0.7514340281486511</left_val>
- <right_val>0.0107119996100664</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 9 9 6 -1.</_>
- <_>10 9 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0468339994549751</threshold>
- <left_val>-0.1911959946155548</left_val>
- <right_val>0.4841490089893341</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 12 5 -1.</_>
- <_>10 11 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.2000002041459084e-005</threshold>
- <left_val>0.3522039949893951</left_val>
- <right_val>-0.1733330041170120</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 10 7 -1.</_>
- <_>11 7 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0163439996540546</threshold>
- <left_val>-0.6439769864082336</left_val>
- <right_val>9.0680001303553581e-003</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 2 8 10 -1.</_>
- <_>11 2 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0457039996981621</threshold>
- <left_val>0.0182160008698702</left_val>
- <right_val>0.3197079896926880</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 8 10 -1.</_>
- <_>9 2 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0273829996585846</threshold>
- <left_val>1.0564049482345581</left_val>
- <right_val>-0.1727640032768250</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 18 6 -1.</_>
- <_>15 4 9 3 2.</_>
- <_>6 7 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0276020001620054</threshold>
- <left_val>0.2971549928188324</left_val>
- <right_val>-9.4600003212690353e-003</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 10 9 -1.</_>
- <_>0 8 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.6939999125897884e-003</threshold>
- <left_val>-0.2166029959917069</left_val>
- <right_val>0.4738520085811615</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 21 6 -1.</_>
- <_>2 9 21 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.0500001311302185e-004</threshold>
- <left_val>0.2404879927635193</left_val>
- <right_val>-0.2677600085735321</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 22 16 -1.</_>
- <_>0 4 11 8 2.</_>
- <_>11 12 11 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1105419993400574</threshold>
- <left_val>-0.0335390008985996</left_val>
- <right_val>-1.0233880281448364</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 22 -1.</_>
- <_>9 11 6 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0687659978866577</threshold>
- <left_val>-4.3239998631179333e-003</left_val>
- <right_val>0.5715339779853821</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 3 12 -1.</_>
- <_>9 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.7999999690800905e-003</threshold>
- <left_val>0.0775749981403351</left_val>
- <right_val>-0.4209269881248474</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 12 18 -1.</_>
- <_>18 0 6 9 2.</_>
- <_>12 9 6 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1923200041055679</threshold>
- <left_val>0.0820219963788986</left_val>
- <right_val>2.8810169696807861</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 12 18 -1.</_>
- <_>0 0 6 9 2.</_>
- <_>6 9 6 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1574209928512573</threshold>
- <left_val>-0.1370819956064224</left_val>
- <right_val>2.0890059471130371</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 22 4 -1.</_>
- <_>12 1 11 2 2.</_>
- <_>1 3 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0493870005011559</threshold>
- <left_val>-1.8610910177230835</left_val>
- <right_val>0.1433209925889969</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 18 4 -1.</_>
- <_>3 2 18 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0519290007650852</threshold>
- <left_val>-0.1873700022697449</left_val>
- <right_val>0.5423160195350647</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 22 6 -1.</_>
- <_>2 7 22 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0499650016427040</threshold>
- <left_val>0.1417530030012131</left_val>
- <right_val>-1.5625779628753662</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 6 9 -1.</_>
- <_>5 3 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0426330007612705</threshold>
- <left_val>1.6059479713439941</left_val>
- <right_val>-0.1471289992332459</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 6 9 -1.</_>
- <_>12 14 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0375539995729923</threshold>
- <left_val>-0.8097490072250366</left_val>
- <right_val>0.1325699985027313</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 14 6 9 -1.</_>
- <_>10 14 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0371749997138977</threshold>
- <left_val>-1.3945020437240601</left_val>
- <right_val>-0.0570550002157688</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 18 18 3 -1.</_>
- <_>5 19 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0139459995552897</threshold>
- <left_val>0.0334270000457764</left_val>
- <right_val>0.5747479796409607</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 6 13 -1.</_>
- <_>9 0 3 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.4800000614486635e-004</threshold>
- <left_val>-0.5532749891281128</left_val>
- <right_val>0.0219529997557402</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 4 12 4 -1.</_>
- <_>7 4 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0319930016994476</threshold>
- <left_val>0.0203409995883703</left_val>
- <right_val>0.3745920062065125</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 12 6 -1.</_>
- <_>9 2 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.2799999937415123e-003</threshold>
- <left_val>0.4442870020866394</left_val>
- <right_val>-0.2299969941377640</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 18 3 -1.</_>
- <_>4 2 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.8550003021955490e-003</threshold>
- <left_val>0.1831579953432083</left_val>
- <right_val>-0.4096499979496002</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 6 12 -1.</_>
- <_>0 12 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0933569967746735</threshold>
- <left_val>-0.0636610016226768</left_val>
- <right_val>-1.6929290294647217</right_val></_></_>
- <_>
- <!-- tree 137 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 15 6 9 -1.</_>
- <_>11 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0172099992632866</threshold>
- <left_val>0.2015389949083328</left_val>
- <right_val>-0.4606109857559204</right_val></_></_>
- <_>
- <!-- tree 138 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 10 6 13 -1.</_>
- <_>11 10 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.4319999441504478e-003</threshold>
- <left_val>-0.3200399875640869</left_val>
- <right_val>0.1531219929456711</right_val></_></_>
- <_>
- <!-- tree 139 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 17 18 2 -1.</_>
- <_>6 18 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0140549996867776</threshold>
- <left_val>0.8688240051269531</left_val>
- <right_val>0.0325750000774860</right_val></_></_>
- <_>
- <!-- tree 140 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 4 6 9 -1.</_>
- <_>11 4 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.7180000953376293e-003</threshold>
- <left_val>0.6368669867515564</left_val>
- <right_val>-0.1842550039291382</right_val></_></_>
- <_>
- <!-- tree 141 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 6 9 -1.</_>
- <_>12 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0280050002038479</threshold>
- <left_val>0.1735749989748001</left_val>
- <right_val>-0.4788359999656677</right_val></_></_>
- <_>
- <!-- tree 142 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 10 8 -1.</_>
- <_>5 6 5 4 2.</_>
- <_>10 10 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0188849996775389</threshold>
- <left_val>0.2410160005092621</left_val>
- <right_val>-0.2654759883880615</right_val></_></_>
- <_>
- <!-- tree 143 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 9 5 8 -1.</_>
- <_>14 13 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0185850001871586</threshold>
- <left_val>0.5423250198364258</left_val>
- <right_val>0.0536330007016659</right_val></_></_>
- <_>
- <!-- tree 144 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 9 5 8 -1.</_>
- <_>5 13 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0364370010793209</threshold>
- <left_val>2.3908898830413818</left_val>
- <right_val>-0.1363469958305359</right_val></_></_>
- <_>
- <!-- tree 145 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 11 9 6 -1.</_>
- <_>14 13 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0324550010263920</threshold>
- <left_val>0.1591069996356964</left_val>
- <right_val>-0.6758149862289429</right_val></_></_>
- <_>
- <!-- tree 146 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 23 15 -1.</_>
- <_>0 7 23 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0597819983959198</threshold>
- <left_val>-2.3479999508708715e-003</left_val>
- <right_val>-0.7305369973182678</right_val></_></_>
- <_>
- <!-- tree 147 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 0 8 12 -1.</_>
- <_>16 6 8 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.8209995776414871e-003</threshold>
- <left_val>-0.1144409999251366</left_val>
- <right_val>0.3057030141353607</right_val></_></_>
- <_>
- <!-- tree 148 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 15 6 9 -1.</_>
- <_>4 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0351639986038208</threshold>
- <left_val>-1.0511469841003418</left_val>
- <right_val>-0.0331030003726482</right_val></_></_>
- <_>
- <!-- tree 149 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 9 4 -1.</_>
- <_>8 20 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.7429999317973852e-003</threshold>
- <left_val>-0.2013539969921112</left_val>
- <right_val>0.3275409936904907</right_val></_></_>
- <_>
- <!-- tree 150 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 18 3 -1.</_>
- <_>0 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.1059997901320457e-003</threshold>
- <left_val>-0.2138350009918213</left_val>
- <right_val>0.4336209893226624</right_val></_></_>
- <_>
- <!-- tree 151 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 11 6 -1.</_>
- <_>13 13 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0889429971575737</threshold>
- <left_val>0.1094089969992638</left_val>
- <right_val>-4.7609338760375977</right_val></_></_>
- <_>
- <!-- tree 152 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 11 6 -1.</_>
- <_>0 13 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0300549995154142</threshold>
- <left_val>-1.7169300317764282</left_val>
- <right_val>-0.0609190016984940</right_val></_></_>
- <_>
- <!-- tree 153 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 24 6 -1.</_>
- <_>12 9 12 3 2.</_>
- <_>0 12 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0217349994927645</threshold>
- <left_val>0.6477890014648438</left_val>
- <right_val>-0.0328309983015060</right_val></_></_>
- <_>
- <!-- tree 154 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 8 8 -1.</_>
- <_>6 20 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0376489982008934</threshold>
- <left_val>-0.0100600002333522</left_val>
- <right_val>-0.7656909823417664</right_val></_></_>
- <_>
- <!-- tree 155 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 16 14 6 -1.</_>
- <_>10 18 14 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.7189999818801880e-003</threshold>
- <left_val>0.1988890022039414</left_val>
- <right_val>-0.0824790000915527</right_val></_></_>
- <_>
- <!-- tree 156 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 21 3 -1.</_>
- <_>1 2 21 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0105480002239347</threshold>
- <left_val>-0.8661360144615173</left_val>
- <right_val>-0.0259860008955002</right_val></_></_>
- <_>
- <!-- tree 157 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 3 -1.</_>
- <_>0 2 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1296630054712296</threshold>
- <left_val>0.1391199976205826</left_val>
- <right_val>-2.2271950244903564</right_val></_></_>
- <_>
- <!-- tree 158 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 15 8 5 -1.</_>
- <_>6 15 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0176769997924566</threshold>
- <left_val>0.3396770060062408</left_val>
- <right_val>-0.2398959994316101</right_val></_></_>
- <_>
- <!-- tree 159 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 21 3 -1.</_>
- <_>9 11 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0770519971847534</threshold>
- <left_val>-2.5017969608306885</left_val>
- <right_val>0.1284199953079224</right_val></_></_>
- <_>
- <!-- tree 160 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 18 12 6 -1.</_>
- <_>1 18 6 3 2.</_>
- <_>7 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0192300006747246</threshold>
- <left_val>0.5064120292663574</left_val>
- <right_val>-0.1975159943103790</right_val></_></_>
- <_>
- <!-- tree 161 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 4 10 -1.</_>
- <_>10 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0512229986488819</threshold>
- <left_val>-2.9333369731903076</left_val>
- <right_val>0.1385850012302399</right_val></_></_>
- <_>
- <!-- tree 162 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 4 10 -1.</_>
- <_>7 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.0830000285059214e-003</threshold>
- <left_val>-0.6004359722137451</left_val>
- <right_val>0.0297180004417896</right_val></_></_>
- <_>
- <!-- tree 163 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 6 12 -1.</_>
- <_>9 12 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0254180002957582</threshold>
- <left_val>0.3391579985618591</left_val>
- <right_val>-0.1439200043678284</right_val></_></_>
- <_>
- <!-- tree 164 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 9 6 -1.</_>
- <_>10 1 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0239059999585152</threshold>
- <left_val>-1.1082680225372314</left_val>
- <right_val>-0.0473770014941692</right_val></_></_>
- <_>
- <!-- tree 165 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 14 19 2 -1.</_>
- <_>3 15 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.3740001060068607e-003</threshold>
- <left_val>0.4453369975090027</left_val>
- <right_val>-0.0670529976487160</right_val></_></_>
- <_>
- <!-- tree 166 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 10 10 -1.</_>
- <_>7 7 5 5 2.</_>
- <_>12 12 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0376989990472794</threshold>
- <left_val>-1.0406579971313477</left_val>
- <right_val>-0.0417900010943413</right_val></_></_>
- <_>
- <!-- tree 167 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 12 18 12 -1.</_>
- <_>3 12 9 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2165510058403015</threshold>
- <left_val>0.0338630005717278</left_val>
- <right_val>0.8201730251312256</right_val></_></_>
- <_>
- <!-- tree 168 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 6 12 -1.</_>
- <_>10 0 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0134009998291731</threshold>
- <left_val>0.5290349721908569</left_val>
- <right_val>-0.1913300007581711</right_val></_></_></trees>
- <stage_threshold>-3.2396929264068604</stage_threshold>
- <parent>17</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 19 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 17 9 -1.</_>
- <_>3 3 17 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0712689980864525</threshold>
- <left_val>-0.5363119840621948</left_val>
- <right_val>0.6071529984474182</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 12 11 -1.</_>
- <_>10 0 4 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0561110004782677</threshold>
- <left_val>-0.5014160275459290</left_val>
- <right_val>0.4397610127925873</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 6 13 -1.</_>
- <_>4 0 3 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0404639989137650</threshold>
- <left_val>-0.3292219936847687</left_val>
- <right_val>0.5483469963073731</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 16 6 -1.</_>
- <_>5 11 16 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0631550028920174</threshold>
- <left_val>-0.3170169889926910</left_val>
- <right_val>0.4615299999713898</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 5 12 -1.</_>
- <_>8 14 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0103209996595979</threshold>
- <left_val>0.1069499999284744</left_val>
- <right_val>-0.9824389815330505</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 18 3 -1.</_>
- <_>9 21 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0626069977879524</threshold>
- <left_val>-0.1432970017194748</left_val>
- <right_val>0.7109500169754028</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 6 -1.</_>
- <_>3 0 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0394160002470016</threshold>
- <left_val>0.9438019990921021</left_val>
- <right_val>-0.2157209962606430</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 20 3 -1.</_>
- <_>2 1 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.3960001096129417e-003</threshold>
- <left_val>-0.5461199879646301</left_val>
- <right_val>0.2530379891395569</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 15 10 -1.</_>
- <_>9 6 5 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1077319979667664</threshold>
- <left_val>0.0124960001558065</left_val>
- <right_val>-1.0809199810028076</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0169820003211498</threshold>
- <left_val>-0.3153640031814575</left_val>
- <right_val>0.5123999714851379</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 9 -1.</_>
- <_>11 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0312169995158911</threshold>
- <left_val>-4.5199999585747719e-003</left_val>
- <right_val>-1.2443480491638184</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 6 9 -1.</_>
- <_>16 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0231069996953011</threshold>
- <left_val>-0.7649289965629578</left_val>
- <right_val>0.2064059972763062</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 16 9 6 -1.</_>
- <_>7 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0112039996311069</threshold>
- <left_val>0.2409269958734512</left_val>
- <right_val>-0.3514209985733032</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 6 9 -1.</_>
- <_>16 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.7479998320341110e-003</threshold>
- <left_val>-0.0970079973340034</left_val>
- <right_val>0.2063809931278229</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 6 9 -1.</_>
- <_>6 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0173589996993542</threshold>
- <left_val>-0.7902029752731323</left_val>
- <right_val>0.0218529999256134</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 1 6 16 -1.</_>
- <_>19 1 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0188519991934299</threshold>
- <left_val>-0.1039460003376007</left_val>
- <right_val>0.5484420061111450</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 6 16 -1.</_>
- <_>3 1 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.2249998338520527e-003</threshold>
- <left_val>-0.4040940105915070</left_val>
- <right_val>0.2676379978656769</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 6 9 -1.</_>
- <_>14 16 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0189159996807575</threshold>
- <left_val>0.2050800025463104</left_val>
- <right_val>-1.0206340551376343</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 9 -1.</_>
- <_>0 3 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0311569999903440</threshold>
- <left_val>1.2400000123307109e-003</left_val>
- <right_val>-0.8729349970817566</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 6 6 -1.</_>
- <_>9 5 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0209519993513823</threshold>
- <left_val>-5.5559999309480190e-003</left_val>
- <right_val>0.8035619854927063</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 9 6 -1.</_>
- <_>6 10 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0112910000607371</threshold>
- <left_val>-0.3647840023040772</left_val>
- <right_val>0.2276789993047714</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 7 3 16 -1.</_>
- <_>14 15 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0570110008120537</threshold>
- <left_val>-1.4295619726181030</left_val>
- <right_val>0.1432200074195862</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 10 14 12 -1.</_>
- <_>4 10 7 6 2.</_>
- <_>11 16 7 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0721940025687218</threshold>
- <left_val>-0.0418500006198883</left_val>
- <right_val>-1.9111829996109009</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 12 6 -1.</_>
- <_>7 8 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0198740009218454</threshold>
- <left_val>0.2642549872398377</left_val>
- <right_val>-0.3261770009994507</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 2 4 20 -1.</_>
- <_>9 2 2 20 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0166929997503757</threshold>
- <left_val>-0.8390780091285706</left_val>
- <right_val>4.0799999260343611e-004</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 6 9 -1.</_>
- <_>14 16 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0398349985480309</threshold>
- <left_val>-0.4885849952697754</left_val>
- <right_val>0.1643610000610352</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 9 -1.</_>
- <_>12 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0270099993795156</threshold>
- <left_val>-0.1886249929666519</left_val>
- <right_val>0.8341940045356751</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 6 9 -1.</_>
- <_>14 16 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.9420002140104771e-003</threshold>
- <left_val>0.2323150038719177</left_val>
- <right_val>-0.0723600015044212</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 20 14 4 -1.</_>
- <_>5 22 14 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0228330008685589</threshold>
- <left_val>-0.0358840003609657</left_val>
- <right_val>-1.1549400091171265</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 16 12 -1.</_>
- <_>4 10 16 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0688880011439323</threshold>
- <left_val>-1.7837309837341309</left_val>
- <right_val>0.1515900045633316</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0430970005691051</threshold>
- <left_val>-0.2160809934139252</left_val>
- <right_val>0.5062410235404968</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 21 4 -1.</_>
- <_>3 2 21 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.6239995434880257e-003</threshold>
- <left_val>-0.1779559999704361</left_val>
- <right_val>0.2895790040493012</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 6 9 -1.</_>
- <_>4 16 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0145610002800822</threshold>
- <left_val>-0.0114080002531409</left_val>
- <right_val>-0.8940200209617615</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 16 5 8 -1.</_>
- <_>16 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0115010002627969</threshold>
- <left_val>0.3017199933528900</left_val>
- <right_val>-0.0436590015888214</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 16 16 -1.</_>
- <_>4 0 8 8 2.</_>
- <_>12 8 8 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1097149997949600</threshold>
- <left_val>-0.9514709711074829</left_val>
- <right_val>-0.0199730005115271</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 14 6 -1.</_>
- <_>13 6 7 3 2.</_>
- <_>6 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0452280007302761</threshold>
- <left_val>0.0331109985709190</left_val>
- <right_val>0.9661980271339417</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 4 15 -1.</_>
- <_>10 10 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0270479992032051</threshold>
- <left_val>0.9796360135078430</left_val>
- <right_val>-0.1726190000772476</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 15 12 8 -1.</_>
- <_>15 15 6 4 2.</_>
- <_>9 19 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0180309992283583</threshold>
- <left_val>-0.0208010002970696</left_val>
- <right_val>0.2738589942455292</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 12 4 -1.</_>
- <_>12 7 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0505249984562397</threshold>
- <left_val>-0.0568029992282391</left_val>
- <right_val>-1.7775089740753174</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 6 -1.</_>
- <_>12 6 7 3 2.</_>
- <_>5 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0299239996820688</threshold>
- <left_val>0.6532920002937317</left_val>
- <right_val>-0.0235370006412268</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 10 -1.</_>
- <_>3 6 9 5 2.</_>
- <_>12 11 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0380580015480518</threshold>
- <left_val>0.0263170003890991</left_val>
- <right_val>-0.7066569924354553</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 18 21 -1.</_>
- <_>12 0 6 21 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1856389939785004</threshold>
- <left_val>-5.6039998307824135e-003</left_val>
- <right_val>0.3287369906902313</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 21 -1.</_>
- <_>8 0 8 21 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.0670000016689301e-003</threshold>
- <left_val>0.3420479893684387</left_val>
- <right_val>-0.3017159998416901</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 18 18 3 -1.</_>
- <_>6 19 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0101089999079704</threshold>
- <left_val>-7.3600001633167267e-003</left_val>
- <right_val>0.5798159837722778</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 9 6 -1.</_>
- <_>0 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0115670002996922</threshold>
- <left_val>-0.5272219777107239</left_val>
- <right_val>0.0464479997754097</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 19 2 -1.</_>
- <_>4 4 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.5649999305605888e-003</threshold>
- <left_val>-0.5852910280227661</left_val>
- <right_val>0.1910189986228943</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 24 2 -1.</_>
- <_>0 4 24 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0105820000171661</threshold>
- <left_val>0.0210730005055666</left_val>
- <right_val>-0.6889259815216065</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 14 9 4 -1.</_>
- <_>15 16 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0203040000051260</threshold>
- <left_val>-0.3640069961547852</left_val>
- <right_val>0.1533879935741425</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 9 4 -1.</_>
- <_>0 16 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.3529999889433384e-003</threshold>
- <left_val>0.0361640006303787</left_val>
- <right_val>-0.5982509851455689</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 15 18 2 -1.</_>
- <_>6 16 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.4690000098198652e-003</threshold>
- <left_val>-0.1470769941806793</left_val>
- <right_val>0.3750799894332886</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 17 18 3 -1.</_>
- <_>3 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.6449999362230301e-003</threshold>
- <left_val>-0.2170850038528442</left_val>
- <right_val>0.5193679928779602</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 3 23 -1.</_>
- <_>13 0 1 23 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0243260003626347</threshold>
- <left_val>-1.0846769809722900</left_val>
- <right_val>0.1408479958772659</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 8 6 -1.</_>
- <_>6 3 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0744189992547035</threshold>
- <left_val>-0.1551380008459091</left_val>
- <right_val>1.1822769641876221</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 18 3 -1.</_>
- <_>6 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0170779991894960</threshold>
- <left_val>0.0442310012876987</left_val>
- <right_val>0.9156110286712647</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 3 23 -1.</_>
- <_>10 0 1 23 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0245779994875193</threshold>
- <left_val>-1.5504100322723389</left_val>
- <right_val>-0.0547459982335567</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 4 10 -1.</_>
- <_>10 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0302050001919270</threshold>
- <left_val>0.1666280031204224</left_val>
- <right_val>-1.0001239776611328</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 10 12 -1.</_>
- <_>7 12 10 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0121360002085567</threshold>
- <left_val>-0.7707909941673279</left_val>
- <right_val>-4.8639997839927673e-003</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 9 6 14 -1.</_>
- <_>17 9 3 7 2.</_>
- <_>14 16 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0867170020937920</threshold>
- <left_val>0.1106169968843460</left_val>
- <right_val>-1.6857999563217163</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 10 9 -1.</_>
- <_>2 3 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0423090010881424</threshold>
- <left_val>1.1075930595397949</left_val>
- <right_val>-0.1543859988451004</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 5 12 -1.</_>
- <_>11 7 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.6420000940561295e-003</threshold>
- <left_val>0.2745189964771271</left_val>
- <right_val>-0.1845619976520538</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 4 12 10 -1.</_>
- <_>1 4 6 5 2.</_>
- <_>7 9 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0566620007157326</threshold>
- <left_val>-0.8062559962272644</left_val>
- <right_val>-0.0169280003756285</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 1 9 4 -1.</_>
- <_>15 3 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0234750006347895</threshold>
- <left_val>0.1418769955635071</left_val>
- <right_val>-0.2550089955329895</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 8 10 -1.</_>
- <_>1 2 4 5 2.</_>
- <_>5 7 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0208030007779598</threshold>
- <left_val>0.1982630044221878</left_val>
- <right_val>-0.3117119967937470</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 1 5 12 -1.</_>
- <_>10 5 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.2599998675286770e-003</threshold>
- <left_val>-0.0505909994244576</left_val>
- <right_val>0.4192380011081696</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 14 24 -1.</_>
- <_>11 0 7 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.3416000008583069</threshold>
- <left_val>-0.1667490005493164</left_val>
- <right_val>0.9274860024452210</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 17 10 4 -1.</_>
- <_>7 19 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.2029999680817127e-003</threshold>
- <left_val>-0.1262589991092682</left_val>
- <right_val>0.4044530093669891</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 4 10 -1.</_>
- <_>10 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0326920002698898</threshold>
- <left_val>-0.0326349996030331</left_val>
- <right_val>-0.9893980026245117</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 15 6 9 -1.</_>
- <_>15 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.1100000594742596e-004</threshold>
- <left_val>-0.0645340010523796</left_val>
- <right_val>0.2547369897365570</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 18 3 -1.</_>
- <_>3 22 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.2100001852959394e-004</threshold>
- <left_val>-0.3661859929561615</left_val>
- <right_val>0.1197310015559197</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 15 6 9 -1.</_>
- <_>15 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0544909983873367</threshold>
- <left_val>0.1207349970936775</left_val>
- <right_val>-1.0291390419006348</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 15 6 9 -1.</_>
- <_>7 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0101410001516342</threshold>
- <left_val>-0.5217720270156860</left_val>
- <right_val>0.0337349995970726</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 18 -1.</_>
- <_>12 6 2 9 2.</_>
- <_>10 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0188159998506308</threshold>
- <left_val>0.6518179774284363</left_val>
- <right_val>1.3399999588727951e-003</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 3 6 11 -1.</_>
- <_>9 3 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.3480002097785473e-003</threshold>
- <left_val>0.1737069934606552</left_val>
- <right_val>-0.3413200080394745</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 1 9 4 -1.</_>
- <_>15 3 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0108470004051924</threshold>
- <left_val>-0.1969989985227585</left_val>
- <right_val>0.1504549980163574</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 14 8 -1.</_>
- <_>5 8 14 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0499260015785694</threshold>
- <left_val>-0.5088850259780884</left_val>
- <right_val>0.0307620000094175</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 15 9 -1.</_>
- <_>8 4 15 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0121600003913045</threshold>
- <left_val>-0.0692519992589951</left_val>
- <right_val>0.1874549984931946</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 2 8 10 -1.</_>
- <_>7 2 4 5 2.</_>
- <_>11 7 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.2189998999238014e-003</threshold>
- <left_val>-0.4084909856319428</left_val>
- <right_val>0.0799549967050552</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 2 6 12 -1.</_>
- <_>12 2 3 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.1580000650137663e-003</threshold>
- <left_val>-0.2112459987401962</left_val>
- <right_val>0.2236640006303787</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 2 6 12 -1.</_>
- <_>9 2 3 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.1439998894929886e-003</threshold>
- <left_val>-0.4990029931068420</left_val>
- <right_val>0.0629170015454292</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 12 4 -1.</_>
- <_>7 7 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.3730000294744968e-003</threshold>
- <left_val>-0.2055329978466034</left_val>
- <right_val>0.2209669947624207</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 12 10 -1.</_>
- <_>10 3 4 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0518120005726814</threshold>
- <left_val>0.1809680014848709</left_val>
- <right_val>-0.4349580109119415</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 16 6 -1.</_>
- <_>13 6 8 3 2.</_>
- <_>5 9 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0183400008827448</threshold>
- <left_val>0.0152000002563000</left_val>
- <right_val>0.3799169957637787</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 18 9 -1.</_>
- <_>9 1 6 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1749079972505570</threshold>
- <left_val>-0.2092079967260361</left_val>
- <right_val>0.4001300036907196</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 8 18 5 -1.</_>
- <_>9 8 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0539939999580383</threshold>
- <left_val>0.2475160062313080</left_val>
- <right_val>-0.2671290040016174</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 22 -1.</_>
- <_>0 0 12 11 2.</_>
- <_>12 11 12 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.3203319907188416</threshold>
- <left_val>-1.9094380140304565</left_val>
- <right_val>-0.0669609978795052</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 16 9 6 -1.</_>
- <_>14 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0270600002259016</threshold>
- <left_val>-0.7137129902839661</left_val>
- <right_val>0.1590459942817688</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 24 8 -1.</_>
- <_>0 20 24 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0774639993906021</threshold>
- <left_val>-0.1697019934654236</left_val>
- <right_val>0.7755299806594849</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 19 22 4 -1.</_>
- <_>12 19 11 2 2.</_>
- <_>1 21 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0237719994038343</threshold>
- <left_val>0.1902189999818802</left_val>
- <right_val>-0.6016209721565247</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 16 9 6 -1.</_>
- <_>1 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0115010002627969</threshold>
- <left_val>7.7039999887347221e-003</left_val>
- <right_val>-0.6173030138015747</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 10 4 -1.</_>
- <_>7 8 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0326160006225109</threshold>
- <left_val>0.1715919971466065</left_val>
- <right_val>-0.7097820043563843</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 15 6 9 -1.</_>
- <_>11 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0443830005824566</threshold>
- <left_val>-2.2606229782104492</left_val>
- <right_val>-0.0732769966125488</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 18 12 6 -1.</_>
- <_>16 18 6 3 2.</_>
- <_>10 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0584760010242462</threshold>
- <left_val>2.4087750911712646</left_val>
- <right_val>0.0830919966101646</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 18 12 6 -1.</_>
- <_>2 18 6 3 2.</_>
- <_>8 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0193039998412132</threshold>
- <left_val>-0.2708230018615723</left_val>
- <right_val>0.2736999988555908</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 3 16 9 -1.</_>
- <_>8 6 16 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0447059981524944</threshold>
- <left_val>0.3135559856891632</left_val>
- <right_val>-0.0624920018017292</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 10 6 -1.</_>
- <_>0 7 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0603349991142750</threshold>
- <left_val>-1.4515119791030884</left_val>
- <right_val>-0.0587610006332397</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 18 3 -1.</_>
- <_>5 6 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0116670001298189</threshold>
- <left_val>-0.0180849991738796</left_val>
- <right_val>0.5047969818115234</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 6 9 6 -1.</_>
- <_>2 9 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0280099995434284</threshold>
- <left_val>-0.2330289930105209</left_val>
- <right_val>0.3070870041847229</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 2 10 9 -1.</_>
- <_>14 5 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0653970018029213</threshold>
- <left_val>0.1413590013980866</left_val>
- <right_val>-0.5001090168952942</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 3 -1.</_>
- <_>3 7 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.6239997074007988e-003</threshold>
- <left_val>-0.2205460071563721</left_val>
- <right_val>0.3919120132923126</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 2 15 6 -1.</_>
- <_>9 4 15 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.5510000996291637e-003</threshold>
- <left_val>-0.1138150021433830</left_val>
- <right_val>0.2003230005502701</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 8 15 6 -1.</_>
- <_>4 10 15 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0318470001220703</threshold>
- <left_val>0.0254769995808601</left_val>
- <right_val>-0.5332639813423157</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 24 4 -1.</_>
- <_>12 5 12 2 2.</_>
- <_>0 7 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0330550000071526</threshold>
- <left_val>0.1780769973993301</left_val>
- <right_val>-0.6279389858245850</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 6 12 -1.</_>
- <_>9 8 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0476009994745255</threshold>
- <left_val>-0.1474789977073669</left_val>
- <right_val>1.4204180240631104</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 6 9 -1.</_>
- <_>13 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0195719990879297</threshold>
- <left_val>-0.5269349813461304</left_val>
- <right_val>0.1583860069513321</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 6 12 -1.</_>
- <_>0 12 3 6 2.</_>
- <_>3 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0547300018370152</threshold>
- <left_val>0.8823159933090210</left_val>
- <right_val>-0.1662780046463013</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 12 10 6 -1.</_>
- <_>14 14 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0226860009133816</threshold>
- <left_val>-0.4838689863681793</left_val>
- <right_val>0.1500010043382645</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 18 9 -1.</_>
- <_>2 10 18 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1071320027112961</threshold>
- <left_val>-0.2133619934320450</left_val>
- <right_val>0.4233390092849731</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 14 10 9 -1.</_>
- <_>11 17 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0363800004124641</threshold>
- <left_val>-0.0741980001330376</left_val>
- <right_val>0.1458940058946610</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 10 8 -1.</_>
- <_>7 6 5 4 2.</_>
- <_>12 10 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0139359999448061</threshold>
- <left_val>-0.2491160035133362</left_val>
- <right_val>0.2677119970321655</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 14 6 -1.</_>
- <_>13 6 7 3 2.</_>
- <_>6 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0209919996559620</threshold>
- <left_val>8.7959999218583107e-003</left_val>
- <right_val>0.4306499958038330</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 9 7 -1.</_>
- <_>7 13 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0491189993917942</threshold>
- <left_val>-0.1759199947118759</left_val>
- <right_val>0.6928290128707886</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 10 6 12 -1.</_>
- <_>17 10 3 6 2.</_>
- <_>14 16 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0363159999251366</threshold>
- <left_val>0.1314529925584793</left_val>
- <right_val>-0.3359729945659638</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 10 6 12 -1.</_>
- <_>4 10 3 6 2.</_>
- <_>7 16 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0412280000746250</threshold>
- <left_val>-0.0456920005381107</left_val>
- <right_val>-1.3515930175781250</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 9 8 6 -1.</_>
- <_>13 9 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0156720001250505</threshold>
- <left_val>0.1754409968852997</left_val>
- <right_val>-0.0605500005185604</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 3 4 14 -1.</_>
- <_>10 3 2 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0162860006093979</threshold>
- <left_val>-1.1308189630508423</left_val>
- <right_val>-0.0395330004394054</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 0 3 18 -1.</_>
- <_>18 0 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.0229999683797359e-003</threshold>
- <left_val>-0.2245430052280426</left_val>
- <right_val>0.2362809926271439</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 16 12 -1.</_>
- <_>12 12 8 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1378629952669144</threshold>
- <left_val>0.4537689983844757</left_val>
- <right_val>-0.2109870016574860</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 6 14 -1.</_>
- <_>17 0 2 14 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.6760001033544540e-003</threshold>
- <left_val>-0.1510509997606278</left_val>
- <right_val>0.2078170031309128</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 6 14 -1.</_>
- <_>5 0 2 14 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0248399991542101</threshold>
- <left_val>-0.6835029721260071</left_val>
- <right_val>-8.0040004104375839e-003</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 2 12 20 -1.</_>
- <_>16 2 4 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1396439969539642</threshold>
- <left_val>0.6501129865646362</left_val>
- <right_val>0.0465440005064011</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 12 20 -1.</_>
- <_>4 2 4 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0821539983153343</threshold>
- <left_val>0.4488719999790192</left_val>
- <right_val>-0.2359199970960617</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 0 6 17 -1.</_>
- <_>18 0 2 17 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.8449999410659075e-003</threshold>
- <left_val>-0.0881730020046234</left_val>
- <right_val>0.2734679877758026</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 6 17 -1.</_>
- <_>4 0 2 17 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.6579999402165413e-003</threshold>
- <left_val>-0.4686659872531891</left_val>
- <right_val>0.0770019963383675</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 6 9 6 -1.</_>
- <_>15 8 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0158980004489422</threshold>
- <left_val>0.2926839888095856</left_val>
- <right_val>-0.0219410005956888</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 9 6 -1.</_>
- <_>0 8 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0509460009634495</threshold>
- <left_val>-1.2093789577484131</left_val>
- <right_val>-0.0421099998056889</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 1 6 13 -1.</_>
- <_>20 1 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0168379992246628</threshold>
- <left_val>-0.0455959998071194</left_val>
- <right_val>0.5018069744110107</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 13 -1.</_>
- <_>2 1 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0159189999103546</threshold>
- <left_val>-0.2690429985523224</left_val>
- <right_val>0.2651630043983460</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 0 4 9 -1.</_>
- <_>16 0 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.6309999413788319e-003</threshold>
- <left_val>-0.1304610073566437</left_val>
- <right_val>0.3180710077285767</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 12 7 -1.</_>
- <_>9 10 4 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0861449986696243</threshold>
- <left_val>1.9443659782409668</left_val>
- <right_val>-0.1397829949855804</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 9 12 6 -1.</_>
- <_>12 11 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0331409983336926</threshold>
- <left_val>0.1526679992675781</left_val>
- <right_val>-0.0308660008013248</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 12 6 -1.</_>
- <_>0 11 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.9679999463260174e-003</threshold>
- <left_val>-0.7120230197906494</left_val>
- <right_val>-0.0138440001755953</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 14 9 -1.</_>
- <_>5 10 14 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0240080002695322</threshold>
- <left_val>0.9200779795646668</left_val>
- <right_val>0.0467239990830421</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 20 3 -1.</_>
- <_>0 16 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.7320003658533096e-003</threshold>
- <left_val>-0.2256730049848557</left_val>
- <right_val>0.3193179965019226</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 10 8 10 -1.</_>
- <_>12 10 4 5 2.</_>
- <_>8 15 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0277869999408722</threshold>
- <left_val>-0.7233710289001465</left_val>
- <right_val>0.1701859980821610</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 13 9 -1.</_>
- <_>5 7 13 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1945530027151108</threshold>
- <left_val>1.2461860179901123</left_val>
- <right_val>-0.1473619937896729</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 6 18 -1.</_>
- <_>10 8 6 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1086969971656799</threshold>
- <left_val>-1.4465179443359375</left_val>
- <right_val>0.1214530020952225</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 6 9 -1.</_>
- <_>8 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0194949992001057</threshold>
- <left_val>-0.7815309762954712</left_val>
- <right_val>-0.0237329993396997</right_val></_></_>
- <_>
- <!-- tree 137 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 12 4 -1.</_>
- <_>6 11 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.0650000553578138e-003</threshold>
- <left_val>-0.8547139763832092</left_val>
- <right_val>0.1668699979782105</right_val></_></_>
- <_>
- <!-- tree 138 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 15 12 -1.</_>
- <_>3 6 15 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0591939985752106</threshold>
- <left_val>-0.1485369950532913</left_val>
- <right_val>1.1273469924926758</right_val></_></_>
- <_>
- <!-- tree 139 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 12 5 -1.</_>
- <_>16 0 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0542079992592335</threshold>
- <left_val>0.5472699999809265</left_val>
- <right_val>0.0355239994823933</right_val></_></_>
- <_>
- <!-- tree 140 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 18 3 -1.</_>
- <_>6 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0393249988555908</threshold>
- <left_val>0.3664259910583496</left_val>
- <right_val>-0.2054399996995926</right_val></_></_>
- <_>
- <!-- tree 141 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 24 5 -1.</_>
- <_>8 14 8 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0822789967060089</threshold>
- <left_val>-0.0350079983472824</left_val>
- <right_val>0.5399420261383057</right_val></_></_>
- <_>
- <!-- tree 142 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 1 3 18 -1.</_>
- <_>6 1 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.4479999020695686e-003</threshold>
- <left_val>-0.6153749823570252</left_val>
- <right_val>-3.5319998860359192e-003</right_val></_></_>
- <_>
- <!-- tree 143 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 4 14 -1.</_>
- <_>10 0 2 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.3770000599324703e-003</threshold>
- <left_val>-0.0655910000205040</left_val>
- <right_val>0.4196139872074127</right_val></_></_>
- <_>
- <!-- tree 144 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 3 4 9 -1.</_>
- <_>11 3 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.0779998786747456e-003</threshold>
- <left_val>-0.3412950038909912</left_val>
- <right_val>0.1253679990768433</right_val></_></_>
- <_>
- <!-- tree 145 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 12 6 -1.</_>
- <_>14 2 6 3 2.</_>
- <_>8 5 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0155819999054074</threshold>
- <left_val>-0.3024039864540100</left_val>
- <right_val>0.2151100039482117</right_val></_></_>
- <_>
- <!-- tree 146 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 17 4 -1.</_>
- <_>0 6 17 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.7399999089539051e-003</threshold>
- <left_val>0.0765530019998550</left_val>
- <right_val>-0.4106050133705139</right_val></_></_>
- <_>
- <!-- tree 147 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 16 5 8 -1.</_>
- <_>16 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0706000030040741</threshold>
- <left_val>-0.9735620021820068</left_val>
- <right_val>0.1124180033802986</right_val></_></_>
- <_>
- <!-- tree 148 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 16 5 8 -1.</_>
- <_>3 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0117060001939535</threshold>
- <left_val>0.1856070011854172</left_val>
- <right_val>-0.2975519895553589</right_val></_></_>
- <_>
- <!-- tree 149 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 18 18 2 -1.</_>
- <_>6 19 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.1499997284263372e-004</threshold>
- <left_val>-0.0596500001847744</left_val>
- <right_val>0.2482469975948334</right_val></_></_>
- <_>
- <!-- tree 150 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 12 5 -1.</_>
- <_>4 0 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0368660017848015</threshold>
- <left_val>0.3275170028209686</left_val>
- <right_val>-0.2305960059165955</right_val></_></_>
- <_>
- <!-- tree 151 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 3 6 12 -1.</_>
- <_>17 3 3 6 2.</_>
- <_>14 9 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0325269997119904</threshold>
- <left_val>-0.2932029962539673</left_val>
- <right_val>0.1542769968509674</right_val></_></_>
- <_>
- <!-- tree 152 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 6 12 -1.</_>
- <_>2 12 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0748139992356300</threshold>
- <left_val>-1.2143570184707642</left_val>
- <right_val>-0.0522440001368523</right_val></_></_>
- <_>
- <!-- tree 153 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 3 21 3 -1.</_>
- <_>2 4 21 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0414699986577034</threshold>
- <left_val>0.1306249946355820</left_val>
- <right_val>-2.3274369239807129</right_val></_></_>
- <_>
- <!-- tree 154 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 6 12 -1.</_>
- <_>4 3 3 6 2.</_>
- <_>7 9 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0288800001144409</threshold>
- <left_val>-0.6607459783554077</left_val>
- <right_val>-9.0960003435611725e-003</right_val></_></_>
- <_>
- <!-- tree 155 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 8 12 6 -1.</_>
- <_>18 8 6 3 2.</_>
- <_>12 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0463819988071918</threshold>
- <left_val>0.1663019955158234</left_val>
- <right_val>-0.6694949865341187</right_val></_></_>
- <_>
- <!-- tree 156 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 16 9 -1.</_>
- <_>8 15 8 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2542499899864197</threshold>
- <left_val>-0.0546419993042946</left_val>
- <right_val>-1.2676080465316772</right_val></_></_>
- <_>
- <!-- tree 157 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 13 18 5 -1.</_>
- <_>6 13 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.4000001139938831e-003</threshold>
- <left_val>0.2027679979801178</left_val>
- <right_val>0.0146679999306798</right_val></_></_>
- <_>
- <!-- tree 158 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 6 15 6 -1.</_>
- <_>6 6 5 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0828059986233711</threshold>
- <left_val>-0.7871360182762146</left_val>
- <right_val>-0.0244689993560314</right_val></_></_>
- <_>
- <!-- tree 159 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 9 9 6 -1.</_>
- <_>14 9 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0114380000159144</threshold>
- <left_val>0.2862339913845062</left_val>
- <right_val>-0.0308940000832081</right_val></_></_>
- <_>
- <!-- tree 160 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 15 11 -1.</_>
- <_>8 0 5 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1291339993476868</threshold>
- <left_val>1.7292929887771606</left_val>
- <right_val>-0.1429390013217926</right_val></_></_>
- <_>
- <!-- tree 161 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 3 3 18 -1.</_>
- <_>15 9 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0385529994964600</threshold>
- <left_val>0.0192329995334148</left_val>
- <right_val>0.3773260116577148</right_val></_></_>
- <_>
- <!-- tree 162 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 3 18 -1.</_>
- <_>6 9 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1019140034914017</threshold>
- <left_val>-0.0745339989662170</left_val>
- <right_val>-3.3868899345397949</right_val></_></_>
- <_>
- <!-- tree 163 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 10 8 -1.</_>
- <_>14 5 5 4 2.</_>
- <_>9 9 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0190680008381605</threshold>
- <left_val>0.3181410133838654</left_val>
- <right_val>0.0192610006779432</right_val></_></_>
- <_>
- <!-- tree 164 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 16 8 -1.</_>
- <_>4 4 8 4 2.</_>
- <_>12 8 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0607750006020069</threshold>
- <left_val>0.7693629860877991</left_val>
- <right_val>-0.1764400005340576</right_val></_></_>
- <_>
- <!-- tree 165 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 12 3 -1.</_>
- <_>7 7 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0246799997985363</threshold>
- <left_val>0.1839649975299835</left_val>
- <right_val>-0.3086880147457123</right_val></_></_>
- <_>
- <!-- tree 166 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 9 13 -1.</_>
- <_>8 0 3 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0267590004950762</threshold>
- <left_val>-0.2345490008592606</left_val>
- <right_val>0.3305659890174866</right_val></_></_>
- <_>
- <!-- tree 167 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 6 9 -1.</_>
- <_>13 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0149699999019504</threshold>
- <left_val>0.1721359938383102</left_val>
- <right_val>-0.1824889928102493</right_val></_></_>
- <_>
- <!-- tree 168 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0261429995298386</threshold>
- <left_val>-0.0464639998972416</left_val>
- <right_val>-1.1318379640579224</right_val></_></_>
- <_>
- <!-- tree 169 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 10 9 -1.</_>
- <_>8 4 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0375120006501675</threshold>
- <left_val>0.8040400147438049</left_val>
- <right_val>0.0696600005030632</right_val></_></_>
- <_>
- <!-- tree 170 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 18 2 -1.</_>
- <_>0 3 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.3229997865855694e-003</threshold>
- <left_val>-0.8188440203666687</left_val>
- <right_val>-0.0182249993085861</right_val></_></_>
- <_>
- <!-- tree 171 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 13 14 6 -1.</_>
- <_>17 13 7 3 2.</_>
- <_>10 16 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0178130008280277</threshold>
- <left_val>0.1495780050754547</left_val>
- <right_val>-0.1866720020771027</right_val></_></_>
- <_>
- <!-- tree 172 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 14 6 -1.</_>
- <_>0 13 7 3 2.</_>
- <_>7 16 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0340100005269051</threshold>
- <left_val>-0.7285230159759522</left_val>
- <right_val>-0.0166159998625517</right_val></_></_>
- <_>
- <!-- tree 173 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 2 3 21 -1.</_>
- <_>21 2 1 21 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0159530006349087</threshold>
- <left_val>0.5694400072097778</left_val>
- <right_val>0.0138320000842214</right_val></_></_>
- <_>
- <!-- tree 174 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 5 12 -1.</_>
- <_>0 13 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0197439994663000</threshold>
- <left_val>0.0405250005424023</left_val>
- <right_val>-0.4177339971065521</right_val></_></_>
- <_>
- <!-- tree 175 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 12 6 -1.</_>
- <_>12 8 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1037480011582375</threshold>
- <left_val>-1.9825149774551392</left_val>
- <right_val>0.1196020022034645</right_val></_></_>
- <_>
- <!-- tree 176 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 8 20 3 -1.</_>
- <_>1 9 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0192850008606911</threshold>
- <left_val>0.5023059844970703</left_val>
- <right_val>-0.1974589973688126</right_val></_></_>
- <_>
- <!-- tree 177 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 19 3 -1.</_>
- <_>5 8 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0127800004556775</threshold>
- <left_val>0.4019500017166138</left_val>
- <right_val>-0.0269579999148846</right_val></_></_>
- <_>
- <!-- tree 178 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 12 9 6 -1.</_>
- <_>1 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0163529999554157</threshold>
- <left_val>-0.7660880088806152</left_val>
- <right_val>-0.0242090001702309</right_val></_></_>
- <_>
- <!-- tree 179 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 10 14 12 -1.</_>
- <_>6 14 14 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1276369988918304</threshold>
- <left_val>0.8657850027084351</left_val>
- <right_val>0.0642059966921806</right_val></_></_>
- <_>
- <!-- tree 180 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 18 -1.</_>
- <_>5 12 14 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0190689992159605</threshold>
- <left_val>-0.5592979788780212</left_val>
- <right_val>-1.6880000475794077e-003</right_val></_></_>
- <_>
- <!-- tree 181 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 12 9 7 -1.</_>
- <_>14 12 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0324809998273849</threshold>
- <left_val>0.0407220013439655</left_val>
- <right_val>0.4892509877681732</right_val></_></_>
- <_>
- <!-- tree 182 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 15 18 4 -1.</_>
- <_>1 17 18 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.4849998131394386e-003</threshold>
- <left_val>-0.1923190057277679</left_val>
- <right_val>0.5113970041275024</right_val></_></_>
- <_>
- <!-- tree 183 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 14 6 9 -1.</_>
- <_>11 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.0470000132918358e-003</threshold>
- <left_val>0.1870680004358292</left_val>
- <right_val>-0.1611360013484955</right_val></_></_>
- <_>
- <!-- tree 184 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 18 4 -1.</_>
- <_>0 8 9 2 2.</_>
- <_>9 10 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0412679985165596</threshold>
- <left_val>-0.0488179996609688</left_val>
- <right_val>-1.1326299905776978</right_val></_></_>
- <_>
- <!-- tree 185 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 20 6 -1.</_>
- <_>13 10 10 3 2.</_>
- <_>3 13 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0763589963316917</threshold>
- <left_val>1.4169390201568604</left_val>
- <right_val>0.0873199999332428</right_val></_></_>
- <_>
- <!-- tree 186 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 20 6 -1.</_>
- <_>1 10 10 3 2.</_>
- <_>11 13 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0728349983692169</threshold>
- <left_val>1.3189860582351685</left_val>
- <right_val>-0.1481910049915314</right_val></_></_>
- <_>
- <!-- tree 187 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 24 2 -1.</_>
- <_>0 9 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0595769993960857</threshold>
- <left_val>0.0483769997954369</left_val>
- <right_val>0.8561180233955383</right_val></_></_>
- <_>
- <!-- tree 188 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 12 20 8 -1.</_>
- <_>1 12 10 4 2.</_>
- <_>11 16 10 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0202639997005463</threshold>
- <left_val>-0.2104409933090210</left_val>
- <right_val>0.3385899960994721</right_val></_></_>
- <_>
- <!-- tree 189 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 12 9 7 -1.</_>
- <_>14 12 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0803010016679764</threshold>
- <left_val>-1.2464400529861450</left_val>
- <right_val>0.1185709983110428</right_val></_></_>
- <_>
- <!-- tree 190 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 9 7 -1.</_>
- <_>7 12 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0178350005298853</threshold>
- <left_val>0.2578229904174805</left_val>
- <right_val>-0.2456479966640472</right_val></_></_>
- <_>
- <!-- tree 191 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 12 8 5 -1.</_>
- <_>12 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0114310001954436</threshold>
- <left_val>0.2294979989528656</left_val>
- <right_val>-0.2949759960174561</right_val></_></_>
- <_>
- <!-- tree 192 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 8 5 -1.</_>
- <_>8 12 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0255410000681877</threshold>
- <left_val>-0.8625299930572510</left_val>
- <right_val>-7.0400000549852848e-004</right_val></_></_>
- <_>
- <!-- tree 193 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 10 4 10 -1.</_>
- <_>13 10 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.6899997657164931e-004</threshold>
- <left_val>0.3151139914989471</left_val>
- <right_val>-0.1434900015592575</right_val></_></_>
- <_>
- <!-- tree 194 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 15 20 2 -1.</_>
- <_>11 15 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0144539996981621</threshold>
- <left_val>0.2514849901199341</left_val>
- <right_val>-0.2823289930820465</right_val></_></_>
- <_>
- <!-- tree 195 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 10 6 6 -1.</_>
- <_>9 10 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.6730001494288445e-003</threshold>
- <left_val>0.2660140097141266</left_val>
- <right_val>-0.2819080054759979</right_val></_></_></trees>
- <stage_threshold>-3.2103500366210937</stage_threshold>
- <parent>18</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 20 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 21 3 -1.</_>
- <_>7 1 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0547089986503124</threshold>
- <left_val>-0.5414429903030396</left_val>
- <right_val>0.6104300022125244</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 13 9 -1.</_>
- <_>6 7 13 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1083879992365837</threshold>
- <left_val>0.7173990011215210</left_val>
- <right_val>-0.4119609892368317</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 12 5 -1.</_>
- <_>10 5 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0229969993233681</threshold>
- <left_val>-0.5826979875564575</left_val>
- <right_val>0.2964560091495514</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 10 10 6 -1.</_>
- <_>10 12 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.7540000155568123e-003</threshold>
- <left_val>-0.7424389719963074</left_val>
- <right_val>0.1418330073356628</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 12 5 8 -1.</_>
- <_>6 16 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.1520000882446766e-003</threshold>
- <left_val>0.1787990033626556</left_val>
- <right_val>-0.6854860186576843</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 6 9 -1.</_>
- <_>15 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0225590001791716</threshold>
- <left_val>-1.0775549411773682</left_val>
- <right_val>0.1238899976015091</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 10 18 6 -1.</_>
- <_>8 10 6 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0830250009894371</threshold>
- <left_val>0.0245009995996952</left_val>
- <right_val>-1.0251879692077637</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 2 9 4 -1.</_>
- <_>11 4 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.6740000620484352e-003</threshold>
- <left_val>-0.4528310000896454</left_val>
- <right_val>0.2123019993305206</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 20 21 3 -1.</_>
- <_>8 20 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0764850005507469</threshold>
- <left_val>-0.2697269916534424</left_val>
- <right_val>0.4858019948005676</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 22 2 -1.</_>
- <_>1 11 22 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.4910001344978809e-003</threshold>
- <left_val>-0.4887120127677918</left_val>
- <right_val>0.3161639869213104</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 18 3 -1.</_>
- <_>0 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0104149999096990</threshold>
- <left_val>0.4151290059089661</left_val>
- <right_val>-0.3004480004310608</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 6 9 -1.</_>
- <_>15 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0276079997420311</threshold>
- <left_val>0.1620379984378815</left_val>
- <right_val>-0.9986850023269653</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 6 9 -1.</_>
- <_>7 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0232720002532005</threshold>
- <left_val>-1.1024399995803833</left_val>
- <right_val>0.0211249999701977</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 20 -1.</_>
- <_>20 2 2 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0556199997663498</threshold>
- <left_val>0.6503310203552246</left_val>
- <right_val>-0.0279380008578300</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 20 -1.</_>
- <_>2 2 2 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0406319983303547</threshold>
- <left_val>0.4211730062961578</left_val>
- <right_val>-0.2676379978656769</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 7 6 14 -1.</_>
- <_>14 7 3 7 2.</_>
- <_>11 14 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.3560001328587532e-003</threshold>
- <left_val>0.3527779877185822</left_val>
- <right_val>-0.3785400092601776</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 4 9 -1.</_>
- <_>2 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0170070007443428</threshold>
- <left_val>-0.2918950021266937</left_val>
- <right_val>0.4105379879474640</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 14 9 4 -1.</_>
- <_>12 16 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0370340012013912</threshold>
- <left_val>-1.3216309547424316</left_val>
- <right_val>0.1296650022268295</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 9 4 -1.</_>
- <_>1 15 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0196330007165670</threshold>
- <left_val>-0.8770229816436768</left_val>
- <right_val>1.0799999581649899e-003</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 15 6 -1.</_>
- <_>7 8 15 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0235469993203878</threshold>
- <left_val>0.2610610127449036</left_val>
- <right_val>-0.2148140072822571</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 3 18 -1.</_>
- <_>8 8 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0433529987931252</threshold>
- <left_val>-0.9908969998359680</left_val>
- <right_val>-9.9560003727674484e-003</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 6 -1.</_>
- <_>12 6 6 3 2.</_>
- <_>6 9 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0221839994192123</threshold>
- <left_val>0.6345440149307251</left_val>
- <right_val>-0.0565470010042191</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 19 20 4 -1.</_>
- <_>2 19 10 2 2.</_>
- <_>12 21 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0165309999138117</threshold>
- <left_val>0.0246649999171495</left_val>
- <right_val>-0.7332680225372315</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 6 9 -1.</_>
- <_>14 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0327440015971661</threshold>
- <left_val>-0.5629720091819763</left_val>
- <right_val>0.1664029955863953</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 18 14 -1.</_>
- <_>3 5 9 7 2.</_>
- <_>12 12 9 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0714159980416298</threshold>
- <left_val>-3.0000001424923539e-004</left_val>
- <right_val>-0.9328640103340149</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 6 4 18 -1.</_>
- <_>17 6 2 9 2.</_>
- <_>15 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.0999999772757292e-004</threshold>
- <left_val>-0.0953800007700920</left_val>
- <right_val>0.2518469989299774</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 4 18 -1.</_>
- <_>5 6 2 9 2.</_>
- <_>7 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.4090000018477440e-003</threshold>
- <left_val>-0.6549680233001709</left_val>
- <right_val>0.0673009976744652</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 6 9 -1.</_>
- <_>13 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0172540005296469</threshold>
- <left_val>-0.4649299979209900</left_val>
- <right_val>0.1607089936733246</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0186410006135702</threshold>
- <left_val>-1.0594010353088379</left_val>
- <right_val>-0.0196170005947351</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 5 6 9 -1.</_>
- <_>13 5 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.1979997232556343e-003</threshold>
- <left_val>0.5071619749069214</left_val>
- <right_val>-0.1533920019865036</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 6 6 -1.</_>
- <_>12 5 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0185380000621080</threshold>
- <left_val>-0.3049820065498352</left_val>
- <right_val>0.7350620031356812</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 16 6 -1.</_>
- <_>12 1 8 3 2.</_>
- <_>4 4 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0503350012004375</threshold>
- <left_val>-1.1140480041503906</left_val>
- <right_val>0.1800010055303574</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 13 6 11 -1.</_>
- <_>11 13 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0235290005803108</threshold>
- <left_val>-0.8690789937973023</left_val>
- <right_val>-0.0124599998816848</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 1 6 12 -1.</_>
- <_>20 1 3 6 2.</_>
- <_>17 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0271000005304813</threshold>
- <left_val>0.6594290137290955</left_val>
- <right_val>-0.0353239998221397</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 17 18 3 -1.</_>
- <_>1 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.5879998728632927e-003</threshold>
- <left_val>-0.2295340001583099</left_val>
- <right_val>0.4242509901523590</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 13 10 8 -1.</_>
- <_>7 17 10 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0233600009232759</threshold>
- <left_val>0.1835619956254959</left_val>
- <right_val>-0.9858729839324951</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 18 10 6 -1.</_>
- <_>6 20 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0129469996318221</threshold>
- <left_val>-0.3314740061759949</left_val>
- <right_val>0.2132319957017899</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 14 9 4 -1.</_>
- <_>9 16 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.6559999249875546e-003</threshold>
- <left_val>-0.1195140033960342</left_val>
- <right_val>0.2975279986858368</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 6 12 -1.</_>
- <_>1 1 3 6 2.</_>
- <_>4 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0225709993392229</threshold>
- <left_val>0.3849940001964569</left_val>
- <right_val>-0.2443449944257736</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 4 5 12 -1.</_>
- <_>19 8 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0638139992952347</threshold>
- <left_val>-0.8938350081443787</left_val>
- <right_val>0.1421750038862228</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 8 8 -1.</_>
- <_>4 0 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0499450005590916</threshold>
- <left_val>0.5386440157890320</left_val>
- <right_val>-0.2048529982566834</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 19 3 -1.</_>
- <_>3 6 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.8319998681545258e-003</threshold>
- <left_val>-0.0566789992153645</left_val>
- <right_val>0.3997099995613098</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 12 6 -1.</_>
- <_>1 5 6 3 2.</_>
- <_>7 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0558359995484352</threshold>
- <left_val>-1.5239470005035400</left_val>
- <right_val>-0.0511830002069473</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 1 21 8 -1.</_>
- <_>9 1 7 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.3195700049400330</threshold>
- <left_val>0.0745740011334419</left_val>
- <right_val>1.2447799444198608</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 16 8 -1.</_>
- <_>4 5 16 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0809559971094131</threshold>
- <left_val>-0.1966550052165985</left_val>
- <right_val>0.5988969802856445</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 18 3 -1.</_>
- <_>6 1 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0149119999259710</threshold>
- <left_val>-0.6402059793472290</left_val>
- <right_val>0.1580760031938553</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 10 14 -1.</_>
- <_>4 11 10 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0467090010643005</threshold>
- <left_val>0.0852390006184578</left_val>
- <right_val>-0.4548720121383667</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 6 4 10 -1.</_>
- <_>15 11 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.0539999976754189e-003</threshold>
- <left_val>-0.4318400025367737</left_val>
- <right_val>0.2245260030031204</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 18 3 -1.</_>
- <_>9 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0343759991228580</threshold>
- <left_val>0.4020250141620636</left_val>
- <right_val>-0.2390359938144684</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 12 6 -1.</_>
- <_>12 18 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0349240005016327</threshold>
- <left_val>0.5287010073661804</left_val>
- <right_val>0.0397090017795563</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 15 6 9 -1.</_>
- <_>6 15 3 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.0030000489205122e-003</threshold>
- <left_val>-0.3875429928302765</left_val>
- <right_val>0.1419260054826737</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 7 6 8 -1.</_>
- <_>15 11 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0141329998150468</threshold>
- <left_val>0.8752840161323547</left_val>
- <right_val>0.0855079963803291</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 6 8 -1.</_>
- <_>3 11 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.7940000444650650e-003</threshold>
- <left_val>-1.1649219989776611</left_val>
- <right_val>-0.0339430011808872</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 9 18 6 -1.</_>
- <_>14 9 9 3 2.</_>
- <_>5 12 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0528860017657280</threshold>
- <left_val>1.0930680036544800</left_val>
- <right_val>0.0511870011687279</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 12 6 -1.</_>
- <_>1 15 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.1079999860376120e-003</threshold>
- <left_val>0.1369619965553284</left_val>
- <right_val>-0.3384999930858612</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 10 6 -1.</_>
- <_>14 17 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0183530002832413</threshold>
- <left_val>0.1366160064935684</left_val>
- <right_val>-0.4077779948711395</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 10 6 -1.</_>
- <_>0 17 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0126719996333122</threshold>
- <left_val>-0.0149360001087189</left_val>
- <right_val>-0.8170750141143799</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 13 6 9 -1.</_>
- <_>15 16 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0129249999299645</threshold>
- <left_val>0.1762509942054749</left_val>
- <right_val>-0.3249169886112213</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 13 6 9 -1.</_>
- <_>3 16 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0179210007190704</threshold>
- <left_val>-0.5274540185928345</left_val>
- <right_val>0.0444430001080036</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 8 8 -1.</_>
- <_>9 5 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.9160000374540687e-003</threshold>
- <left_val>-0.1097859963774681</left_val>
- <right_val>0.2206750065088272</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 18 12 6 -1.</_>
- <_>1 18 6 3 2.</_>
- <_>7 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0146979996934533</threshold>
- <left_val>0.3906779885292053</left_val>
- <right_val>-0.2222499996423721</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 19 10 4 -1.</_>
- <_>13 21 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0149729996919632</threshold>
- <left_val>-0.2545090019702911</left_val>
- <right_val>0.1779000014066696</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 19 10 4 -1.</_>
- <_>1 21 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0146369999274611</threshold>
- <left_val>-0.0251250006258488</left_val>
- <right_val>-0.8712130188941956</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 19 18 3 -1.</_>
- <_>6 20 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0109740002080798</threshold>
- <left_val>0.7908279895782471</left_val>
- <right_val>0.0201210007071495</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 14 4 10 -1.</_>
- <_>8 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.1599998995661736e-003</threshold>
- <left_val>-0.4790689945220947</left_val>
- <right_val>0.0522320009768009</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 6 -1.</_>
- <_>0 2 24 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.6179997734725475e-003</threshold>
- <left_val>-0.1724459975957871</left_val>
- <right_val>0.3452779948711395</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 9 -1.</_>
- <_>0 4 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0234769992530346</threshold>
- <left_val>3.7760001141577959e-003</left_val>
- <right_val>-0.6533370018005371</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 9 20 6 -1.</_>
- <_>14 9 10 3 2.</_>
- <_>4 12 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0317669995129108</threshold>
- <left_val>0.0163640007376671</left_val>
- <right_val>0.5872370004653931</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 15 19 8 -1.</_>
- <_>1 19 19 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0184199996292591</threshold>
- <left_val>0.1999389976263046</left_val>
- <right_val>-0.3205649852752686</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 10 6 -1.</_>
- <_>14 2 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0195439998060465</threshold>
- <left_val>0.1845020055770874</left_val>
- <right_val>-0.2379360049962997</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 21 14 -1.</_>
- <_>8 10 7 14 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.4115949869155884</threshold>
- <left_val>-0.0603820011019707</left_val>
- <right_val>-1.6072119474411011</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 10 8 8 -1.</_>
- <_>10 10 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0415959991514683</threshold>
- <left_val>-0.3275620043277741</left_val>
- <right_val>0.1505800038576126</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 10 4 -1.</_>
- <_>11 8 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0103359995409846</threshold>
- <left_val>-0.6239439845085144</left_val>
- <right_val>0.0131120001897216</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 4 9 -1.</_>
- <_>10 5 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0123929996043444</threshold>
- <left_val>-0.0331149995326996</left_val>
- <right_val>0.5557990074157715</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 6 10 -1.</_>
- <_>9 5 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.7270000949501991e-003</threshold>
- <left_val>0.1988320052623749</left_val>
- <right_val>-0.3763560056686401</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 4 4 13 -1.</_>
- <_>14 4 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0162950009107590</threshold>
- <left_val>0.2037300020456314</left_val>
- <right_val>-0.4280079901218414</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 4 13 -1.</_>
- <_>8 4 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0104839997366071</threshold>
- <left_val>-0.5684700012207031</left_val>
- <right_val>0.0441990010440350</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 9 6 -1.</_>
- <_>11 7 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0124319996684790</threshold>
- <left_val>0.7464190125465393</left_val>
- <right_val>0.0436789989471436</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 16 6 -1.</_>
- <_>3 6 8 3 2.</_>
- <_>11 9 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0503749996423721</threshold>
- <left_val>0.8509010076522827</left_val>
- <right_val>-0.1777379959821701</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 16 14 -1.</_>
- <_>13 4 8 7 2.</_>
- <_>5 11 8 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0495480000972748</threshold>
- <left_val>0.1678490042686462</left_val>
- <right_val>-0.2987749874591827</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 4 -1.</_>
- <_>0 0 12 2 2.</_>
- <_>12 2 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0410850010812283</threshold>
- <left_val>-1.3302919864654541</left_val>
- <right_val>-0.0491820015013218</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 9 6 -1.</_>
- <_>12 1 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.0069999843835831e-003</threshold>
- <left_val>-0.0605389997363091</left_val>
- <right_val>0.1848320066928864</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 14 4 -1.</_>
- <_>11 1 7 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0501429997384548</threshold>
- <left_val>0.7644770145416260</left_val>
- <right_val>-0.1835699975490570</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 7 9 -1.</_>
- <_>10 17 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.7879998609423637e-003</threshold>
- <left_val>0.2265599966049194</left_val>
- <right_val>-0.0631569996476173</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 3 8 10 -1.</_>
- <_>8 3 4 5 2.</_>
- <_>12 8 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0501709990203381</threshold>
- <left_val>-1.5899070501327515</left_val>
- <right_val>-0.0612550005316734</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 3 12 5 -1.</_>
- <_>11 3 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1021609976887703</threshold>
- <left_val>0.1207180023193359</left_val>
- <right_val>-1.4120110273361206</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 4 13 -1.</_>
- <_>10 2 2 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0143729997798800</threshold>
- <left_val>-1.3116970062255859</left_val>
- <right_val>-0.0519360005855560</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 2 3 19 -1.</_>
- <_>12 2 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0102819995954633</threshold>
- <left_val>-2.1639999467879534e-003</left_val>
- <right_val>0.4424720108509064</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 9 6 -1.</_>
- <_>10 7 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0118140000849962</threshold>
- <left_val>0.6537809967994690</left_val>
- <right_val>-0.1872369945049286</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 22 20 2 -1.</_>
- <_>4 22 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0721149966120720</threshold>
- <left_val>0.0718469992280006</left_val>
- <right_val>0.8149629831314087</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 24 4 -1.</_>
- <_>0 16 12 2 2.</_>
- <_>12 18 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0190019998699427</threshold>
- <left_val>-0.6742720007896423</left_val>
- <right_val>-4.3200000072829425e-004</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 3 12 5 -1.</_>
- <_>11 3 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.6990001574158669e-003</threshold>
- <left_val>0.3331150114536285</left_val>
- <right_val>0.0557940006256104</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 8 14 -1.</_>
- <_>1 10 4 7 2.</_>
- <_>5 17 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0581570006906986</threshold>
- <left_val>0.4557229876518250</left_val>
- <right_val>-0.2030510008335114</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 16 6 6 -1.</_>
- <_>11 19 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.1360000353306532e-003</threshold>
- <left_val>-0.0446869991719723</left_val>
- <right_val>0.2268189936876297</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 10 24 -1.</_>
- <_>6 0 5 12 2.</_>
- <_>11 12 5 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0494149997830391</threshold>
- <left_val>0.2669459879398346</left_val>
- <right_val>-0.2611699998378754</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 14 14 -1.</_>
- <_>14 5 7 7 2.</_>
- <_>7 12 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1191380023956299</threshold>
- <left_val>-0.8301799893379211</left_val>
- <right_val>0.1324850022792816</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 10 8 -1.</_>
- <_>7 8 5 4 2.</_>
- <_>12 12 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0183039996773005</threshold>
- <left_val>-0.6749920248985291</left_val>
- <right_val>0.0170920006930828</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 9 6 -1.</_>
- <_>12 1 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.9199997708201408e-003</threshold>
- <left_val>-0.0722870007157326</left_val>
- <right_val>0.1442580074071884</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 24 3 -1.</_>
- <_>12 6 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0519259981811047</threshold>
- <left_val>0.0309219993650913</left_val>
- <right_val>-0.5586060285568237</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 3 12 5 -1.</_>
- <_>11 3 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0667240023612976</threshold>
- <left_val>0.1366640031337738</left_val>
- <right_val>-0.2941100001335144</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 22 4 -1.</_>
- <_>1 13 11 2 2.</_>
- <_>12 15 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0137780001387000</threshold>
- <left_val>-0.5944390296936035</left_val>
- <right_val>0.0153000000864267</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 12 6 -1.</_>
- <_>9 14 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0177609995007515</threshold>
- <left_val>0.4049650132656097</left_val>
- <right_val>-3.3559999428689480e-003</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 9 6 -1.</_>
- <_>0 7 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0422349981963634</threshold>
- <left_val>-1.0897940397262573</left_val>
- <right_val>-0.0402249991893768</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 23 6 -1.</_>
- <_>1 7 23 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0135249998420477</threshold>
- <left_val>0.2892189919948578</left_val>
- <right_val>-0.2519479990005493</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 6 19 12 -1.</_>
- <_>1 10 19 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0111060002818704</threshold>
- <left_val>0.6531280279159546</left_val>
- <right_val>-0.1805370002985001</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 6 21 -1.</_>
- <_>9 8 6 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1228459998965263</threshold>
- <left_val>-1.9570649862289429</left_val>
- <right_val>0.1481540054082871</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 19 18 3 -1.</_>
- <_>9 19 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0477159991860390</threshold>
- <left_val>-0.2287559956312180</left_val>
- <right_val>0.3423370122909546</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 14 6 9 -1.</_>
- <_>11 14 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0318170003592968</threshold>
- <left_val>0.1597629934549332</left_val>
- <right_val>-1.0091969966888428</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 4 12 -1.</_>
- <_>11 6 2 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.2570000514388084e-003</threshold>
- <left_val>-0.3888129889965057</left_val>
- <right_val>0.0842100009322166</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 0 6 9 -1.</_>
- <_>18 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0613729991018772</threshold>
- <left_val>1.7152810096740723</left_val>
- <right_val>0.0593249984085560</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 6 9 -1.</_>
- <_>4 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.7030000928789377e-003</threshold>
- <left_val>-0.3816170096397400</left_val>
- <right_val>0.0851270034909248</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 1 4 22 -1.</_>
- <_>15 1 2 11 2.</_>
- <_>13 12 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0685440003871918</threshold>
- <left_val>-3.0925889015197754</left_val>
- <right_val>0.1178800016641617</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 8 8 12 -1.</_>
- <_>1 14 8 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1037250012159348</threshold>
- <left_val>-0.1376930028200150</left_val>
- <right_val>1.9009410142898560</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 7 7 9 -1.</_>
- <_>14 10 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0157990008592606</threshold>
- <left_val>-0.0626600012183189</left_val>
- <right_val>0.2591769993305206</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 12 18 4 -1.</_>
- <_>3 12 9 2 2.</_>
- <_>12 14 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.8040001466870308e-003</threshold>
- <left_val>-0.5629159808158875</left_val>
- <right_val>0.0439230017364025</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 1 4 22 -1.</_>
- <_>15 1 2 11 2.</_>
- <_>13 12 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.0229995548725128e-003</threshold>
- <left_val>0.2528710067272186</left_val>
- <right_val>-0.0412259995937347</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 4 22 -1.</_>
- <_>7 1 2 11 2.</_>
- <_>9 12 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0637549981474876</threshold>
- <left_val>-2.6178569793701172</left_val>
- <right_val>-0.0740059986710548</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 20 4 -1.</_>
- <_>14 7 10 2 2.</_>
- <_>4 9 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0389549992978573</threshold>
- <left_val>0.0590329989790916</left_val>
- <right_val>0.8594560027122498</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 10 6 7 -1.</_>
- <_>12 10 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0398029983043671</threshold>
- <left_val>0.9360049962997437</left_val>
- <right_val>-0.1563940048217773</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 10 4 -1.</_>
- <_>7 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0503019988536835</threshold>
- <left_val>0.1372590065002441</left_val>
- <right_val>-2.5549728870391846</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 4 15 -1.</_>
- <_>0 8 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0462500005960464</threshold>
- <left_val>-0.0139640001580119</left_val>
- <right_val>-0.7102620005607605</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 8 12 -1.</_>
- <_>19 0 4 6 2.</_>
- <_>15 6 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0621960014104843</threshold>
- <left_val>0.0595260001718998</left_val>
- <right_val>1.6509100198745728</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 8 12 -1.</_>
- <_>1 0 4 6 2.</_>
- <_>5 6 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0647760033607483</threshold>
- <left_val>0.7136899828910828</left_val>
- <right_val>-0.1727000027894974</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 5 6 16 -1.</_>
- <_>16 5 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0275229997932911</threshold>
- <left_val>0.1463160067796707</left_val>
- <right_val>-0.0814289972186089</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 5 6 16 -1.</_>
- <_>6 5 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.9900001138448715e-004</threshold>
- <left_val>-0.3714450001716614</left_val>
- <right_val>0.1015269979834557</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 6 16 -1.</_>
- <_>17 0 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.3299999088048935e-003</threshold>
- <left_val>-0.2375629991292954</left_val>
- <right_val>0.2679840028285980</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 6 16 -1.</_>
- <_>5 0 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0472970008850098</threshold>
- <left_val>-0.0276820007711649</left_val>
- <right_val>-0.8491029739379883</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 24 3 -1.</_>
- <_>0 3 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0125089995563030</threshold>
- <left_val>0.1873019933700562</left_val>
- <right_val>-0.5600110292434692</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 10 4 -1.</_>
- <_>7 3 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0458990000188351</threshold>
- <left_val>-0.1560119986534119</left_val>
- <right_val>0.9707300066947937</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 23 8 -1.</_>
- <_>1 4 23 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1985339969396591</threshold>
- <left_val>0.1489550024271011</left_val>
- <right_val>-1.1015529632568359</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 17 19 3 -1.</_>
- <_>1 18 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0166749991476536</threshold>
- <left_val>-0.1661529988050461</left_val>
- <right_val>0.8221099972724915</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 18 18 2 -1.</_>
- <_>6 19 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.9829999655485153e-003</threshold>
- <left_val>-0.0712499991059303</left_val>
- <right_val>0.2881090044975281</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 17 9 6 -1.</_>
- <_>1 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0224479995667934</threshold>
- <left_val>-0.0209810007363558</left_val>
- <right_val>-0.7841650247573853</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 15 6 9 -1.</_>
- <_>15 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0139130000025034</threshold>
- <left_val>-0.1816579997539520</left_val>
- <right_val>0.2049179971218109</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 15 6 9 -1.</_>
- <_>3 18 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.7659999951720238e-003</threshold>
- <left_val>-0.4559589922428131</left_val>
- <right_val>0.0635769963264465</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 14 20 6 -1.</_>
- <_>4 17 20 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0132090002298355</threshold>
- <left_val>0.2663230001926422</left_val>
- <right_val>-0.1779599934816361</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 6 14 -1.</_>
- <_>0 10 3 7 2.</_>
- <_>3 17 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0490529984235764</threshold>
- <left_val>-0.1547680050134659</left_val>
- <right_val>1.1069979667663574</right_val></_></_>
- <_>
- <!-- tree 137 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 18 18 3 -1.</_>
- <_>6 19 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0202639997005463</threshold>
- <left_val>0.0689150020480156</left_val>
- <right_val>0.6986749768257141</right_val></_></_>
- <_>
- <!-- tree 138 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 9 7 -1.</_>
- <_>7 12 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0168280005455017</threshold>
- <left_val>0.2760719954967499</left_val>
- <right_val>-0.2513920068740845</right_val></_></_>
- <_>
- <!-- tree 139 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 10 18 5 -1.</_>
- <_>12 10 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1693949997425079</threshold>
- <left_val>-3.0767529010772705</left_val>
- <right_val>0.1161750033497810</right_val></_></_>
- <_>
- <!-- tree 140 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 18 5 -1.</_>
- <_>6 10 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1133610010147095</threshold>
- <left_val>-1.4639229774475098</left_val>
- <right_val>-0.0514470003545284</right_val></_></_>
- <_>
- <!-- tree 141 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 18 9 -1.</_>
- <_>9 2 6 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0776859968900681</threshold>
- <left_val>0.8843020200729370</left_val>
- <right_val>0.0433069989085197</right_val></_></_>
- <_>
- <!-- tree 142 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 10 10 -1.</_>
- <_>4 6 5 5 2.</_>
- <_>9 11 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0155680002644658</threshold>
- <left_val>0.1367249935865402</left_val>
- <right_val>-0.3450550138950348</right_val></_></_>
- <_>
- <!-- tree 143 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 14 4 9 -1.</_>
- <_>20 14 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0660189986228943</threshold>
- <left_val>-1.0300110578536987</left_val>
- <right_val>0.1160139963030815</right_val></_></_>
- <_>
- <!-- tree 144 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 4 9 -1.</_>
- <_>2 14 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.3699999377131462e-003</threshold>
- <left_val>0.0764290019869804</left_val>
- <right_val>-0.4400250017642975</right_val></_></_>
- <_>
- <!-- tree 145 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 4 20 -1.</_>
- <_>13 1 2 10 2.</_>
- <_>11 11 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0354029983282089</threshold>
- <left_val>0.1197950020432472</left_val>
- <right_val>-0.7266830205917358</right_val></_></_>
- <_>
- <!-- tree 146 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 21 12 3 -1.</_>
- <_>12 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0390510000288486</threshold>
- <left_val>0.6737530231475830</left_val>
- <right_val>-0.1819600015878677</right_val></_></_>
- <_>
- <!-- tree 147 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 4 20 -1.</_>
- <_>13 1 2 10 2.</_>
- <_>11 11 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.7899995744228363e-003</threshold>
- <left_val>0.2126459926366806</left_val>
- <right_val>0.0367560014128685</right_val></_></_>
- <_>
- <!-- tree 148 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 16 10 8 -1.</_>
- <_>1 16 5 4 2.</_>
- <_>6 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0230470001697540</threshold>
- <left_val>0.4474219977855682</left_val>
- <right_val>-0.2098670005798340</right_val></_></_>
- <_>
- <!-- tree 149 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 4 20 -1.</_>
- <_>13 1 2 10 2.</_>
- <_>11 11 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.1169999856501818e-003</threshold>
- <left_val>0.0375440008938313</left_val>
- <right_val>0.2780820131301880</right_val></_></_>
- <_>
- <!-- tree 150 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 3 19 -1.</_>
- <_>2 0 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0131360003724694</threshold>
- <left_val>-0.1984239965677261</left_val>
- <right_val>0.5433570146560669</right_val></_></_>
- <_>
- <!-- tree 151 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 4 20 -1.</_>
- <_>13 1 2 10 2.</_>
- <_>11 11 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0147820003330708</threshold>
- <left_val>0.1353060007095337</left_val>
- <right_val>-0.1115360036492348</right_val></_></_>
- <_>
- <!-- tree 152 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 9 -1.</_>
- <_>2 1 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0601390004158020</threshold>
- <left_val>0.8403930068016052</left_val>
- <right_val>-0.1671160012483597</right_val></_></_>
- <_>
- <!-- tree 153 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 19 4 -1.</_>
- <_>3 9 19 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0519989989697933</threshold>
- <left_val>0.1737200021743774</left_val>
- <right_val>-0.7854760289192200</right_val></_></_>
- <_>
- <!-- tree 154 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 14 9 6 -1.</_>
- <_>7 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0247920006513596</threshold>
- <left_val>-0.1773920059204102</left_val>
- <right_val>0.6675260066986084</right_val></_></_>
- <_>
- <!-- tree 155 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 1 7 6 -1.</_>
- <_>17 4 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0120149999856949</threshold>
- <left_val>-0.1426369994878769</left_val>
- <right_val>0.1607050001621246</right_val></_></_>
- <_>
- <!-- tree 156 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 14 8 -1.</_>
- <_>5 4 14 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0986559987068176</threshold>
- <left_val>1.0429769754409790</left_val>
- <right_val>-0.1577019989490509</right_val></_></_>
- <_>
- <!-- tree 157 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 1 8 6 -1.</_>
- <_>16 4 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1175829991698265</threshold>
- <left_val>0.1095570027828217</left_val>
- <right_val>-4.4920377731323242</right_val></_></_>
- <_>
- <!-- tree 158 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 8 6 -1.</_>
- <_>0 4 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0189229995012283</threshold>
- <left_val>-0.7854340076446533</left_val>
- <right_val>0.0129840001463890</right_val></_></_>
- <_>
- <!-- tree 159 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 18 4 -1.</_>
- <_>15 0 9 2 2.</_>
- <_>6 2 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0283909998834133</threshold>
- <left_val>-0.6056990027427673</left_val>
- <right_val>0.1290349960327148</right_val></_></_>
- <_>
- <!-- tree 160 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 9 6 -1.</_>
- <_>0 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0131829995661974</threshold>
- <left_val>-0.0144159998744726</left_val>
- <right_val>-0.7321050167083740</right_val></_></_>
- <_>
- <!-- tree 161 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 18 8 -1.</_>
- <_>9 7 6 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1165300011634827</threshold>
- <left_val>-2.0442469120025635</left_val>
- <right_val>0.1405310034751892</right_val></_></_>
- <_>
- <!-- tree 162 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 6 9 -1.</_>
- <_>4 11 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.8880000356584787e-003</threshold>
- <left_val>-0.4186159968376160</left_val>
- <right_val>0.0787049978971481</right_val></_></_>
- <_>
- <!-- tree 163 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 6 9 -1.</_>
- <_>12 5 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0312290005385876</threshold>
- <left_val>0.0246329996734858</left_val>
- <right_val>0.4187040030956268</right_val></_></_>
- <_>
- <!-- tree 164 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 18 -1.</_>
- <_>10 6 2 9 2.</_>
- <_>12 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0251989997923374</threshold>
- <left_val>-0.1755779981613159</left_val>
- <right_val>0.6471059918403626</right_val></_></_>
- <_>
- <!-- tree 165 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 1 4 20 -1.</_>
- <_>13 1 2 10 2.</_>
- <_>11 11 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0281240008771420</threshold>
- <left_val>-0.2200559973716736</left_val>
- <right_val>0.1412100046873093</right_val></_></_>
- <_>
- <!-- tree 166 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 4 20 -1.</_>
- <_>9 1 2 10 2.</_>
- <_>11 11 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0364990010857582</threshold>
- <left_val>-0.0684269964694977</left_val>
- <right_val>-2.3410849571228027</right_val></_></_>
- <_>
- <!-- tree 167 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 9 18 6 -1.</_>
- <_>14 9 9 3 2.</_>
- <_>5 12 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0722929984331131</threshold>
- <left_val>1.2898750305175781</left_val>
- <right_val>0.0848750025033951</right_val></_></_>
- <_>
- <!-- tree 168 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 6 9 -1.</_>
- <_>8 4 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0416710004210472</threshold>
- <left_val>-1.1630970239639282</left_val>
- <right_val>-0.0537529997527599</right_val></_></_>
- <_>
- <!-- tree 169 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 16 8 6 -1.</_>
- <_>10 16 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0477030016481876</threshold>
- <left_val>0.0701010003685951</left_val>
- <right_val>0.7367650270462036</right_val></_></_>
- <_>
- <!-- tree 170 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 18 8 -1.</_>
- <_>0 0 9 4 2.</_>
- <_>9 4 9 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0657930001616478</threshold>
- <left_val>-0.1775529980659485</left_val>
- <right_val>0.6978049874305725</right_val></_></_>
- <_>
- <!-- tree 171 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 14 12 -1.</_>
- <_>13 5 7 6 2.</_>
- <_>6 11 7 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0139049999415874</threshold>
- <left_val>0.2193679958581924</left_val>
- <right_val>-0.2039079964160919</right_val></_></_>
- <_>
- <!-- tree 172 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 15 7 -1.</_>
- <_>9 3 5 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0277309995144606</threshold>
- <left_val>0.6186789870262146</left_val>
- <right_val>-0.1780409961938858</right_val></_></_>
- <_>
- <!-- tree 173 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 12 10 6 -1.</_>
- <_>14 14 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0158799998462200</threshold>
- <left_val>-0.4648410081863403</left_val>
- <right_val>0.1882860064506531</right_val></_></_>
- <_>
- <!-- tree 174 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 4 10 -1.</_>
- <_>0 16 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0741280019283295</threshold>
- <left_val>-0.1285810023546219</left_val>
- <right_val>3.2792479991912842</right_val></_></_>
- <_>
- <!-- tree 175 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 22 3 -1.</_>
- <_>1 11 22 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.9000002481043339e-004</threshold>
- <left_val>-0.3011760115623474</left_val>
- <right_val>0.2381879985332489</right_val></_></_>
- <_>
- <!-- tree 176 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 9 6 10 -1.</_>
- <_>10 9 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0179650001227856</threshold>
- <left_val>-0.2228499948978424</left_val>
- <right_val>0.2995400130748749</right_val></_></_>
- <_>
- <!-- tree 177 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 2 6 12 -1.</_>
- <_>16 2 3 6 2.</_>
- <_>13 8 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.5380000006407499e-003</threshold>
- <left_val>0.2506439983844757</left_val>
- <right_val>-0.1366560012102127</right_val></_></_>
- <_>
- <!-- tree 178 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 18 -1.</_>
- <_>10 6 2 9 2.</_>
- <_>12 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.0680001303553581e-003</threshold>
- <left_val>0.2901749908924103</left_val>
- <right_val>-0.2892970144748688</right_val></_></_>
- <_>
- <!-- tree 179 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 10 16 -1.</_>
- <_>12 8 5 8 2.</_>
- <_>7 16 5 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0491699986159801</threshold>
- <left_val>0.1915639936923981</left_val>
- <right_val>-0.6832870244979858</right_val></_></_>
- <_>
- <!-- tree 180 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 8 12 -1.</_>
- <_>8 1 4 6 2.</_>
- <_>12 7 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0306809991598129</threshold>
- <left_val>-0.7567700147628784</left_val>
- <right_val>-0.0132799996063113</right_val></_></_>
- <_>
- <!-- tree 181 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 12 14 -1.</_>
- <_>13 1 6 7 2.</_>
- <_>7 8 6 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1001740023493767</threshold>
- <left_val>0.0844539999961853</left_val>
- <right_val>1.0888710021972656</right_val></_></_>
- <_>
- <!-- tree 182 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 14 12 6 -1.</_>
- <_>2 16 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.1950001139193773e-003</threshold>
- <left_val>-0.2691940069198608</left_val>
- <right_val>0.1953790038824081</right_val></_></_>
- <_>
- <!-- tree 183 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 16 6 6 -1.</_>
- <_>11 19 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0355030000209808</threshold>
- <left_val>0.1363230049610138</left_val>
- <right_val>-0.5691720247268677</right_val></_></_>
- <_>
- <!-- tree 184 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 16 6 6 -1.</_>
- <_>7 19 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.5900000259280205e-004</threshold>
- <left_val>-0.4044399857521057</left_val>
- <right_val>0.1407479941844940</right_val></_></_>
- <_>
- <!-- tree 185 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 4 4 10 -1.</_>
- <_>13 4 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0252589993178844</threshold>
- <left_val>0.1624320000410080</left_val>
- <right_val>-0.5574179887771606</right_val></_></_>
- <_>
- <!-- tree 186 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 19 19 3 -1.</_>
- <_>0 20 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.1549999043345451e-003</threshold>
- <left_val>0.3113259971141815</left_val>
- <right_val>-0.2275609970092773</right_val></_></_>
- <_>
- <!-- tree 187 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 8 6 8 -1.</_>
- <_>12 12 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.5869999770075083e-003</threshold>
- <left_val>-0.2686769962310791</left_val>
- <right_val>0.1956540048122406</right_val></_></_>
- <_>
- <!-- tree 188 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 8 22 -1.</_>
- <_>8 12 8 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0162049997597933</threshold>
- <left_val>0.1548649966716766</left_val>
- <right_val>-0.3405779898166657</right_val></_></_>
- <_>
- <!-- tree 189 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 8 6 8 -1.</_>
- <_>12 12 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0296240001916885</threshold>
- <left_val>1.1466799974441528</left_val>
- <right_val>0.0905579999089241</right_val></_></_>
- <_>
- <!-- tree 190 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 6 8 -1.</_>
- <_>6 12 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.5930000226944685e-003</threshold>
- <left_val>-0.7125750184059143</left_val>
- <right_val>-7.0400000549852848e-004</right_val></_></_>
- <_>
- <!-- tree 191 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 5 6 9 -1.</_>
- <_>14 8 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0540190003812313</threshold>
- <left_val>0.4153749942779541</left_val>
- <right_val>0.0272460002452135</right_val></_></_>
- <_>
- <!-- tree 192 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 24 4 -1.</_>
- <_>0 8 24 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0662110000848770</threshold>
- <left_val>-1.3340090513229370</left_val>
- <right_val>-0.0473529994487762</right_val></_></_>
- <_>
- <!-- tree 193 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 12 10 6 -1.</_>
- <_>14 14 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0279409997165203</threshold>
- <left_val>0.1444630026817322</left_val>
- <right_val>-0.5151839852333069</right_val></_></_>
- <_>
- <!-- tree 194 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 10 6 -1.</_>
- <_>0 14 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0289570000022650</threshold>
- <left_val>-0.0499660000205040</left_val>
- <right_val>-1.1929039955139160</right_val></_></_>
- <_>
- <!-- tree 195 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 19 3 -1.</_>
- <_>4 7 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0204249992966652</threshold>
- <left_val>0.6388130187988281</left_val>
- <right_val>0.0381410010159016</right_val></_></_>
- <_>
- <!-- tree 196 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 6 19 3 -1.</_>
- <_>1 7 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0124169997870922</threshold>
- <left_val>-0.2154700011014938</left_val>
- <right_val>0.4947769939899445</right_val></_></_></trees>
- <stage_threshold>-3.2772979736328125</stage_threshold>
- <parent>19</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 21 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 16 9 -1.</_>
- <_>4 3 16 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0432740002870560</threshold>
- <left_val>-0.8049439787864685</left_val>
- <right_val>0.3989729881286621</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 5 -1.</_>
- <_>8 1 8 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1861550062894821</threshold>
- <left_val>-0.3165529966354370</left_val>
- <right_val>0.6887729763984680</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 6 15 -1.</_>
- <_>3 11 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0318609997630119</threshold>
- <left_val>-0.6426619887351990</left_val>
- <right_val>0.2555089890956879</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0140220001339912</threshold>
- <left_val>-0.4592660069465637</left_val>
- <right_val>0.3117119967937470</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 18 3 -1.</_>
- <_>0 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.3029997982084751e-003</threshold>
- <left_val>0.4602690041065216</left_val>
- <right_val>-0.2743850052356720</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 22 18 2 -1.</_>
- <_>6 23 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.4310001432895660e-003</threshold>
- <left_val>0.3660860061645508</left_val>
- <right_val>-0.2720580101013184</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 6 9 -1.</_>
- <_>2 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0168229993432760</threshold>
- <left_val>0.0234769992530346</left_val>
- <right_val>-0.8844379782676697</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 12 6 9 -1.</_>
- <_>18 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0260390006005764</threshold>
- <left_val>0.1748879998922348</left_val>
- <right_val>-0.5456470251083374</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 6 9 -1.</_>
- <_>0 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0267200004309416</threshold>
- <left_val>-0.9639649987220764</left_val>
- <right_val>0.0235249996185303</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 14 4 10 -1.</_>
- <_>11 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0170419998466969</threshold>
- <left_val>-0.7084879875183106</left_val>
- <right_val>0.2146809995174408</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 16 -1.</_>
- <_>9 14 6 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.9569999575614929e-003</threshold>
- <left_val>0.0736010000109673</left_val>
- <right_val>-0.6822559833526611</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 10 10 -1.</_>
- <_>7 12 10 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.8679999522864819e-003</threshold>
- <left_val>-0.7493500113487244</left_val>
- <right_val>0.2380339950323105</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 3 6 13 -1.</_>
- <_>3 3 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0437749996781349</threshold>
- <left_val>0.6832330226898193</left_val>
- <right_val>-0.2138029932975769</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 1 6 13 -1.</_>
- <_>18 1 3 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0516330003738403</threshold>
- <left_val>-0.1256649941205978</left_val>
- <right_val>0.6752380132675171</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 1 6 9 -1.</_>
- <_>7 1 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.1780003383755684e-003</threshold>
- <left_val>0.0706899985671043</left_val>
- <right_val>-0.8066589832305908</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 2 6 11 -1.</_>
- <_>18 2 3 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0528419986367226</threshold>
- <left_val>0.9543390274047852</left_val>
- <right_val>0.0165480002760887</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 11 -1.</_>
- <_>3 2 3 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0525839999318123</threshold>
- <left_val>-0.2841440141201019</left_val>
- <right_val>0.4712980091571808</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 15 6 -1.</_>
- <_>9 14 15 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0126590002328157</threshold>
- <left_val>0.3844540119171143</left_val>
- <right_val>-0.0622880011796951</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 20 3 -1.</_>
- <_>2 3 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0116940001025796</threshold>
- <left_val>5.6000000768108293e-005</left_val>
- <right_val>-1.0173139572143555</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 9 -1.</_>
- <_>10 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0239189993590117</threshold>
- <left_val>0.8492130041122437</left_val>
- <right_val>5.7399999350309372e-003</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 12 14 -1.</_>
- <_>5 6 6 7 2.</_>
- <_>11 13 6 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0616739988327026</threshold>
- <left_val>-0.9257140159606934</left_val>
- <right_val>-1.7679999582469463e-003</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 9 -1.</_>
- <_>11 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.8279999494552612e-003</threshold>
- <left_val>-0.5437229871749878</left_val>
- <right_val>0.2493239939212799</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 9 6 -1.</_>
- <_>10 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0352579988539219</threshold>
- <left_val>-7.3719997890293598e-003</left_val>
- <right_val>-0.9396399855613709</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 6 9 -1.</_>
- <_>12 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0184380002319813</threshold>
- <left_val>0.7213670015335083</left_val>
- <right_val>0.0104919997975230</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 12 20 -1.</_>
- <_>4 1 6 10 2.</_>
- <_>10 11 6 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0383890010416508</threshold>
- <left_val>0.1927260011434555</left_val>
- <right_val>-0.3583210110664368</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 18 3 -1.</_>
- <_>6 7 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0997209995985031</threshold>
- <left_val>0.1135419979691505</left_val>
- <right_val>-1.6304190158843994</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 18 3 -1.</_>
- <_>9 7 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0844620019197464</threshold>
- <left_val>-0.0534209981560707</left_val>
- <right_val>-1.6981120109558105</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 20 18 3 -1.</_>
- <_>9 20 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0402700006961823</threshold>
- <left_val>-0.1078319996595383</left_val>
- <right_val>0.5192660093307495</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0589359998703003</threshold>
- <left_val>-0.1805370002985001</left_val>
- <right_val>0.9511979818344116</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 2 12 15 -1.</_>
- <_>10 2 4 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1495700031518936</threshold>
- <left_val>0.1678529977798462</left_val>
- <right_val>-1.1591869592666626</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 3 18 3 -1.</_>
- <_>2 4 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.9399998756125569e-004</threshold>
- <left_val>0.2049140036106110</left_val>
- <right_val>-0.3311820030212402</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 4 4 18 -1.</_>
- <_>21 4 2 9 2.</_>
- <_>19 13 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0333690010011196</threshold>
- <left_val>0.9346809983253479</left_val>
- <right_val>-2.9639999847859144e-003</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 19 3 -1.</_>
- <_>0 2 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.3759996816515923e-003</threshold>
- <left_val>3.7000000011175871e-003</left_val>
- <right_val>-0.7754979729652405</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 15 4 -1.</_>
- <_>5 2 15 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0431939996778965</threshold>
- <left_val>-2.2040000185370445e-003</left_val>
- <right_val>0.7458969950675964</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 14 5 -1.</_>
- <_>12 2 7 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0675550028681755</threshold>
- <left_val>0.7229210138320923</left_val>
- <right_val>-0.1840420067310333</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 22 14 -1.</_>
- <_>1 2 11 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.3116860091686249</threshold>
- <left_val>1.0014270544052124</left_val>
- <right_val>0.0340030007064343</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 15 6 9 -1.</_>
- <_>10 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0297439992427826</threshold>
- <left_val>-0.0463560000061989</left_val>
- <right_val>-1.2781809568405151</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 17 18 3 -1.</_>
- <_>6 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0107370000332594</threshold>
- <left_val>0.0148120000958443</left_val>
- <right_val>0.6664999723434448</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 3 18 -1.</_>
- <_>9 12 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0288410000503063</threshold>
- <left_val>-0.9422259926795960</left_val>
- <right_val>-0.0207969993352890</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 20 3 -1.</_>
- <_>2 1 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.7649998925626278e-003</threshold>
- <left_val>-0.4354189932346344</left_val>
- <right_val>0.2338600009679794</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 5 12 -1.</_>
- <_>5 8 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0284109991043806</threshold>
- <left_val>-0.1761579960584641</left_val>
- <right_val>0.8576530218124390</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 12 5 -1.</_>
- <_>12 6 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0290079992264509</threshold>
- <left_val>0.5797809958457947</left_val>
- <right_val>0.0285659991204739</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 12 -1.</_>
- <_>9 12 3 6 2.</_>
- <_>12 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0249659996479750</threshold>
- <left_val>-0.0227290000766516</left_val>
- <right_val>-0.9677309989929199</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 14 8 10 -1.</_>
- <_>18 14 4 5 2.</_>
- <_>14 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0120360003784299</threshold>
- <left_val>-0.1421470046043396</left_val>
- <right_val>0.5168799757957459</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 14 8 10 -1.</_>
- <_>2 14 4 5 2.</_>
- <_>6 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0425140000879765</threshold>
- <left_val>0.9727380275726318</left_val>
- <right_val>-0.1811980009078980</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 18 12 6 -1.</_>
- <_>16 18 6 3 2.</_>
- <_>10 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0102760000154376</threshold>
- <left_val>-0.0830999985337257</left_val>
- <right_val>0.3176279962062836</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 3 6 9 -1.</_>
- <_>1 6 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0691919997334480</threshold>
- <left_val>-2.0668580532073975</left_val>
- <right_val>-0.0601739995181561</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 3 3 20 -1.</_>
- <_>12 3 1 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.6769999898970127e-003</threshold>
- <left_val>0.4413180053234100</left_val>
- <right_val>0.0232090000063181</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 14 6 -1.</_>
- <_>4 6 7 3 2.</_>
- <_>11 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0139239998534322</threshold>
- <left_val>0.2860670089721680</left_val>
- <right_val>-0.2915270030498505</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 12 13 -1.</_>
- <_>10 5 4 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0153339998796582</threshold>
- <left_val>-0.5741450190544128</left_val>
- <right_val>0.2306330054998398</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 4 15 -1.</_>
- <_>5 9 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0102390004321933</threshold>
- <left_val>0.3447920083999634</left_val>
- <right_val>-0.2608039975166321</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 16 15 4 -1.</_>
- <_>14 16 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0509889982640743</threshold>
- <left_val>0.5615410208702087</left_val>
- <right_val>0.0612189993262291</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 6 14 -1.</_>
- <_>7 8 3 7 2.</_>
- <_>10 15 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0306899994611740</threshold>
- <left_val>-0.1477279961109161</left_val>
- <right_val>1.6378489732742310</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 10 6 -1.</_>
- <_>7 8 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0112239997833967</threshold>
- <left_val>0.2400619983673096</left_val>
- <right_val>-0.4486489892005920</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 18 3 -1.</_>
- <_>2 6 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.2899999320507050e-003</threshold>
- <left_val>0.4311949908733368</left_val>
- <right_val>-0.2380899935960770</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 1 15 8 -1.</_>
- <_>5 5 15 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0785909965634346</threshold>
- <left_val>0.0198650006204844</left_val>
- <right_val>0.8085380196571350</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 8 18 -1.</_>
- <_>7 10 8 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0101789999753237</threshold>
- <left_val>0.1819320023059845</left_val>
- <right_val>-0.3287779986858368</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 24 3 -1.</_>
- <_>0 11 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0312270000576973</threshold>
- <left_val>0.1497389972209930</left_val>
- <right_val>-1.4180339574813843</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 13 -1.</_>
- <_>2 2 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0401969999074936</threshold>
- <left_val>-0.1976049989461899</left_val>
- <right_val>0.5850819945335388</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 0 8 10 -1.</_>
- <_>20 0 4 5 2.</_>
- <_>16 5 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0161380004137754</threshold>
- <left_val>5.0000002374872565e-004</left_val>
- <right_val>0.3905000090599060</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 1 10 9 -1.</_>
- <_>5 4 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0455190017819405</threshold>
- <left_val>1.2646820545196533</left_val>
- <right_val>-0.1563259959220886</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 18 3 -1.</_>
- <_>5 7 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0181300006806850</threshold>
- <left_val>0.6514850258827210</left_val>
- <right_val>0.0102359997108579</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 3 -1.</_>
- <_>0 2 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0140019999817014</threshold>
- <left_val>-1.0344820022583008</left_val>
- <right_val>-0.0321829989552498</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 4 6 11 -1.</_>
- <_>13 4 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0388160012662411</threshold>
- <left_val>-0.4787429869174957</left_val>
- <right_val>0.1629070043563843</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 8 10 -1.</_>
- <_>0 0 4 5 2.</_>
- <_>4 5 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0316560007631779</threshold>
- <left_val>-0.2098339945077896</left_val>
- <right_val>0.5457590222358704</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 16 18 3 -1.</_>
- <_>4 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0108399996533990</threshold>
- <left_val>0.5189880132675171</left_val>
- <right_val>-0.0150800002738833</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 16 18 3 -1.</_>
- <_>2 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0120329996570945</threshold>
- <left_val>-0.2110760062932968</left_val>
- <right_val>0.7593700289726257</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 18 10 -1.</_>
- <_>12 0 9 5 2.</_>
- <_>3 5 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0707729980349541</threshold>
- <left_val>0.1804880052804947</left_val>
- <right_val>-0.7404850125312805</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 3 20 21 -1.</_>
- <_>12 3 10 21 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.5313979983329773</threshold>
- <left_val>-0.1449169963598251</left_val>
- <right_val>1.5360039472579956</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 14 3 -1.</_>
- <_>6 7 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0147740002721548</threshold>
- <left_val>-0.2815369963645935</left_val>
- <right_val>0.2040729969739914</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 12 6 -1.</_>
- <_>0 9 6 3 2.</_>
- <_>6 12 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.2410000674426556e-003</threshold>
- <left_val>-0.4487630128860474</left_val>
- <right_val>0.0539890006184578</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 14 21 4 -1.</_>
- <_>10 14 7 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0499680005013943</threshold>
- <left_val>0.0415140017867088</left_val>
- <right_val>0.2941710054874420</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 21 4 -1.</_>
- <_>7 14 7 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0477019995450974</threshold>
- <left_val>0.3967429995536804</left_val>
- <right_val>-0.2830179929733276</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 21 18 3 -1.</_>
- <_>11 21 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0913110002875328</threshold>
- <left_val>2.1994259357452393</left_val>
- <right_val>0.0879649966955185</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 21 18 3 -1.</_>
- <_>7 21 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0380700007081032</threshold>
- <left_val>-0.2802560031414032</left_val>
- <right_val>0.2515619993209839</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 4 4 18 -1.</_>
- <_>21 4 2 9 2.</_>
- <_>19 13 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0155389998108149</threshold>
- <left_val>0.3415749967098236</left_val>
- <right_val>0.0179249998182058</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 7 18 3 -1.</_>
- <_>3 8 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0154459998011589</threshold>
- <left_val>0.2868019938468933</left_val>
- <right_val>-0.2513589859008789</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 4 4 18 -1.</_>
- <_>21 4 2 9 2.</_>
- <_>19 13 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0573880001902580</threshold>
- <left_val>0.6383000016212463</left_val>
- <right_val>0.0885979980230331</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 15 10 6 -1.</_>
- <_>7 17 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.9440000914037228e-003</threshold>
- <left_val>0.0790169984102249</left_val>
- <right_val>-0.4077489972114563</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 13 11 9 -1.</_>
- <_>9 16 11 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0699689984321594</threshold>
- <left_val>-0.4464420080184937</left_val>
- <right_val>0.1721960008144379</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 4 10 -1.</_>
- <_>0 11 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0250649992376566</threshold>
- <left_val>-0.9827020168304443</left_val>
- <right_val>-0.0353880003094673</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 16 9 6 -1.</_>
- <_>15 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0172160007059574</threshold>
- <left_val>0.2270590066909790</left_val>
- <right_val>-0.8055009841918945</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 4 18 -1.</_>
- <_>1 5 2 9 2.</_>
- <_>3 14 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0442790016531944</threshold>
- <left_val>0.8395199775695801</left_val>
- <right_val>-0.1742960065603256</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 8 10 -1.</_>
- <_>13 8 4 5 2.</_>
- <_>9 13 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0439889989793301</threshold>
- <left_val>0.1155719980597496</left_val>
- <right_val>-1.9666889905929565</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 8 10 -1.</_>
- <_>7 8 4 5 2.</_>
- <_>11 13 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0159070007503033</threshold>
- <left_val>-0.0375760011374950</left_val>
- <right_val>-1.0311100482940674</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 12 5 -1.</_>
- <_>13 8 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0927549973130226</threshold>
- <left_val>-1.3530019521713257</left_val>
- <right_val>0.1214129999279976</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 9 7 -1.</_>
- <_>10 8 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0710370019078255</threshold>
- <left_val>-0.1768430024385452</left_val>
- <right_val>0.7448520064353943</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 12 5 -1.</_>
- <_>13 8 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0577620007097721</threshold>
- <left_val>0.1283559948205948</left_val>
- <right_val>-0.4444420039653778</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 9 7 -1.</_>
- <_>10 6 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0164320003241301</threshold>
- <left_val>0.8015270233154297</left_val>
- <right_val>-0.1749169975519180</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 12 5 -1.</_>
- <_>13 8 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0239390004426241</threshold>
- <left_val>0.1614499986171722</left_val>
- <right_val>-0.1236450001597405</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 4 18 -1.</_>
- <_>10 11 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0126360002905130</threshold>
- <left_val>0.1541199982166290</left_val>
- <right_val>-0.3329379856586456</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 14 12 -1.</_>
- <_>5 11 14 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0543479993939400</threshold>
- <left_val>-1.8400700092315674</left_val>
- <right_val>0.1483599990606308</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 11 4 -1.</_>
- <_>0 3 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0132619999349117</threshold>
- <left_val>-0.8083879947662354</left_val>
- <right_val>-0.0277260001748800</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 10 6 10 -1.</_>
- <_>11 10 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.1340001411736012e-003</threshold>
- <left_val>-0.1378500014543533</left_val>
- <right_val>0.3285849988460541</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 17 11 6 -1.</_>
- <_>2 19 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0289910007268190</threshold>
- <left_val>-0.0255169998854399</left_val>
- <right_val>-0.8338720202445984</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 16 9 6 -1.</_>
- <_>15 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0219860002398491</threshold>
- <left_val>-0.7373999953269959</left_val>
- <right_val>0.1788710057735443</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 18 2 -1.</_>
- <_>1 11 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.3269998170435429e-003</threshold>
- <left_val>-0.4544929862022400</left_val>
- <right_val>0.0687910020351410</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 13 -1.</_>
- <_>10 4 4 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0860479995608330</threshold>
- <left_val>0.2100850045681000</left_val>
- <right_val>-0.3780890107154846</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 18 18 3 -1.</_>
- <_>0 19 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.5549997165799141e-003</threshold>
- <left_val>0.4013499915599823</left_val>
- <right_val>-0.2107409983873367</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 18 18 3 -1.</_>
- <_>6 19 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.7790001630783081e-003</threshold>
- <left_val>-0.0216489993035793</left_val>
- <right_val>0.4542149901390076</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 9 6 -1.</_>
- <_>0 18 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.3959998078644276e-003</threshold>
- <left_val>-0.4981859922409058</left_val>
- <right_val>0.0759079977869987</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 15 9 6 -1.</_>
- <_>13 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.9469999074935913e-003</threshold>
- <left_val>0.1785770058631897</left_val>
- <right_val>-0.2845489978790283</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 15 9 6 -1.</_>
- <_>2 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.2589999027550220e-003</threshold>
- <left_val>0.0466249994933605</left_val>
- <right_val>-0.5520629882812500</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 1 6 16 -1.</_>
- <_>13 1 3 16 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0414769984781742</threshold>
- <left_val>0.1755049973726273</left_val>
- <right_val>-0.2070399969816208</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 1 6 16 -1.</_>
- <_>8 1 3 16 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.7449999041855335e-003</threshold>
- <left_val>-0.4639259874820709</left_val>
- <right_val>0.0693039968609810</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 5 6 10 -1.</_>
- <_>13 5 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0305649992078543</threshold>
- <left_val>0.0517349988222122</left_val>
- <right_val>0.7555050253868103</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 6 10 -1.</_>
- <_>9 5 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.4780001305043697e-003</threshold>
- <left_val>0.1489389985799789</left_val>
- <right_val>-0.3190680146217346</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 6 24 -1.</_>
- <_>12 0 2 24 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0890889987349510</threshold>
- <left_val>0.1373880058526993</left_val>
- <right_val>-1.1379710435867310</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 4 20 -1.</_>
- <_>3 4 2 10 2.</_>
- <_>5 14 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.3230001144111156e-003</threshold>
- <left_val>-0.2882919907569885</left_val>
- <right_val>0.1908860057592392</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 6 9 -1.</_>
- <_>16 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0182050000876188</threshold>
- <left_val>-0.3017860054969788</left_val>
- <right_val>0.1679580062627792</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 6 9 -1.</_>
- <_>6 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0258280001580715</threshold>
- <left_val>-0.9813799858093262</left_val>
- <right_val>-0.0198609996587038</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 5 18 5 -1.</_>
- <_>10 5 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1093619987368584</threshold>
- <left_val>0.0487900003790855</left_val>
- <right_val>0.5311830043792725</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 6 9 -1.</_>
- <_>7 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0114249996840954</threshold>
- <left_val>0.2370599955320358</left_val>
- <right_val>-0.2792530059814453</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 2 15 8 -1.</_>
- <_>12 2 5 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0575659982860088</threshold>
- <left_val>0.4725539982318878</left_val>
- <right_val>0.0651710033416748</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 15 8 -1.</_>
- <_>7 2 5 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1027830019593239</threshold>
- <left_val>-0.2076510041952133</left_val>
- <right_val>0.5094770193099976</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 4 9 -1.</_>
- <_>10 0 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0270419996231794</threshold>
- <left_val>0.1642120033502579</left_val>
- <right_val>-1.4508620500564575</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 6 12 -1.</_>
- <_>3 4 3 6 2.</_>
- <_>6 10 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0136350002139807</threshold>
- <left_val>-0.5654389858245850</left_val>
- <right_val>0.0237889997661114</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 0 8 18 -1.</_>
- <_>16 0 4 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.3215819895267487</threshold>
- <left_val>-3.5602829456329346</left_val>
- <right_val>0.1180130019783974</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 8 18 -1.</_>
- <_>4 0 4 18 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2045810073614121</threshold>
- <left_val>-0.0370160005986691</left_val>
- <right_val>-1.0225499868392944</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 24 6 -1.</_>
- <_>0 9 24 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0703470036387444</threshold>
- <left_val>-0.5649189949035645</left_val>
- <right_val>0.1852519959211350</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 14 3 -1.</_>
- <_>11 7 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0378310009837151</threshold>
- <left_val>-0.0299019999802113</left_val>
- <right_val>-0.8292149901390076</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 8 8 15 -1.</_>
- <_>10 8 4 15 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0702980011701584</threshold>
- <left_val>-0.5317230224609375</left_val>
- <right_val>0.1443019956350327</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 10 14 -1.</_>
- <_>12 0 5 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0632210001349449</threshold>
- <left_val>-0.2204120010137558</left_val>
- <right_val>0.4795219898223877</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 10 8 10 -1.</_>
- <_>17 10 4 5 2.</_>
- <_>13 15 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0363930016756058</threshold>
- <left_val>0.1422269940376282</left_val>
- <right_val>-0.6119390130043030</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 4 9 -1.</_>
- <_>5 0 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.0099998004734516e-003</threshold>
- <left_val>-0.3456079959869385</left_val>
- <right_val>0.1173869967460632</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 1 6 8 -1.</_>
- <_>16 1 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0491060018539429</threshold>
- <left_val>0.9598410129547119</left_val>
- <right_val>0.0649349987506866</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 1 6 8 -1.</_>
- <_>5 1 3 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0715830028057098</threshold>
- <left_val>1.7385669946670532</left_val>
- <right_val>-0.1425289958715439</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 12 -1.</_>
- <_>3 10 18 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0380089990794659</threshold>
- <left_val>1.3872820138931274</left_val>
- <right_val>0.0661880001425743</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 16 4 -1.</_>
- <_>4 14 16 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.1570000573992729e-003</threshold>
- <left_val>0.0536770001053810</left_val>
- <right_val>-0.5404800176620483</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 9 16 15 -1.</_>
- <_>4 14 16 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0194589998573065</threshold>
- <left_val>-0.0936200022697449</left_val>
- <right_val>0.3913100063800812</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 8 10 -1.</_>
- <_>3 10 4 5 2.</_>
- <_>7 15 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0112939998507500</threshold>
- <left_val>0.0372239984571934</left_val>
- <right_val>-0.5425180196762085</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 16 6 -1.</_>
- <_>16 18 8 3 2.</_>
- <_>8 21 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0334950014948845</threshold>
- <left_val>0.9530789852142334</left_val>
- <right_val>0.0376969985663891</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 16 12 5 -1.</_>
- <_>6 16 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0920350030064583</threshold>
- <left_val>-0.1348839998245239</left_val>
- <right_val>2.2897069454193115</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 14 9 4 -1.</_>
- <_>14 16 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.7529999390244484e-003</threshold>
- <left_val>0.2282419949769974</left_val>
- <right_val>-0.5998370051383972</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 14 9 6 -1.</_>
- <_>7 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0128480000421405</threshold>
- <left_val>-0.2200520038604736</left_val>
- <right_val>0.3722189962863922</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 10 16 12 -1.</_>
- <_>4 14 16 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1431619971990585</threshold>
- <left_val>1.2855789661407471</left_val>
- <right_val>0.0472370013594627</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 19 6 -1.</_>
- <_>0 15 19 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0968799963593483</threshold>
- <left_val>-3.9550929069519043</left_val>
- <right_val>-0.0729039981961250</right_val></_></_>
- <_>
- <!-- tree 137 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 13 9 6 -1.</_>
- <_>10 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.8459998369216919e-003</threshold>
- <left_val>0.3767499923706055</left_val>
- <right_val>-0.0464840009808540</right_val></_></_>
- <_>
- <!-- tree 138 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 3 23 -1.</_>
- <_>6 0 1 23 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0159000009298325</threshold>
- <left_val>-0.0244570001959801</left_val>
- <right_val>-0.8003479838371277</right_val></_></_>
- <_>
- <!-- tree 139 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 24 6 -1.</_>
- <_>0 10 24 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0703720003366470</threshold>
- <left_val>0.1701900064945221</left_val>
- <right_val>-0.6306899785995483</right_val></_></_>
- <_>
- <!-- tree 140 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 5 12 -1.</_>
- <_>0 9 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0379539988934994</threshold>
- <left_val>-0.9366719722747803</left_val>
- <right_val>-0.0412140004336834</right_val></_></_>
- <_>
- <!-- tree 141 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 19 18 -1.</_>
- <_>3 9 19 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.5159789919853210</threshold>
- <left_val>0.1308059990406036</left_val>
- <right_val>-1.5802290439605713</right_val></_></_>
- <_>
- <!-- tree 142 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 11 6 12 -1.</_>
- <_>9 11 3 6 2.</_>
- <_>12 17 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0328430011868477</threshold>
- <left_val>-1.1441620588302612</left_val>
- <right_val>-0.0491739995777607</right_val></_></_>
- <_>
- <!-- tree 143 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 24 8 -1.</_>
- <_>12 5 12 4 2.</_>
- <_>0 9 12 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0363570004701614</threshold>
- <left_val>0.4960640072822571</left_val>
- <right_val>-0.0344589985907078</right_val></_></_>
- <_>
- <!-- tree 144 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 18 9 4 -1.</_>
- <_>6 20 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.8080001510679722e-003</threshold>
- <left_val>-0.3099780082702637</left_val>
- <right_val>0.1705480068922043</right_val></_></_>
- <_>
- <!-- tree 145 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 10 6 -1.</_>
- <_>8 10 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0161140002310276</threshold>
- <left_val>-0.3790459930896759</left_val>
- <right_val>0.1607899963855743</right_val></_></_>
- <_>
- <!-- tree 146 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 20 3 -1.</_>
- <_>2 8 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.4530003368854523e-003</threshold>
- <left_val>-0.1865549981594086</left_val>
- <right_val>0.5636770129203796</right_val></_></_>
- <_>
- <!-- tree 147 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 7 20 -1.</_>
- <_>12 10 7 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1375239938497543</threshold>
- <left_val>-0.5898990035057068</left_val>
- <right_val>0.1174950003623962</right_val></_></_>
- <_>
- <!-- tree 148 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 7 20 -1.</_>
- <_>5 10 7 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1768800020217896</threshold>
- <left_val>-0.1542489975690842</left_val>
- <right_val>0.9291110038757324</right_val></_></_>
- <_>
- <!-- tree 149 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 2 2 18 -1.</_>
- <_>14 11 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.9309996217489243e-003</threshold>
- <left_val>0.3219070136547089</left_val>
- <right_val>-0.1639260053634644</right_val></_></_>
- <_>
- <!-- tree 150 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 10 12 -1.</_>
- <_>10 8 5 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1097180023789406</threshold>
- <left_val>-0.1587650030851364</left_val>
- <right_val>1.0186259746551514</right_val></_></_>
- <_>
- <!-- tree 151 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 12 8 -1.</_>
- <_>12 9 6 4 2.</_>
- <_>6 13 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0302930008620024</threshold>
- <left_val>0.7558730244636536</left_val>
- <right_val>0.0317949987947941</right_val></_></_>
- <_>
- <!-- tree 152 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 3 14 -1.</_>
- <_>7 14 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0231180004775524</threshold>
- <left_val>-0.8845149874687195</left_val>
- <right_val>-9.5039997249841690e-003</right_val></_></_>
- <_>
- <!-- tree 153 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 2 12 16 -1.</_>
- <_>17 2 6 8 2.</_>
- <_>11 10 6 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.0900000128895044e-003</threshold>
- <left_val>0.2383829951286316</left_val>
- <right_val>-0.1160620003938675</right_val></_></_>
- <_>
- <!-- tree 154 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 6 9 -1.</_>
- <_>9 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0333920009434223</threshold>
- <left_val>-1.8738139867782593</left_val>
- <right_val>-0.0685029998421669</right_val></_></_>
- <_>
- <!-- tree 155 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 14 9 4 -1.</_>
- <_>13 16 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0131900003179908</threshold>
- <left_val>0.1291989982128143</left_val>
- <right_val>-0.6751220226287842</right_val></_></_>
- <_>
- <!-- tree 156 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 22 4 -1.</_>
- <_>0 12 11 2 2.</_>
- <_>11 14 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0146610001102090</threshold>
- <left_val>-0.0248290002346039</left_val>
- <right_val>-0.7439680099487305</right_val></_></_>
- <_>
- <!-- tree 157 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 12 22 6 -1.</_>
- <_>12 12 11 3 2.</_>
- <_>1 15 11 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0132480002939701</threshold>
- <left_val>0.4682019948959351</left_val>
- <right_val>-0.0241650007665157</right_val></_></_>
- <_>
- <!-- tree 158 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 9 6 -1.</_>
- <_>9 6 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0162189994007349</threshold>
- <left_val>0.4008379876613617</left_val>
- <right_val>-0.2125570029020309</right_val></_></_>
- <_>
- <!-- tree 159 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 4 9 -1.</_>
- <_>10 0 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0290520004928112</threshold>
- <left_val>-1.5650019645690918</left_val>
- <right_val>0.1437589973211289</right_val></_></_>
- <_>
- <!-- tree 160 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 8 18 7 -1.</_>
- <_>9 8 6 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1015319973230362</threshold>
- <left_val>-1.9220689535140991</left_val>
- <right_val>-0.0695599988102913</right_val></_></_>
- <_>
- <!-- tree 161 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 24 6 -1.</_>
- <_>0 8 24 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0377539992332459</threshold>
- <left_val>0.1339679956436157</left_val>
- <right_val>-2.2639141082763672</right_val></_></_>
- <_>
- <!-- tree 162 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 24 10 -1.</_>
- <_>8 11 8 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2855559885501862</threshold>
- <left_val>1.0215270519256592</left_val>
- <right_val>-0.1523219943046570</right_val></_></_>
- <_>
- <!-- tree 163 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 3 18 21 -1.</_>
- <_>9 3 6 21 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1536069959402084</threshold>
- <left_val>-0.0974090024828911</left_val>
- <right_val>0.4166240096092224</right_val></_></_>
- <_>
- <!-- tree 164 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 12 4 10 -1.</_>
- <_>9 12 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.1199999901000410e-004</threshold>
- <left_val>0.1127189993858337</left_val>
- <right_val>-0.4165399968624115</right_val></_></_>
- <_>
- <!-- tree 165 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 16 10 8 -1.</_>
- <_>15 16 5 4 2.</_>
- <_>10 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0205979999154806</threshold>
- <left_val>0.6054049730300903</left_val>
- <right_val>0.0624679997563362</right_val></_></_>
- <_>
- <!-- tree 166 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 6 9 -1.</_>
- <_>10 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0373539999127388</threshold>
- <left_val>-0.1891900002956390</left_val>
- <right_val>0.4646469950675964</right_val></_></_>
- <_>
- <!-- tree 167 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 10 6 12 -1.</_>
- <_>15 10 3 6 2.</_>
- <_>12 16 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0572750009596348</threshold>
- <left_val>0.1156530007719994</left_val>
- <right_val>-1.3213009834289551</right_val></_></_>
- <_>
- <!-- tree 168 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 10 6 12 -1.</_>
- <_>6 10 3 6 2.</_>
- <_>9 16 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.1029999740421772e-003</threshold>
- <left_val>-0.2806150019168854</left_val>
- <right_val>0.1931339949369431</right_val></_></_>
- <_>
- <!-- tree 169 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 12 6 12 -1.</_>
- <_>19 12 3 6 2.</_>
- <_>16 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0546449981629848</threshold>
- <left_val>0.7242850065231323</left_val>
- <right_val>0.0754479989409447</right_val></_></_>
- <_>
- <!-- tree 170 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 6 12 -1.</_>
- <_>2 12 3 6 2.</_>
- <_>5 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0253490004688501</threshold>
- <left_val>-0.1948180049657822</left_val>
- <right_val>0.4603280127048492</right_val></_></_>
- <_>
- <!-- tree 171 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 15 6 9 -1.</_>
- <_>12 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0243110004812479</threshold>
- <left_val>0.1556410044431686</left_val>
- <right_val>-0.4991390109062195</right_val></_></_>
- <_>
- <!-- tree 172 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 15 6 9 -1.</_>
- <_>10 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0359620004892349</threshold>
- <left_val>-0.0585730001330376</left_val>
- <right_val>-1.5418399572372437</right_val></_></_>
- <_>
- <!-- tree 173 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 20 10 4 -1.</_>
- <_>14 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1000069975852966</threshold>
- <left_val>-1.6100039482116699</left_val>
- <right_val>0.1145050004124641</right_val></_></_>
- <_>
- <!-- tree 174 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 20 10 4 -1.</_>
- <_>5 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0844359993934631</threshold>
- <left_val>-0.0614069998264313</left_val>
- <right_val>-1.4673349857330322</right_val></_></_>
- <_>
- <!-- tree 175 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 17 9 6 -1.</_>
- <_>11 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0159479994326830</threshold>
- <left_val>0.1628790050745010</left_val>
- <right_val>-0.1102640032768250</right_val></_></_>
- <_>
- <!-- tree 176 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 14 4 -1.</_>
- <_>3 4 14 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0338240005075932</threshold>
- <left_val>-0.1793269962072372</left_val>
- <right_val>0.5721840262413025</right_val></_></_>
- <_>
- <!-- tree 177 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 1 10 4 -1.</_>
- <_>10 3 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0619960017502308</threshold>
- <left_val>4.6511812210083008</left_val>
- <right_val>0.0945340022444725</right_val></_></_>
- <_>
- <!-- tree 178 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 10 4 -1.</_>
- <_>5 15 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0698769986629486</threshold>
- <left_val>-0.1698590070009232</left_val>
- <right_val>0.8702899813652039</right_val></_></_>
- <_>
- <!-- tree 179 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 2 3 19 -1.</_>
- <_>20 2 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0279169995337725</threshold>
- <left_val>0.9104250073432922</left_val>
- <right_val>0.0568270012736321</right_val></_></_>
- <_>
- <!-- tree 180 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 9 8 -1.</_>
- <_>7 12 3 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0127640003338456</threshold>
- <left_val>0.2206670045852661</left_val>
- <right_val>-0.2776910066604614</right_val></_></_></trees>
- <stage_threshold>-3.3196411132812500</stage_threshold>
- <parent>20</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 22 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 5 12 -1.</_>
- <_>4 11 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0216620005667210</threshold>
- <left_val>-0.8986889719963074</left_val>
- <right_val>0.2943629920482636</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 3 -1.</_>
- <_>8 1 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1004450023174286</threshold>
- <left_val>-0.3765920102596283</left_val>
- <right_val>0.6089100241661072</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 12 4 -1.</_>
- <_>6 10 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0260039996355772</threshold>
- <left_val>-0.3812850117683411</left_val>
- <right_val>0.3921740055084229</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 3 4 10 -1.</_>
- <_>19 3 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0284410007297993</threshold>
- <left_val>-0.1818230003118515</left_val>
- <right_val>0.5892720222473145</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 9 6 -1.</_>
- <_>3 6 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0386120006442070</threshold>
- <left_val>-0.2239959985017777</left_val>
- <right_val>0.6377999782562256</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 0 6 22 -1.</_>
- <_>20 0 2 22 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0465949997305870</threshold>
- <left_val>0.7081220149993897</left_val>
- <right_val>-0.1466619968414307</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 22 -1.</_>
- <_>2 0 2 22 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0427919998764992</threshold>
- <left_val>0.4768039882183075</left_val>
- <right_val>-0.2923319935798645</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 15 19 3 -1.</_>
- <_>5 16 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.7960000336170197e-003</threshold>
- <left_val>-0.1851029992103577</left_val>
- <right_val>0.5262669920921326</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 7 4 15 -1.</_>
- <_>10 12 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0423489995300770</threshold>
- <left_val>0.0392449982464314</left_val>
- <right_val>-0.8919770121574402</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0195989999920130</threshold>
- <left_val>-0.2335840016603470</left_val>
- <right_val>0.4414649903774262</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 21 18 3 -1.</_>
- <_>0 22 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.7400001939386129e-004</threshold>
- <left_val>-0.4606359899044037</left_val>
- <right_val>0.1768960058689117</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 3 10 15 -1.</_>
- <_>7 8 10 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.3629999272525311e-003</threshold>
- <left_val>0.3349319994449616</left_val>
- <right_val>-0.2989340126514435</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 7 18 3 -1.</_>
- <_>1 8 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0169730000197887</threshold>
- <left_val>-0.1640869975090027</left_val>
- <right_val>1.5993679761886597</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 9 6 -1.</_>
- <_>11 2 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0360639989376068</threshold>
- <left_val>0.2260169982910156</left_val>
- <right_val>-0.5318610072135925</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 24 14 -1.</_>
- <_>0 17 24 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0708649978041649</threshold>
- <left_val>0.1522050052881241</left_val>
- <right_val>-0.4191460013389587</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 9 8 10 -1.</_>
- <_>17 9 4 5 2.</_>
- <_>13 14 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0630759969353676</threshold>
- <left_val>-1.4874019622802734</left_val>
- <right_val>0.1295370012521744</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 4 9 -1.</_>
- <_>12 5 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0296700000762939</threshold>
- <left_val>-0.1914590001106262</left_val>
- <right_val>0.9818490147590637</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 9 8 10 -1.</_>
- <_>17 9 4 5 2.</_>
- <_>13 14 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0378739982843399</threshold>
- <left_val>0.1345950067043304</left_val>
- <right_val>-0.5631629824638367</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 11 10 10 -1.</_>
- <_>7 11 5 5 2.</_>
- <_>12 16 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0332890003919601</threshold>
- <left_val>-1.0828030109405518</left_val>
- <right_val>-0.0115040000528097</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 18 4 -1.</_>
- <_>13 13 9 2 2.</_>
- <_>4 15 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0316089987754822</threshold>
- <left_val>-0.5922449827194214</left_val>
- <right_val>0.1339479982852936</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 19 2 -1.</_>
- <_>0 1 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.0740000288933516e-003</threshold>
- <left_val>-0.4918580055236816</left_val>
- <right_val>0.0944460034370422</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 18 24 6 -1.</_>
- <_>8 18 8 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0715560019016266</threshold>
- <left_val>0.5971019864082336</left_val>
- <right_val>-0.0395530015230179</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 8 16 -1.</_>
- <_>6 12 8 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0811700001358986</threshold>
- <left_val>-1.1817820072174072</left_val>
- <right_val>-0.0282540004700422</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 10 4 -1.</_>
- <_>7 10 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.4860001653432846e-003</threshold>
- <left_val>-0.6102809906005859</left_val>
- <right_val>0.2261909991502762</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 9 -1.</_>
- <_>0 6 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0421760007739067</threshold>
- <left_val>-1.1435619592666626</left_val>
- <right_val>-0.0290019996464252</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 15 7 9 -1.</_>
- <_>13 18 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0656400024890900</threshold>
- <left_val>-1.6470279693603516</left_val>
- <right_val>0.1281030029058456</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 12 6 -1.</_>
- <_>3 18 6 3 2.</_>
- <_>9 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0181889999657869</threshold>
- <left_val>-0.3114939928054810</left_val>
- <right_val>0.2573960125446320</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 14 6 9 -1.</_>
- <_>12 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0515200011432171</threshold>
- <left_val>-0.6920689940452576</left_val>
- <right_val>0.1527079939842224</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 15 15 8 -1.</_>
- <_>2 19 15 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0471509993076324</threshold>
- <left_val>-0.7186830043792725</left_val>
- <right_val>2.6879999786615372e-003</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 16 -1.</_>
- <_>9 14 6 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0174889992922544</threshold>
- <left_val>0.2237119972705841</left_val>
- <right_val>-0.5538179874420166</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 7 12 -1.</_>
- <_>6 10 7 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0252640005201101</threshold>
- <left_val>1.0319819450378418</left_val>
- <right_val>-0.1749649941921234</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 6 6 9 -1.</_>
- <_>14 9 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0407450012862682</threshold>
- <left_val>0.4496159851551056</left_val>
- <right_val>0.0393490009009838</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 14 6 9 -1.</_>
- <_>5 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0376669988036156</threshold>
- <left_val>-0.8547570109367371</left_val>
- <right_val>-0.0124639999121428</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 8 6 9 -1.</_>
- <_>12 8 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0134110003709793</threshold>
- <left_val>0.5784559845924377</left_val>
- <right_val>-0.0174679998308420</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 4 18 -1.</_>
- <_>6 6 2 9 2.</_>
- <_>8 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.8999997640494257e-005</threshold>
- <left_val>-0.3774920105934143</left_val>
- <right_val>0.1396179944276810</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 9 6 12 -1.</_>
- <_>17 9 3 6 2.</_>
- <_>14 15 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0114150000736117</threshold>
- <left_val>-0.2618660032749176</left_val>
- <right_val>0.2371249943971634</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 9 6 12 -1.</_>
- <_>4 9 3 6 2.</_>
- <_>7 15 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0372000001370907</threshold>
- <left_val>-0.0286260005086660</left_val>
- <right_val>-1.2945239543914795</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 15 9 6 -1.</_>
- <_>14 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.4050000831484795e-003</threshold>
- <left_val>0.2053139954805374</left_val>
- <right_val>-0.1874749958515167</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 20 18 4 -1.</_>
- <_>0 20 9 2 2.</_>
- <_>9 22 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0224830005317926</threshold>
- <left_val>0.6702719926834106</left_val>
- <right_val>-0.1959400027990341</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 18 9 6 -1.</_>
- <_>13 20 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0232749991118908</threshold>
- <left_val>0.1740539968013763</left_val>
- <right_val>-0.3274630010128021</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 18 9 6 -1.</_>
- <_>2 20 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0139170000329614</threshold>
- <left_val>-0.8395429849624634</left_val>
- <right_val>-6.3760001212358475e-003</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 18 3 -1.</_>
- <_>6 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.5429999269545078e-003</threshold>
- <left_val>-0.0341949984431267</left_val>
- <right_val>0.5899819731712341</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 18 3 -1.</_>
- <_>0 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0115390000864863</threshold>
- <left_val>0.4214279949665070</left_val>
- <right_val>-0.2351049929857254</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 2 4 22 -1.</_>
- <_>21 2 2 11 2.</_>
- <_>19 13 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0525019988417625</threshold>
- <left_val>0.0693039968609810</left_val>
- <right_val>0.7322649955749512</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 2 4 22 -1.</_>
- <_>1 2 2 11 2.</_>
- <_>3 13 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0527159981429577</threshold>
- <left_val>-0.1568810045719147</left_val>
- <right_val>1.0907289981842041</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 2 24 -1.</_>
- <_>15 0 1 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0117260003462434</threshold>
- <left_val>-0.7093430161476135</left_val>
- <right_val>0.1682880073785782</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 20 16 4 -1.</_>
- <_>11 20 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0959459990262985</threshold>
- <left_val>-0.1619289964437485</left_val>
- <right_val>1.0072519779205322</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 4 18 -1.</_>
- <_>13 6 2 9 2.</_>
- <_>11 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0158719997853041</threshold>
- <left_val>0.3900839984416962</left_val>
- <right_val>-0.0537770017981529</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 9 10 14 -1.</_>
- <_>7 9 5 7 2.</_>
- <_>12 16 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0348180010914803</threshold>
- <left_val>0.0171799995005131</left_val>
- <right_val>-0.9394180178642273</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 6 6 9 -1.</_>
- <_>14 9 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0347919985651970</threshold>
- <left_val>0.0504629984498024</left_val>
- <right_val>0.5446569919586182</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 7 9 -1.</_>
- <_>3 9 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0162840001285076</threshold>
- <left_val>-0.2698130011558533</left_val>
- <right_val>0.4036529958248138</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 4 4 20 -1.</_>
- <_>22 4 2 10 2.</_>
- <_>20 14 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0443190000951290</threshold>
- <left_val>0.8439999818801880</left_val>
- <right_val>0.0328829996287823</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 6 9 -1.</_>
- <_>7 9 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.5689997971057892e-003</threshold>
- <left_val>0.1530939936637878</left_val>
- <right_val>-0.3495979905128479</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 10 14 -1.</_>
- <_>12 0 5 7 2.</_>
- <_>7 7 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0658420026302338</threshold>
- <left_val>-0.9271119832992554</left_val>
- <right_val>0.1680099964141846</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 1 18 6 -1.</_>
- <_>11 1 9 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0733370035886765</threshold>
- <left_val>0.5161449909210205</left_val>
- <right_val>-0.2023600041866303</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 2 24 -1.</_>
- <_>15 0 1 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0164500009268522</threshold>
- <left_val>0.1395059973001480</left_val>
- <right_val>-0.4930129945278168</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 2 24 -1.</_>
- <_>8 0 1 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.2630004510283470e-003</threshold>
- <left_val>-0.9010199904441834</left_val>
- <right_val>-0.0161160007119179</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 12 6 7 -1.</_>
- <_>13 12 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.9139998629689217e-003</threshold>
- <left_val>0.1985819935798645</left_val>
- <right_val>-0.1673129945993424</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 12 6 7 -1.</_>
- <_>8 12 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.4699998842552304e-004</threshold>
- <left_val>0.0940050035715103</left_val>
- <right_val>-0.4157089889049530</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 18 19 -1.</_>
- <_>9 5 6 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2053290009498596</threshold>
- <left_val>-0.0600220002233982</left_val>
- <right_val>0.7099360227584839</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 9 6 -1.</_>
- <_>8 6 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0168830007314682</threshold>
- <left_val>0.2439219951629639</left_val>
- <right_val>-0.3055180013179779</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 9 6 -1.</_>
- <_>12 5 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0191110000014305</threshold>
- <left_val>0.6122990250587463</left_val>
- <right_val>0.0242529995739460</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 16 10 8 -1.</_>
- <_>3 16 5 4 2.</_>
- <_>8 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0259629990905523</threshold>
- <left_val>0.9076499938964844</left_val>
- <right_val>-0.1672209948301315</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 8 5 15 -1.</_>
- <_>19 13 5 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0217620003968477</threshold>
- <left_val>-0.3138470053672791</left_val>
- <right_val>0.2013459950685501</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 5 15 -1.</_>
- <_>0 13 5 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0241199992597103</threshold>
- <left_val>-0.6658840179443359</left_val>
- <right_val>7.4559999629855156e-003</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 4 4 20 -1.</_>
- <_>22 4 2 10 2.</_>
- <_>20 14 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0471299998462200</threshold>
- <left_val>0.0595339983701706</left_val>
- <right_val>0.8780450224876404</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 4 20 -1.</_>
- <_>0 4 2 10 2.</_>
- <_>2 14 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0459849983453751</threshold>
- <left_val>0.8006799817085266</left_val>
- <right_val>-0.1725230067968369</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 10 4 -1.</_>
- <_>7 7 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0265079997479916</threshold>
- <left_val>0.1877409964799881</left_val>
- <right_val>-0.6085060238838196</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 19 14 4 -1.</_>
- <_>11 19 7 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0486150011420250</threshold>
- <left_val>0.5864409804344177</left_val>
- <right_val>-0.1942770034074783</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 11 12 3 -1.</_>
- <_>10 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0185620002448559</threshold>
- <left_val>-0.2558790147304535</left_val>
- <right_val>0.1632619947195053</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 3 -1.</_>
- <_>0 2 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0126780001446605</threshold>
- <left_val>-0.0142280003055930</left_val>
- <right_val>-0.7673810124397278</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 2 14 20 -1.</_>
- <_>14 2 7 10 2.</_>
- <_>7 12 7 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.1919999960809946e-003</threshold>
- <left_val>0.2049500048160553</left_val>
- <right_val>-0.1140429973602295</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 6 9 -1.</_>
- <_>2 13 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0490889996290207</threshold>
- <left_val>-1.0740849971771240</left_val>
- <right_val>-0.0389409996569157</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 4 19 -1.</_>
- <_>13 0 2 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0174369998276234</threshold>
- <left_val>-0.5797380208969116</left_val>
- <right_val>0.1858450025320053</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 11 14 3 -1.</_>
- <_>8 11 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0147700002416968</threshold>
- <left_val>-0.6615030169487000</left_val>
- <right_val>5.3119999356567860e-003</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 16 20 -1.</_>
- <_>15 1 8 10 2.</_>
- <_>7 11 8 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2290520071983337</threshold>
- <left_val>-0.4830510020256043</left_val>
- <right_val>0.1232639998197556</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 21 9 -1.</_>
- <_>7 10 7 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1270709931850433</threshold>
- <left_val>0.5745260119438171</left_val>
- <right_val>-0.1942040026187897</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 19 15 5 -1.</_>
- <_>11 19 5 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0103390002623200</threshold>
- <left_val>-0.0546419993042946</left_val>
- <right_val>0.2450180053710938</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 10 6 6 -1.</_>
- <_>11 10 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.9010001607239246e-003</threshold>
- <left_val>0.1218060031533241</left_val>
- <right_val>-0.3879739940166473</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 1 16 20 -1.</_>
- <_>15 1 8 10 2.</_>
- <_>7 11 8 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2902539968490601</threshold>
- <left_val>0.1096619963645935</left_val>
- <right_val>-30.</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 16 20 -1.</_>
- <_>1 1 8 10 2.</_>
- <_>9 11 8 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2380499988794327</threshold>
- <left_val>-1.7352679967880249</left_val>
- <right_val>-0.0638099983334541</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 4 3 12 -1.</_>
- <_>16 10 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0624810010194778</threshold>
- <left_val>0.1352300047874451</left_val>
- <right_val>-0.7030109763145447</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 3 12 -1.</_>
- <_>5 10 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.7109997831285000e-003</threshold>
- <left_val>-0.4698410034179688</left_val>
- <right_val>0.0603419989347458</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 10 8 -1.</_>
- <_>12 6 5 4 2.</_>
- <_>7 10 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0278159994632006</threshold>
- <left_val>0.6980760097503662</left_val>
- <right_val>1.3719999697059393e-003</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 9 6 6 -1.</_>
- <_>4 12 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0170200001448393</threshold>
- <left_val>1.6870440244674683</left_val>
- <right_val>-0.1431480050086975</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 12 4 -1.</_>
- <_>6 7 12 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0497549995779991</threshold>
- <left_val>0.7949770092964172</left_val>
- <right_val>7.7199999941512942e-004</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 2 5 15 -1.</_>
- <_>9 7 5 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0747329965233803</threshold>
- <left_val>-1.0132360458374023</left_val>
- <right_val>-0.0193889997899532</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 9 6 -1.</_>
- <_>15 2 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0320090018212795</threshold>
- <left_val>0.1441210061311722</left_val>
- <right_val>-0.4213910102844238</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 11 10 -1.</_>
- <_>6 5 11 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0944639965891838</threshold>
- <left_val>0.5068259835243225</left_val>
- <right_val>-0.2047889977693558</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 7 4 12 -1.</_>
- <_>12 13 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0154269998893142</threshold>
- <left_val>-0.1581130027770996</left_val>
- <right_val>0.1780689954757690</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 2 9 4 -1.</_>
- <_>7 4 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.0540001355111599e-003</threshold>
- <left_val>-0.5436670184135437</left_val>
- <right_val>0.0312350001186132</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 13 6 -1.</_>
- <_>6 2 13 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.0080000869929790e-003</threshold>
- <left_val>-0.1737679988145828</left_val>
- <right_val>0.3044170141220093</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 18 -1.</_>
- <_>10 6 2 9 2.</_>
- <_>12 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0100919995456934</threshold>
- <left_val>0.2510380148887634</left_val>
- <right_val>-0.2622410058975220</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 8 6 9 -1.</_>
- <_>12 8 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0388180017471313</threshold>
- <left_val>0.9322670102119446</left_val>
- <right_val>0.0726599991321564</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 18 10 6 -1.</_>
- <_>3 20 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0346519984304905</threshold>
- <left_val>-0.0339349992573261</left_val>
- <right_val>-0.8570790290832520</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 14 20 3 -1.</_>
- <_>4 15 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.6729999594390392e-003</threshold>
- <left_val>0.3496930003166199</left_val>
- <right_val>-0.0485179983079433</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 15 9 6 -1.</_>
- <_>2 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.8499997723847628e-004</threshold>
- <left_val>0.0665730014443398</left_val>
- <right_val>-0.4497379958629608</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 4 19 -1.</_>
- <_>13 0 2 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0353170000016689</threshold>
- <left_val>0.1427579969167709</left_val>
- <right_val>-0.4672639966011047</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 4 19 -1.</_>
- <_>9 0 2 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0235699992626905</threshold>
- <left_val>-1.0286079645156860</left_val>
- <right_val>-0.0452880002558231</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 4 22 2 -1.</_>
- <_>1 5 22 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.9109999993816018e-003</threshold>
- <left_val>-0.1965219974517822</left_val>
- <right_val>0.2866100072860718</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 9 6 -1.</_>
- <_>0 2 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0166590008884668</threshold>
- <left_val>-0.7753220200538635</left_val>
- <right_val>-8.3280000835657120e-003</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 24 18 -1.</_>
- <_>0 9 24 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.6606220006942749</threshold>
- <left_val>0.1323249936103821</left_val>
- <right_val>-3.5266680717468262</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 16 8 -1.</_>
- <_>3 6 16 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1097059994935989</threshold>
- <left_val>-0.1554719954729080</left_val>
- <right_val>1.4674140214920044</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 6 18 6 -1.</_>
- <_>3 8 18 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0135009996592999</threshold>
- <left_val>0.1523340046405792</left_val>
- <right_val>-1.3020930290222168</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 6 10 -1.</_>
- <_>5 1 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0228719990700483</threshold>
- <left_val>-0.7132599949836731</left_val>
- <right_val>-8.7040001526474953e-003</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 9 6 -1.</_>
- <_>16 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0818210020661354</threshold>
- <left_val>1.1127580404281616</left_val>
- <right_val>0.0832199975848198</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 9 6 -1.</_>
- <_>5 0 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0527280010282993</threshold>
- <left_val>0.9316509962081909</left_val>
- <right_val>-0.1710399985313416</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 15 -1.</_>
- <_>10 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0252420008182526</threshold>
- <left_val>-0.1973379999399185</left_val>
- <right_val>0.2535940110683441</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 7 10 -1.</_>
- <_>6 5 7 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0438189990818501</threshold>
- <left_val>0.4181520044803619</left_val>
- <right_val>-0.2458550035953522</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 20 4 -1.</_>
- <_>12 2 10 2 2.</_>
- <_>2 4 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0181889999657869</threshold>
- <left_val>-0.5174319744110107</left_val>
- <right_val>0.2017419934272766</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 19 3 -1.</_>
- <_>2 12 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0234660003334284</threshold>
- <left_val>-0.0430710017681122</left_val>
- <right_val>-1.0636579990386963</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 8 6 9 -1.</_>
- <_>12 8 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0342160016298294</threshold>
- <left_val>0.0537809990346432</left_val>
- <right_val>0.4970720112323761</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 6 9 -1.</_>
- <_>10 8 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0256929993629456</threshold>
- <left_val>-0.2380010038614273</left_val>
- <right_val>0.4165149927139282</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 8 4 9 -1.</_>
- <_>13 8 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0265650004148483</threshold>
- <left_val>-0.8857480287551880</left_val>
- <right_val>0.1336590051651001</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 11 9 9 -1.</_>
- <_>6 11 3 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0609420016407967</threshold>
- <left_val>-0.2066970020532608</left_val>
- <right_val>0.5830900073051453</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 18 5 -1.</_>
- <_>9 9 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1447450071573257</threshold>
- <left_val>0.1328230053186417</left_val>
- <right_val>-3.1449348926544189</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 4 2 20 -1.</_>
- <_>2 14 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0534109994769096</threshold>
- <left_val>-0.1732520014047623</left_val>
- <right_val>0.6919069886207581</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 17 8 6 -1.</_>
- <_>14 20 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0114080002531409</threshold>
- <left_val>0.0548220016062260</left_val>
- <right_val>0.3024039864540100</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 18 2 -1.</_>
- <_>3 22 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.3179999552667141e-003</threshold>
- <left_val>0.1582089960575104</left_val>
- <right_val>-0.3197320103645325</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 15 6 -1.</_>
- <_>10 4 5 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0296950004994869</threshold>
- <left_val>0.7127479910850525</left_val>
- <right_val>0.0581360012292862</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 15 12 6 -1.</_>
- <_>2 17 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0272499993443489</threshold>
- <left_val>-0.1575410068035126</left_val>
- <right_val>0.9214379787445068</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 8 6 9 -1.</_>
- <_>17 11 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.6200000904500484e-003</threshold>
- <left_val>-0.3454839885234833</left_val>
- <right_val>0.2022099941968918</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 20 4 -1.</_>
- <_>2 12 10 2 2.</_>
- <_>12 14 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0125789996236563</threshold>
- <left_val>-0.5565029978752136</left_val>
- <right_val>0.0203889999538660</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 24 6 -1.</_>
- <_>0 19 24 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0888490006327629</threshold>
- <left_val>-3.6100010871887207</left_val>
- <right_val>0.1316419988870621</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 16 9 4 -1.</_>
- <_>7 18 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0192569997161627</threshold>
- <left_val>0.5190899968147278</left_val>
- <right_val>-0.1928430050611496</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 1 4 22 -1.</_>
- <_>17 1 2 11 2.</_>
- <_>15 12 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0166669990867376</threshold>
- <left_val>-0.0874999985098839</left_val>
- <right_val>0.1581249982118607</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 1 4 22 -1.</_>
- <_>5 1 2 11 2.</_>
- <_>7 12 2 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0129319997504354</threshold>
- <left_val>0.0274059996008873</left_val>
- <right_val>-0.5512390136718750</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 13 8 9 -1.</_>
- <_>11 16 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0134319998323917</threshold>
- <left_val>0.2345779985189438</left_val>
- <right_val>-0.0432350002229214</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 6 9 -1.</_>
- <_>8 1 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0188100002706051</threshold>
- <left_val>-0.0396809987723827</left_val>
- <right_val>-0.9437329769134522</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 4 3 18 -1.</_>
- <_>11 10 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.4349998719990253e-003</threshold>
- <left_val>0.4570370018482208</left_val>
- <right_val>-4.0520001202821732e-003</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 12 6 -1.</_>
- <_>5 8 6 3 2.</_>
- <_>11 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0242490004748106</threshold>
- <left_val>-0.7624800205230713</left_val>
- <right_val>-0.0198570005595684</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 7 5 8 -1.</_>
- <_>15 11 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0296679995954037</threshold>
- <left_val>-3.7412509918212891</left_val>
- <right_val>0.1125060021877289</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 5 8 -1.</_>
- <_>4 11 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.1150000654160976e-003</threshold>
- <left_val>-0.6378179788589478</left_val>
- <right_val>0.0112239997833967</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 6 12 -1.</_>
- <_>15 6 3 6 2.</_>
- <_>12 12 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.7819997891783714e-003</threshold>
- <left_val>0.1937440037727356</left_val>
- <right_val>-0.0820420011878014</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 6 12 -1.</_>
- <_>6 6 3 6 2.</_>
- <_>9 12 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0166069995611906</threshold>
- <left_val>-0.1619209945201874</left_val>
- <right_val>1.1334990262985229</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 9 14 8 -1.</_>
- <_>12 9 7 4 2.</_>
- <_>5 13 7 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0382280014455318</threshold>
- <left_val>0.0211050007492304</left_val>
- <right_val>0.7626420259475708</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 3 14 -1.</_>
- <_>9 8 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0570940002799034</threshold>
- <left_val>-1.6974929571151733</left_val>
- <right_val>-0.0597620010375977</right_val></_></_>
- <_>
- <!-- tree 137 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 6 12 -1.</_>
- <_>12 10 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0538830012083054</threshold>
- <left_val>1.1850190162658691</left_val>
- <right_val>0.0909669995307922</right_val></_></_>
- <_>
- <!-- tree 138 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 5 4 18 -1.</_>
- <_>4 5 2 9 2.</_>
- <_>6 14 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.6110000908374786e-003</threshold>
- <left_val>-0.4094119966030121</left_val>
- <right_val>0.0838209986686707</right_val></_></_>
- <_>
- <!-- tree 139 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 16 18 -1.</_>
- <_>4 12 16 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2971439957618713</threshold>
- <left_val>0.1552989929914475</left_val>
- <right_val>-1.0995409488677979</right_val></_></_>
- <_>
- <!-- tree 140 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 7 20 -1.</_>
- <_>5 14 7 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0890630036592484</threshold>
- <left_val>0.4894720017910004</left_val>
- <right_val>-0.2004120051860809</right_val></_></_>
- <_>
- <!-- tree 141 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 8 8 12 -1.</_>
- <_>14 14 8 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0561930015683174</threshold>
- <left_val>-0.2458139955997467</left_val>
- <right_val>0.1436550021171570</right_val></_></_>
- <_>
- <!-- tree 142 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 10 6 14 -1.</_>
- <_>9 10 3 7 2.</_>
- <_>12 17 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0370049998164177</threshold>
- <left_val>-0.0481689982116222</left_val>
- <right_val>-1.2310709953308105</right_val></_></_>
- <_>
- <!-- tree 143 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 9 6 -1.</_>
- <_>12 5 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.4840003401041031e-003</threshold>
- <left_val>0.4337260127067566</left_val>
- <right_val>0.0137799996882677</right_val></_></_>
- <_>
- <!-- tree 144 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 4 3 18 -1.</_>
- <_>10 4 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.4379999376833439e-003</threshold>
- <left_val>0.1894969940185547</left_val>
- <right_val>-0.3229419887065888</right_val></_></_>
- <_>
- <!-- tree 145 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 4 22 14 -1.</_>
- <_>12 4 11 7 2.</_>
- <_>1 11 11 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0716399997472763</threshold>
- <left_val>-0.4397900104522705</left_val>
- <right_val>0.2273019999265671</right_val></_></_>
- <_>
- <!-- tree 146 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 18 2 -1.</_>
- <_>2 8 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.2260002121329308e-003</threshold>
- <left_val>-0.2054840028285980</left_val>
- <right_val>0.5093330144882202</right_val></_></_>
- <_>
- <!-- tree 147 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 6 12 -1.</_>
- <_>12 10 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.1360001564025879e-003</threshold>
- <left_val>0.3115719854831696</left_val>
- <right_val>0.0706809982657433</right_val></_></_>
- <_>
- <!-- tree 148 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 9 7 -1.</_>
- <_>9 5 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0155950002372265</threshold>
- <left_val>-0.3093479871749878</left_val>
- <right_val>0.1562770009040833</right_val></_></_>
- <_>
- <!-- tree 149 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 7 4 12 -1.</_>
- <_>12 13 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0259959995746613</threshold>
- <left_val>0.1382160037755966</left_val>
- <right_val>-0.1761659979820252</right_val></_></_>
- <_>
- <!-- tree 150 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 4 12 -1.</_>
- <_>8 13 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0120850000530481</threshold>
- <left_val>-0.5107020139694214</left_val>
- <right_val>0.0584409981966019</right_val></_></_>
- <_>
- <!-- tree 151 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 2 10 22 -1.</_>
- <_>7 13 10 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0678360015153885</threshold>
- <left_val>0.4775710105895996</left_val>
- <right_val>-0.0714460015296936</right_val></_></_>
- <_>
- <!-- tree 152 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 3 20 -1.</_>
- <_>1 1 1 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0147150000557303</threshold>
- <left_val>0.4523890018463135</left_val>
- <right_val>-0.1986140012741089</right_val></_></_>
- <_>
- <!-- tree 153 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 18 4 -1.</_>
- <_>13 13 9 2 2.</_>
- <_>4 15 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0251189991831779</threshold>
- <left_val>0.1295489966869354</left_val>
- <right_val>-0.8626639842987061</right_val></_></_>
- <_>
- <!-- tree 154 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 13 18 4 -1.</_>
- <_>2 13 9 2 2.</_>
- <_>11 15 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0188260003924370</threshold>
- <left_val>-0.0415700003504753</left_val>
- <right_val>-1.1354700326919556</right_val></_></_>
- <_>
- <!-- tree 155 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 15 9 6 -1.</_>
- <_>15 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0212639998644590</threshold>
- <left_val>-0.3473800122737885</left_val>
- <right_val>0.1577949970960617</right_val></_></_>
- <_>
- <!-- tree 156 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 9 6 -1.</_>
- <_>0 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.4609996303915977e-003</threshold>
- <left_val>4.8639997839927673e-003</left_val>
- <right_val>-0.6165480017662048</right_val></_></_>
- <_>
- <!-- tree 157 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 18 24 -1.</_>
- <_>15 0 9 12 2.</_>
- <_>6 12 9 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2295770049095154</threshold>
- <left_val>0.0813729986548424</left_val>
- <right_val>0.6984140276908875</right_val></_></_>
- <_>
- <!-- tree 158 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 6 12 -1.</_>
- <_>6 10 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0380619987845421</threshold>
- <left_val>1.1616369485855103</left_val>
- <right_val>-0.1497669965028763</right_val></_></_>
- <_>
- <!-- tree 159 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 10 4 -1.</_>
- <_>8 9 10 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0134849995374680</threshold>
- <left_val>-0.3203639984130859</left_val>
- <right_val>0.1736509948968887</right_val></_></_>
- <_>
- <!-- tree 160 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 9 18 6 -1.</_>
- <_>1 9 9 3 2.</_>
- <_>10 12 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0362389981746674</threshold>
- <left_val>-0.1815849989652634</left_val>
- <right_val>0.6195669770240784</right_val></_></_>
- <_>
- <!-- tree 161 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 18 3 -1.</_>
- <_>6 7 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.7210001870989799e-003</threshold>
- <left_val>7.9600000753998756e-004</left_val>
- <right_val>0.4244140088558197</right_val></_></_>
- <_>
- <!-- tree 162 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 9 8 -1.</_>
- <_>10 7 3 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0965259969234467</threshold>
- <left_val>-0.1469680070877075</left_val>
- <right_val>1.2525680065155029</right_val></_></_>
- <_>
- <!-- tree 163 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 12 6 12 -1.</_>
- <_>12 12 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0356569997966290</threshold>
- <left_val>-0.3978169858455658</left_val>
- <right_val>0.1419139951467514</right_val></_></_>
- <_>
- <!-- tree 164 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 14 18 3 -1.</_>
- <_>3 15 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0107720000669360</threshold>
- <left_val>-0.1819400042295456</left_val>
- <right_val>0.5976219773292542</right_val></_></_>
- <_>
- <!-- tree 165 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 7 -1.</_>
- <_>18 17 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0792799964547157</threshold>
- <left_val>0.1464249938726425</left_val>
- <right_val>-0.7883689999580383</right_val></_></_>
- <_>
- <!-- tree 166 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 12 10 6 -1.</_>
- <_>1 14 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0328410007059574</threshold>
- <left_val>-0.0624080002307892</left_val>
- <right_val>-1.4227490425109863</right_val></_></_>
- <_>
- <!-- tree 167 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 7 -1.</_>
- <_>18 17 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0277810003608465</threshold>
- <left_val>0.3403309881687164</left_val>
- <right_val>0.0306700002402067</right_val></_></_>
- <_>
- <!-- tree 168 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 3 3 19 -1.</_>
- <_>11 3 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.0339999832212925e-003</threshold>
- <left_val>0.3108470141887665</left_val>
- <right_val>-0.2259570062160492</right_val></_></_>
- <_>
- <!-- tree 169 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 7 -1.</_>
- <_>18 17 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.4260002002120018e-003</threshold>
- <left_val>-0.0389369986951351</left_val>
- <right_val>0.3170210123062134</right_val></_></_>
- <_>
- <!-- tree 170 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 11 9 -1.</_>
- <_>6 4 11 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1121399998664856</threshold>
- <left_val>-0.1757829934358597</left_val>
- <right_val>0.6505659818649292</right_val></_></_>
- <_>
- <!-- tree 171 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 7 -1.</_>
- <_>18 17 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1187810003757477</threshold>
- <left_val>-1.0092990398406982</left_val>
- <right_val>0.1106970012187958</right_val></_></_>
- <_>
- <!-- tree 172 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 11 6 -1.</_>
- <_>6 8 11 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0415849983692169</threshold>
- <left_val>-0.5380640029907227</left_val>
- <right_val>0.0199050009250641</right_val></_></_>
- <_>
- <!-- tree 173 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 7 8 5 -1.</_>
- <_>16 7 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0279660001397133</threshold>
- <left_val>0.4814319908618927</left_val>
- <right_val>0.0335909985005856</right_val></_></_>
- <_>
- <!-- tree 174 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 4 20 19 -1.</_>
- <_>12 4 10 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1250640004873276</threshold>
- <left_val>0.2635219991207123</left_val>
- <right_val>-0.2573789954185486</right_val></_></_>
- <_>
- <!-- tree 175 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 1 21 6 -1.</_>
- <_>9 1 7 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2366690039634705</threshold>
- <left_val>0.0365080013871193</left_val>
- <right_val>0.9065560102462769</right_val></_></_>
- <_>
- <!-- tree 176 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 12 14 -1.</_>
- <_>6 5 6 7 2.</_>
- <_>12 12 6 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0294759999960661</threshold>
- <left_val>-0.6004880070686340</left_val>
- <right_val>9.5880003646016121e-003</right_val></_></_>
- <_>
- <!-- tree 177 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 9 -1.</_>
- <_>11 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0377929992973804</threshold>
- <left_val>0.1550620049238205</left_val>
- <right_val>-0.9573349952697754</right_val></_></_>
- <_>
- <!-- tree 178 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 8 5 -1.</_>
- <_>6 11 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0720440000295639</threshold>
- <left_val>-0.1452589929103851</left_val>
- <right_val>1.3676730394363403</right_val></_></_>
- <_>
- <!-- tree 179 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 7 8 5 -1.</_>
- <_>16 7 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.7759999334812164e-003</threshold>
- <left_val>0.0129159996286035</left_val>
- <right_val>0.2164089977741242</right_val></_></_>
- <_>
- <!-- tree 180 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 8 5 -1.</_>
- <_>4 7 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0521540008485317</threshold>
- <left_val>-0.0163599997758865</left_val>
- <right_val>-0.8835629820823669</right_val></_></_>
- <_>
- <!-- tree 181 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 7 -1.</_>
- <_>18 17 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0437909997999668</threshold>
- <left_val>0.3582960069179535</left_val>
- <right_val>0.0651310011744499</right_val></_></_>
- <_>
- <!-- tree 182 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 8 10 -1.</_>
- <_>8 6 4 5 2.</_>
- <_>12 11 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0383789986371994</threshold>
- <left_val>1.1961040496826172</left_val>
- <right_val>-0.1497150063514710</right_val></_></_>
- <_>
- <!-- tree 183 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 15 9 9 -1.</_>
- <_>18 15 3 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0988389998674393</threshold>
- <left_val>-0.6183400154113770</left_val>
- <right_val>0.1278620064258575</right_val></_></_>
- <_>
- <!-- tree 184 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 9 9 -1.</_>
- <_>3 15 3 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1219070032238960</threshold>
- <left_val>-1.8276120424270630</left_val>
- <right_val>-0.0648629963397980</right_val></_></_>
- <_>
- <!-- tree 185 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 10 9 7 -1.</_>
- <_>15 10 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1198170036077499</threshold>
- <left_val>-30.</left_val>
- <right_val>0.1132330000400543</right_val></_></_>
- <_>
- <!-- tree 186 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 9 7 -1.</_>
- <_>6 10 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0309100002050400</threshold>
- <left_val>-0.2393400073051453</left_val>
- <right_val>0.3633289933204651</right_val></_></_>
- <_>
- <!-- tree 187 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 15 10 8 -1.</_>
- <_>18 15 5 4 2.</_>
- <_>13 19 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0108009995892644</threshold>
- <left_val>-0.0351400002837181</left_val>
- <right_val>0.2770789861679077</right_val></_></_>
- <_>
- <!-- tree 188 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 12 -1.</_>
- <_>0 1 3 6 2.</_>
- <_>3 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0568449981510639</threshold>
- <left_val>-0.1552429944276810</left_val>
- <right_val>1.0802700519561768</right_val></_></_>
- <_>
- <!-- tree 189 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 6 12 -1.</_>
- <_>13 0 3 6 2.</_>
- <_>10 6 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.0280000278726220e-003</threshold>
- <left_val>-0.0612029992043972</left_val>
- <right_val>0.2050800025463104</right_val></_></_>
- <_>
- <!-- tree 190 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 10 12 -1.</_>
- <_>7 0 5 6 2.</_>
- <_>12 6 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0282739996910095</threshold>
- <left_val>-0.6477800011634827</left_val>
- <right_val>0.0239170007407665</right_val></_></_>
- <_>
- <!-- tree 191 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 1 16 8 -1.</_>
- <_>4 1 8 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1601359993219376</threshold>
- <left_val>1.0892050266265869</left_val>
- <right_val>0.0583890005946159</right_val></_></_>
- <_>
- <!-- tree 192 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 21 19 3 -1.</_>
- <_>0 22 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.9629998393356800e-003</threshold>
- <left_val>-0.2580629885196686</left_val>
- <right_val>0.2083459943532944</right_val></_></_>
- <_>
- <!-- tree 193 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 18 4 -1.</_>
- <_>15 9 9 2 2.</_>
- <_>6 11 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0469370000064373</threshold>
- <left_val>0.1388629972934723</left_val>
- <right_val>-1.5662620067596436</right_val></_></_>
- <_>
- <!-- tree 194 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 9 6 -1.</_>
- <_>3 6 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0242860000580549</threshold>
- <left_val>-0.2072830051183701</left_val>
- <right_val>0.5243099927902222</right_val></_></_>
- <_>
- <!-- tree 195 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 6 15 -1.</_>
- <_>9 6 6 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0702020004391670</threshold>
- <left_val>0.1479689925909042</left_val>
- <right_val>-1.3095090389251709</right_val></_></_>
- <_>
- <!-- tree 196 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 9 6 6 -1.</_>
- <_>8 9 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.8120002076029778e-003</threshold>
- <left_val>0.0279060006141663</left_val>
- <right_val>-0.5086460113525391</right_val></_></_>
- <_>
- <!-- tree 197 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 1 14 9 -1.</_>
- <_>5 4 14 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0562009997665882</threshold>
- <left_val>1.2618130445480347</left_val>
- <right_val>0.0638019964098930</right_val></_></_>
- <_>
- <!-- tree 198 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 8 20 -1.</_>
- <_>3 0 4 10 2.</_>
- <_>7 10 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1098280027508736</threshold>
- <left_val>-0.1285009980201721</left_val>
- <right_val>3.0776169300079346</right_val></_></_></trees>
- <stage_threshold>-3.2573320865631104</stage_threshold>
- <parent>21</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 23 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 7 9 -1.</_>
- <_>5 3 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0209100004285574</threshold>
- <left_val>-0.6855940222740173</left_val>
- <right_val>0.3898429870605469</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 12 5 -1.</_>
- <_>10 6 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0350320003926754</threshold>
- <left_val>-0.4772439897060394</left_val>
- <right_val>0.4502719938755035</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 8 14 -1.</_>
- <_>4 1 4 14 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0397990010678768</threshold>
- <left_val>-0.4701110124588013</left_val>
- <right_val>0.4270249903202057</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 12 22 4 -1.</_>
- <_>2 14 22 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.8409998416900635e-003</threshold>
- <left_val>0.2561430037021637</left_val>
- <right_val>-0.6655629873275757</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 17 6 6 -1.</_>
- <_>8 20 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.3439999204128981e-003</threshold>
- <left_val>-0.4808349907398224</left_val>
- <right_val>0.2801379859447479</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 1 6 7 -1.</_>
- <_>18 1 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0253129992634058</threshold>
- <left_val>-0.2394820004701614</left_val>
- <right_val>0.4419179856777191</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 6 -1.</_>
- <_>3 0 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0321930013597012</threshold>
- <left_val>0.7608669996261597</left_val>
- <right_val>-0.2505910098552704</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 17 18 -1.</_>
- <_>4 12 17 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0754090026021004</threshold>
- <left_val>-0.3497459888458252</left_val>
- <right_val>0.3438029885292053</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 12 6 -1.</_>
- <_>6 0 6 3 2.</_>
- <_>12 3 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0184690002351999</threshold>
- <left_val>-0.7908560037612915</left_val>
- <right_val>0.0347880013287067</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 18 4 -1.</_>
- <_>13 7 9 2 2.</_>
- <_>4 9 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0128020001575351</threshold>
- <left_val>0.4710780084133148</left_val>
- <right_val>-0.0600060001015663</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 10 6 -1.</_>
- <_>4 14 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0265980008989573</threshold>
- <left_val>0.6711609959602356</left_val>
- <right_val>-0.2425750046968460</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 9 10 12 -1.</_>
- <_>12 9 5 6 2.</_>
- <_>7 15 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0219889990985394</threshold>
- <left_val>0.2471749931573868</left_val>
- <right_val>-0.4830169975757599</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 3 -1.</_>
- <_>8 1 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1465409994125366</threshold>
- <left_val>-0.2150409966707230</left_val>
- <right_val>0.7205590009689331</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 6 6 -1.</_>
- <_>13 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.5310001112520695e-003</threshold>
- <left_val>0.2793099880218506</left_val>
- <right_val>-0.3433989882469177</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 6 6 -1.</_>
- <_>8 11 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.4010001048445702e-003</threshold>
- <left_val>0.0558619983494282</left_val>
- <right_val>-0.8214359879493713</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 19 3 -1.</_>
- <_>3 11 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.6390003561973572e-003</threshold>
- <left_val>-0.9962059855461121</left_val>
- <right_val>0.1887499988079071</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 9 -1.</_>
- <_>0 5 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0391930006444454</threshold>
- <left_val>-1.1945559978485107</left_val>
- <right_val>-0.0291980002075434</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 16 10 6 -1.</_>
- <_>14 18 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0248550008982420</threshold>
- <left_val>0.1498759984970093</left_val>
- <right_val>-0.5413780212402344</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 10 6 -1.</_>
- <_>0 18 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0349950008094311</threshold>
- <left_val>-1.4210180044174194</left_val>
- <right_val>-0.0423140004277229</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 9 6 -1.</_>
- <_>14 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0183789990842342</threshold>
- <left_val>-0.2824259996414185</left_val>
- <right_val>0.1558180004358292</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 18 3 -1.</_>
- <_>0 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0135920001193881</threshold>
- <left_val>0.4731709957122803</left_val>
- <right_val>-0.2193720042705536</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 18 3 -1.</_>
- <_>6 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.2629999592900276e-003</threshold>
- <left_val>-0.0597140006721020</left_val>
- <right_val>0.6062589883804321</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 18 9 6 -1.</_>
- <_>0 20 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0184780005365610</threshold>
- <left_val>-0.8564720153808594</left_val>
- <right_val>-0.0137839997187257</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 9 6 -1.</_>
- <_>14 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0142360003665090</threshold>
- <left_val>0.1665479987859726</left_val>
- <right_val>-0.2771399915218353</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 2 6 9 -1.</_>
- <_>8 2 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0325470007956028</threshold>
- <left_val>-1.1728240251541138</left_val>
- <right_val>-0.0401850007474422</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 8 4 12 -1.</_>
- <_>15 8 2 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.6410000864416361e-003</threshold>
- <left_val>0.2651430070400238</left_val>
- <right_val>-0.0563430003821850</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 13 8 8 -1.</_>
- <_>8 17 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.7799999164417386e-004</threshold>
- <left_val>0.0365560017526150</left_val>
- <right_val>-0.5507519841194153</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 20 18 3 -1.</_>
- <_>10 20 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0473719984292984</threshold>
- <left_val>-0.0426140017807484</left_val>
- <right_val>0.4819490015506744</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 4 12 -1.</_>
- <_>7 8 2 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.0790001191198826e-003</threshold>
- <left_val>0.2869899868965149</left_val>
- <right_val>-0.3292300105094910</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 12 3 -1.</_>
- <_>7 7 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0431459993124008</threshold>
- <left_val>-1.4065419435501099</left_val>
- <right_val>0.1283639967441559</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 9 -1.</_>
- <_>12 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0205920003354549</threshold>
- <left_val>-0.2143529951572418</left_val>
- <right_val>0.5398179888725281</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 20 18 3 -1.</_>
- <_>11 20 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0223670005798340</threshold>
- <left_val>0.3371829986572266</left_val>
- <right_val>0.0452120006084442</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 20 18 3 -1.</_>
- <_>7 20 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0500399991869926</threshold>
- <left_val>-0.2512170076370239</left_val>
- <right_val>0.4175049960613251</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 1 6 20 -1.</_>
- <_>21 1 3 10 2.</_>
- <_>18 11 3 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0617949999868870</threshold>
- <left_val>0.0400849990546703</left_val>
- <right_val>0.6877980232238770</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 6 20 -1.</_>
- <_>0 1 3 10 2.</_>
- <_>3 11 3 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0418619997799397</threshold>
- <left_val>0.5302739739418030</left_val>
- <right_val>-0.2290199995040894</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 3 4 18 -1.</_>
- <_>15 3 2 9 2.</_>
- <_>13 12 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.1959998887032270e-003</threshold>
- <left_val>0.2516149878501892</left_val>
- <right_val>-0.2151460051536560</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 6 12 -1.</_>
- <_>0 6 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0242550000548363</threshold>
- <left_val>7.2320001199841499e-003</left_val>
- <right_val>-0.7251909971237183</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 9 12 6 -1.</_>
- <_>18 9 6 3 2.</_>
- <_>12 12 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0173039995133877</threshold>
- <left_val>-0.4995819926261902</left_val>
- <right_val>0.1839450001716614</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 3 4 18 -1.</_>
- <_>7 3 2 9 2.</_>
- <_>9 12 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.1470001451671124e-003</threshold>
- <left_val>0.0852119997143745</left_val>
- <right_val>-0.4636470079421997</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 6 9 -1.</_>
- <_>16 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0143699999898672</threshold>
- <left_val>-0.5225890278816223</left_val>
- <right_val>0.2389259934425354</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 12 6 -1.</_>
- <_>0 9 6 3 2.</_>
- <_>6 12 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.0399999171495438e-003</threshold>
- <left_val>-0.6325039863586426</left_val>
- <right_val>0.0325510017573833</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 4 8 20 -1.</_>
- <_>18 4 4 10 2.</_>
- <_>14 14 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1237310022115707</threshold>
- <left_val>1.2856210470199585</left_val>
- <right_val>0.0765450000762939</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 4 8 20 -1.</_>
- <_>2 4 4 10 2.</_>
- <_>6 14 4 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0822219997644424</threshold>
- <left_val>0.8320819735527039</left_val>
- <right_val>-0.1859059929847717</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 13 9 6 -1.</_>
- <_>14 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0656590014696121</threshold>
- <left_val>0.1129880025982857</left_val>
- <right_val>-30.</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 9 6 -1.</_>
- <_>1 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0315829999744892</threshold>
- <left_val>-1.3485900163650513</left_val>
- <right_val>-0.0470970012247562</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 15 18 3 -1.</_>
- <_>9 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0796360000967979</threshold>
- <left_val>-1.3533639907836914</left_val>
- <right_val>0.1566880047321320</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 13 9 6 -1.</_>
- <_>5 15 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0188800003379583</threshold>
- <left_val>0.4030030071735382</left_val>
- <right_val>-0.2514890134334564</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 18 3 -1.</_>
- <_>5 1 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.0149997696280479e-003</threshold>
- <left_val>-0.2628709971904755</left_val>
- <right_val>0.1858250051736832</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 6 7 -1.</_>
- <_>11 2 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0122180003672838</threshold>
- <left_val>0.5869240164756775</left_val>
- <right_val>-0.1942770034074783</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 9 6 -1.</_>
- <_>12 1 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.2710000155493617e-003</threshold>
- <left_val>-0.1668899953365326</left_val>
- <right_val>0.2300689965486527</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 9 6 -1.</_>
- <_>9 1 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0297439992427826</threshold>
- <left_val>0.0125200003385544</left_val>
- <right_val>-0.6672359704971314</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 14 6 -1.</_>
- <_>12 6 7 3 2.</_>
- <_>5 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0281750001013279</threshold>
- <left_val>-0.0170600004494190</left_val>
- <right_val>0.6457939743995667</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 6 13 -1.</_>
- <_>10 2 2 13 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0303450003266335</threshold>
- <left_val>-0.2417870014905930</left_val>
- <right_val>0.3487890064716339</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 12 6 -1.</_>
- <_>12 11 6 3 2.</_>
- <_>6 14 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0173259992152452</threshold>
- <left_val>-0.5359939932823181</left_val>
- <right_val>0.2099599987268448</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 18 15 -1.</_>
- <_>9 1 6 15 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0841780006885529</threshold>
- <left_val>0.7509329915046692</left_val>
- <right_val>-0.1759320050477982</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 6 7 -1.</_>
- <_>13 0 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.4950000271201134e-003</threshold>
- <left_val>-0.1618809998035431</left_val>
- <right_val>0.3065750002861023</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 3 16 6 -1.</_>
- <_>3 6 16 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0564949996769428</threshold>
- <left_val>-0.1731880009174347</left_val>
- <right_val>1.0016150474548340</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 3 12 -1.</_>
- <_>12 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.2939997985959053e-003</threshold>
- <left_val>0.2341759949922562</left_val>
- <right_val>-0.0653470009565353</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 6 9 -1.</_>
- <_>9 7 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0149450004100800</threshold>
- <left_val>0.2501890063285828</left_val>
- <right_val>-0.3059119880199432</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 0 4 24 -1.</_>
- <_>13 0 2 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0549190007150173</threshold>
- <left_val>0.1312199980020523</left_val>
- <right_val>-0.9376509785652161</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 4 24 -1.</_>
- <_>9 0 2 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0197219997644424</threshold>
- <left_val>-0.8397849798202515</left_val>
- <right_val>-0.0234730001538992</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 9 5 12 -1.</_>
- <_>11 13 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0671589970588684</threshold>
- <left_val>2.3586840629577637</left_val>
- <right_val>0.0829709991812706</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 15 9 6 -1.</_>
- <_>7 17 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0143259996548295</threshold>
- <left_val>0.1881449967622757</left_val>
- <right_val>-0.3122160136699677</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 7 18 6 -1.</_>
- <_>5 9 18 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0298410002142191</threshold>
- <left_val>0.1482509970664978</left_val>
- <right_val>-0.8468170166015625</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 9 5 12 -1.</_>
- <_>8 13 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0518830008804798</threshold>
- <left_val>-0.0437310002744198</left_val>
- <right_val>-1.3366169929504395</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 17 17 6 -1.</_>
- <_>4 19 17 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0411270000040531</threshold>
- <left_val>0.1766009926795960</left_val>
- <right_val>-0.6090409755706787</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 18 14 -1.</_>
- <_>0 3 9 7 2.</_>
- <_>9 10 9 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1286509931087494</threshold>
- <left_val>-0.9870100021362305</left_val>
- <right_val>-0.0377850010991097</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 24 2 -1.</_>
- <_>0 2 24 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.4170000106096268e-003</threshold>
- <left_val>-0.1611959934234619</left_val>
- <right_val>0.3267570137977600</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 15 18 3 -1.</_>
- <_>0 16 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.7030002139508724e-003</threshold>
- <left_val>-0.2384150028228760</left_val>
- <right_val>0.2931939959526062</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 9 -1.</_>
- <_>11 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0455200001597404</threshold>
- <left_val>0.1442459970712662</left_val>
- <right_val>-1.5010160207748413</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 3 14 12 -1.</_>
- <_>3 9 14 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0787009969353676</threshold>
- <left_val>-1.0394560098648071</left_val>
- <right_val>-0.0453759990632534</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 3 12 -1.</_>
- <_>12 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.8619997948408127e-003</threshold>
- <left_val>0.1963360011577606</left_val>
- <right_val>-0.1447239965200424</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 6 9 -1.</_>
- <_>10 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0134589998051524</threshold>
- <left_val>-0.9063469767570496</left_val>
- <right_val>-0.0380490012466908</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 6 10 -1.</_>
- <_>12 6 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0288270004093647</threshold>
- <left_val>-0.0294739995151758</left_val>
- <right_val>0.6005839705467224</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 6 9 -1.</_>
- <_>7 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0273659992963076</threshold>
- <left_val>-0.9980400204658508</left_val>
- <right_val>-0.0386530011892319</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 21 7 -1.</_>
- <_>9 0 7 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0729179978370667</threshold>
- <left_val>0.7336149811744690</left_val>
- <right_val>0.0574400015175343</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 12 5 -1.</_>
- <_>10 11 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0139889996498823</threshold>
- <left_val>0.2789260149002075</left_val>
- <right_val>-0.2651630043983460</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 9 8 -1.</_>
- <_>11 7 3 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0432429984211922</threshold>
- <left_val>4.7760000452399254e-003</left_val>
- <right_val>0.3592590093612671</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 18 -1.</_>
- <_>9 6 3 9 2.</_>
- <_>12 15 3 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0295330006629229</threshold>
- <left_val>-0.2008399963378906</left_val>
- <right_val>0.5120289921760559</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 14 8 10 -1.</_>
- <_>19 14 4 5 2.</_>
- <_>15 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0318970009684563</threshold>
- <left_val>0.6472169756889343</left_val>
- <right_val>-1.3760000001639128e-003</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 14 8 10 -1.</_>
- <_>1 14 4 5 2.</_>
- <_>5 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0378689989447594</threshold>
- <left_val>-0.1836380064487457</left_val>
- <right_val>0.6134309768676758</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 0 8 10 -1.</_>
- <_>15 0 4 5 2.</_>
- <_>11 5 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0224179998040199</threshold>
- <left_val>-0.2918789982795715</left_val>
- <right_val>0.1819480061531067</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 8 10 -1.</_>
- <_>5 0 4 5 2.</_>
- <_>9 5 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0589589998126030</threshold>
- <left_val>-0.0664519965648651</left_val>
- <right_val>-1.9290030002593994</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 12 5 -1.</_>
- <_>6 1 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0312229990959167</threshold>
- <left_val>-0.0127320000901818</left_val>
- <right_val>0.6156079769134522</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 12 18 2 -1.</_>
- <_>10 12 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0374849997460842</threshold>
- <left_val>-0.2085690051317215</left_val>
- <right_val>0.4436399936676025</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 8 20 6 -1.</_>
- <_>12 8 10 3 2.</_>
- <_>2 11 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0209660008549690</threshold>
- <left_val>-0.3571279942989349</left_val>
- <right_val>0.2425220012664795</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 9 7 -1.</_>
- <_>10 6 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0254779998213053</threshold>
- <left_val>1.0846560001373291</left_val>
- <right_val>-0.1505440026521683</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 8 16 -1.</_>
- <_>14 5 4 8 2.</_>
- <_>10 13 4 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.2570000775158405e-003</threshold>
- <left_val>0.2130260020494461</left_val>
- <right_val>-0.1830819994211197</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 16 8 -1.</_>
- <_>3 9 8 4 2.</_>
- <_>11 13 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0509830005466938</threshold>
- <left_val>0.5173680186271668</left_val>
- <right_val>-0.1883309930562973</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 10 4 -1.</_>
- <_>7 8 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0206400007009506</threshold>
- <left_val>-0.4403020143508911</left_val>
- <right_val>0.2274599969387054</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 12 10 8 -1.</_>
- <_>7 12 5 4 2.</_>
- <_>12 16 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0106729995459318</threshold>
- <left_val>0.0350599996745586</left_val>
- <right_val>-0.5166500210762024</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 19 15 4 -1.</_>
- <_>14 19 5 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0318959988653660</threshold>
- <left_val>0.0132280001416802</left_val>
- <right_val>0.3491519987583160</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 18 9 -1.</_>
- <_>7 0 6 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0238249991089106</threshold>
- <left_val>0.3411880135536194</left_val>
- <right_val>-0.2151020020246506</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 4 10 8 -1.</_>
- <_>18 4 5 4 2.</_>
- <_>13 8 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.0680001042783260e-003</threshold>
- <left_val>0.3293739855289459</left_val>
- <right_val>-0.2852379977703095</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 16 18 4 -1.</_>
- <_>9 16 6 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0238819997757673</threshold>
- <left_val>-0.2533380091190338</left_val>
- <right_val>0.2629610002040863</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 7 10 12 -1.</_>
- <_>13 7 5 6 2.</_>
- <_>8 13 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0279660001397133</threshold>
- <left_val>0.1404909938573837</left_val>
- <right_val>-0.4988709986209869</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 10 12 -1.</_>
- <_>6 7 5 6 2.</_>
- <_>11 13 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0146030001342297</threshold>
- <left_val>-0.0153959998860955</left_val>
- <right_val>-0.7695800065994263</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 18 7 -1.</_>
- <_>10 6 6 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1087239980697632</threshold>
- <left_val>0.1906960010528565</left_val>
- <right_val>-0.3239310085773468</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 18 3 -1.</_>
- <_>0 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0140380002558231</threshold>
- <left_val>0.3492470085620880</left_val>
- <right_val>-0.2235870063304901</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 17 18 3 -1.</_>
- <_>3 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.0440000593662262e-003</threshold>
- <left_val>-0.0383290015161037</left_val>
- <right_val>0.5117729902267456</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 4 6 10 -1.</_>
- <_>4 4 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.9769999459385872e-003</threshold>
- <left_val>-0.4288829863071442</left_val>
- <right_val>0.0491739995777607</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 0 8 24 -1.</_>
- <_>16 0 4 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0851830020546913</threshold>
- <left_val>0.6662459969520569</left_val>
- <right_val>7.8079998493194580e-003</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 8 15 -1.</_>
- <_>8 0 4 15 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.1559998858720064e-003</threshold>
- <left_val>-0.4913519918918610</left_val>
- <right_val>0.0695559978485107</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 0 8 24 -1.</_>
- <_>16 0 4 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.3638449907302856</threshold>
- <left_val>0.1299709975719452</left_val>
- <right_val>-1.8949509859085083</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 4 18 9 -1.</_>
- <_>7 4 6 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2208250015974045</threshold>
- <left_val>-0.0572119988501072</left_val>
- <right_val>-1.4281120300292969</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 12 9 6 -1.</_>
- <_>15 14 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0161400008946657</threshold>
- <left_val>-0.5758939981460571</left_val>
- <right_val>0.1806250065565109</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 18 6 -1.</_>
- <_>3 9 9 3 2.</_>
- <_>12 12 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0483300015330315</threshold>
- <left_val>0.9730849862098694</left_val>
- <right_val>-0.1651300042867661</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 5 6 9 -1.</_>
- <_>18 8 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0175299998372793</threshold>
- <left_val>0.1793269962072372</left_val>
- <right_val>-0.2794890105724335</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 6 9 -1.</_>
- <_>0 8 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0343099981546402</threshold>
- <left_val>-0.8107249736785889</left_val>
- <right_val>-0.0165960006415844</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 18 4 -1.</_>
- <_>13 7 9 2 2.</_>
- <_>4 9 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.5830002054572105e-003</threshold>
- <left_val>0.2790899872779846</left_val>
- <right_val>-7.4519999325275421e-003</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 1 12 20 -1.</_>
- <_>2 1 6 10 2.</_>
- <_>8 11 6 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1289640069007874</threshold>
- <left_val>-0.1350850015878677</left_val>
- <right_val>2.5411539077758789</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 0 6 23 -1.</_>
- <_>17 0 3 23 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0303610004484653</threshold>
- <left_val>-0.0684190019965172</left_val>
- <right_val>0.2873409986495972</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 6 2 18 -1.</_>
- <_>1 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0440860018134117</threshold>
- <left_val>-0.1813589930534363</left_val>
- <right_val>0.6541320085525513</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 8 10 6 -1.</_>
- <_>8 10 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.0159999150782824e-003</threshold>
- <left_val>-0.1569049954414368</left_val>
- <right_val>0.2696380019187927</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 20 6 -1.</_>
- <_>0 6 10 3 2.</_>
- <_>10 9 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0263369996100664</threshold>
- <left_val>0.2917560040950775</left_val>
- <right_val>-0.2527410089969635</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 12 12 5 -1.</_>
- <_>15 12 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0278660003095865</threshold>
- <left_val>0.4438750147819519</left_val>
- <right_val>0.0550380013883114</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 3 19 -1.</_>
- <_>1 4 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0117250001057982</threshold>
- <left_val>-0.1934649944305420</left_val>
- <right_val>0.4665670096874237</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 1 3 18 -1.</_>
- <_>20 1 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.5689999563619494e-003</threshold>
- <left_val>-8.2360003143548965e-003</left_val>
- <right_val>0.2570089995861054</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 1 3 18 -1.</_>
- <_>3 1 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.5550000611692667e-003</threshold>
- <left_val>-0.4243089854717255</left_val>
- <right_val>0.0711740031838417</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 18 3 -1.</_>
- <_>9 10 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0316950008273125</threshold>
- <left_val>-0.8539350032806397</left_val>
- <right_val>0.1691620051860809</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 10 9 -1.</_>
- <_>9 4 5 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0320970006287098</threshold>
- <left_val>0.8378490209579468</left_val>
- <right_val>-0.1759729981422424</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 13 14 7 -1.</_>
- <_>7 13 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1554419994354248</threshold>
- <left_val>0.0995500013232231</left_val>
- <right_val>2.3873300552368164</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 13 14 7 -1.</_>
- <_>10 13 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0880459994077683</threshold>
- <left_val>-0.1872529983520508</left_val>
- <right_val>0.6238430142402649</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 15 9 6 -1.</_>
- <_>11 15 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.6720000421628356e-003</threshold>
- <left_val>0.2500869929790497</left_val>
- <right_val>-0.0651189982891083</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 14 8 10 -1.</_>
- <_>4 14 4 5 2.</_>
- <_>8 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.3409996479749680e-003</threshold>
- <left_val>-0.3537890017032623</left_val>
- <right_val>0.1071500033140183</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 14 4 10 -1.</_>
- <_>10 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0371380001306534</threshold>
- <left_val>0.1638700067996979</left_val>
- <right_val>-0.9171839952468872</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 8 5 16 -1.</_>
- <_>3 16 5 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0801839977502823</threshold>
- <left_val>-0.1481299996376038</left_val>
- <right_val>1.4895190000534058</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 10 9 6 -1.</_>
- <_>15 12 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.9100002767518163e-004</threshold>
- <left_val>-0.2132689952850342</left_val>
- <right_val>0.1967640072107315</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 10 9 6 -1.</_>
- <_>0 12 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.0400001928210258e-003</threshold>
- <left_val>-0.7131869792938232</left_val>
- <right_val>1.8240000354126096e-003</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 12 9 -1.</_>
- <_>6 10 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1196239963173866</threshold>
- <left_val>0.0330989994108677</left_val>
- <right_val>1.0441709756851196</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 10 5 8 -1.</_>
- <_>9 14 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.5280000194907188e-003</threshold>
- <left_val>-0.2730849981307983</left_val>
- <right_val>0.2722980082035065</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 3 12 -1.</_>
- <_>12 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0296390000730753</threshold>
- <left_val>0.3622579872608185</left_val>
- <right_val>0.0567950010299683</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 15 6 9 -1.</_>
- <_>10 15 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0266500003635883</threshold>
- <left_val>-0.0480410009622574</left_val>
- <right_val>-0.9672350287437439</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 6 7 6 -1.</_>
- <_>16 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0444220006465912</threshold>
- <left_val>0.1305290013551712</left_val>
- <right_val>-0.3507730066776276</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 1 4 22 -1.</_>
- <_>10 1 2 22 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0243599992245436</threshold>
- <left_val>-1.0766899585723877</left_val>
- <right_val>-0.0512229986488819</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 14 3 -1.</_>
- <_>6 6 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0197349991649389</threshold>
- <left_val>0.0262380000203848</left_val>
- <right_val>0.2807050049304962</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 18 19 3 -1.</_>
- <_>0 19 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.4930001497268677e-003</threshold>
- <left_val>-0.2611129879951477</left_val>
- <right_val>0.2101140022277832</right_val></_></_>
- <_>
- <!-- tree 137 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 0 6 24 -1.</_>
- <_>17 0 3 24 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2320030033588409</threshold>
- <left_val>-1.7748440504074097</left_val>
- <right_val>0.1148260012269020</right_val></_></_>
- <_>
- <!-- tree 138 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 15 6 -1.</_>
- <_>5 13 5 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0256140008568764</threshold>
- <left_val>0.2990080118179321</left_val>
- <right_val>-0.2250249981880188</right_val></_></_>
- <_>
- <!-- tree 139 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 10 14 -1.</_>
- <_>14 6 5 7 2.</_>
- <_>9 13 5 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.4949998632073402e-003</threshold>
- <left_val>0.1956380009651184</left_val>
- <right_val>-0.0997629985213280</right_val></_></_>
- <_>
- <!-- tree 140 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 6 8 10 -1.</_>
- <_>1 6 4 5 2.</_>
- <_>5 11 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.9840000681579113e-003</threshold>
- <left_val>-0.4302150011062622</left_val>
- <right_val>0.0812610015273094</right_val></_></_>
- <_>
- <!-- tree 141 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 12 5 -1.</_>
- <_>7 6 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0358130000531673</threshold>
- <left_val>-0.5098739862442017</left_val>
- <right_val>0.1634590029716492</right_val></_></_>
- <_>
- <!-- tree 142 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 9 6 -1.</_>
- <_>10 7 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0141690000891685</threshold>
- <left_val>0.7797809839248657</left_val>
- <right_val>-0.1747629940509796</right_val></_></_>
- <_>
- <!-- tree 143 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 8 14 14 -1.</_>
- <_>14 8 7 7 2.</_>
- <_>7 15 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1264210045337677</threshold>
- <left_val>-0.6304789781570435</left_val>
- <right_val>0.1272830069065094</right_val></_></_>
- <_>
- <!-- tree 144 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 8 14 14 -1.</_>
- <_>3 8 7 7 2.</_>
- <_>10 15 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0686779990792274</threshold>
- <left_val>-0.0464479997754097</left_val>
- <right_val>-1.1128979921340942</right_val></_></_>
- <_>
- <!-- tree 145 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 13 4 -1.</_>
- <_>9 10 13 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0858649984002113</threshold>
- <left_val>0.1183540001511574</left_val>
- <right_val>-4.8235158920288086</right_val></_></_>
- <_>
- <!-- tree 146 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 6 12 -1.</_>
- <_>3 2 3 6 2.</_>
- <_>6 8 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0155119998380542</threshold>
- <left_val>-0.0174679998308420</left_val>
- <right_val>-0.6369339823722839</right_val></_></_>
- <_>
- <!-- tree 147 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 10 17 6 -1.</_>
- <_>6 13 17 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0810910016298294</threshold>
- <left_val>0.0861330032348633</left_val>
- <right_val>2.4559431076049805</right_val></_></_>
- <_>
- <!-- tree 148 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 17 6 -1.</_>
- <_>1 13 17 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0184950008988380</threshold>
- <left_val>0.0402290001511574</left_val>
- <right_val>-0.5085819959640503</right_val></_></_>
- <_>
- <!-- tree 149 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 7 8 9 -1.</_>
- <_>16 10 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0863209962844849</threshold>
- <left_val>-1.9006760120391846</left_val>
- <right_val>0.1101910024881363</right_val></_></_>
- <_>
- <!-- tree 150 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 7 8 9 -1.</_>
- <_>0 10 8 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0723550021648407</threshold>
- <left_val>-0.0621119998395443</left_val>
- <right_val>-1.4165179729461670</right_val></_></_>
- <_>
- <!-- tree 151 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 9 24 10 -1.</_>
- <_>12 9 12 5 2.</_>
- <_>0 14 12 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0781790018081665</threshold>
- <left_val>0.8884930014610291</left_val>
- <right_val>0.0423699989914894</right_val></_></_>
- <_>
- <!-- tree 152 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 15 8 -1.</_>
- <_>8 2 5 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0966819971799850</threshold>
- <left_val>-0.2209420055150986</left_val>
- <right_val>0.3357509970664978</right_val></_></_>
- <_>
- <!-- tree 153 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 2 18 8 -1.</_>
- <_>10 2 6 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0398759990930557</threshold>
- <left_val>0.5780479907989502</left_val>
- <right_val>0.0453479997813702</right_val></_></_>
- <_>
- <!-- tree 154 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 1 18 4 -1.</_>
- <_>0 1 9 2 2.</_>
- <_>9 3 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.5349997282028198e-003</threshold>
- <left_val>-0.5417569875717163</left_val>
- <right_val>3.2399999909102917e-003</right_val></_></_>
- <_>
- <!-- tree 155 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>20 2 3 18 -1.</_>
- <_>21 2 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.0600000647827983e-004</threshold>
- <left_val>-0.0815490037202835</left_val>
- <right_val>0.3583790063858032</right_val></_></_>
- <_>
- <!-- tree 156 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 3 3 19 -1.</_>
- <_>2 3 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0121079999953508</threshold>
- <left_val>-0.2028039991855621</left_val>
- <right_val>0.4376800060272217</right_val></_></_>
- <_>
- <!-- tree 157 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 8 6 16 -1.</_>
- <_>20 8 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0208739992231131</threshold>
- <left_val>0.4146989881992340</left_val>
- <right_val>-0.0455680005252361</right_val></_></_>
- <_>
- <!-- tree 158 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 6 16 -1.</_>
- <_>2 8 2 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0578880012035370</threshold>
- <left_val>-0.0290099997073412</left_val>
- <right_val>-0.9182230234146118</right_val></_></_>
- <_>
- <!-- tree 159 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 18 11 6 -1.</_>
- <_>8 20 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.3200000103097409e-004</threshold>
- <left_val>-0.1177240014076233</left_val>
- <right_val>0.2000000029802322</right_val></_></_>
- <_>
- <!-- tree 160 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 12 5 -1.</_>
- <_>8 6 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0171370003372431</threshold>
- <left_val>0.3300479948520660</left_val>
- <right_val>-0.2305520027875900</right_val></_></_>
- <_>
- <!-- tree 161 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 12 5 -1.</_>
- <_>11 6 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0306550003588200</threshold>
- <left_val>-0.0215450003743172</left_val>
- <right_val>0.2687819898128510</right_val></_></_>
- <_>
- <!-- tree 162 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 9 6 -1.</_>
- <_>9 3 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.8699999721720815e-004</threshold>
- <left_val>-0.4410069882869721</left_val>
- <right_val>0.0491579994559288</right_val></_></_>
- <_>
- <!-- tree 163 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 12 5 -1.</_>
- <_>7 6 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0880369991064072</threshold>
- <left_val>0.1178200021386147</left_val>
- <right_val>-2.8293309211730957</right_val></_></_>
- <_>
- <!-- tree 164 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 8 6 7 -1.</_>
- <_>12 8 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0390289984643459</threshold>
- <left_val>0.9177719950675964</left_val>
- <right_val>-0.1582739949226379</right_val></_></_>
- <_>
- <!-- tree 165 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 9 6 -1.</_>
- <_>11 2 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0801059976220131</threshold>
- <left_val>0.1128920018672943</left_val>
- <right_val>-1.9937280416488647</right_val></_></_>
- <_>
- <!-- tree 166 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 14 6 9 -1.</_>
- <_>8 17 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0395389981567860</threshold>
- <left_val>-0.1435739994049072</left_val>
- <right_val>1.3085240125656128</right_val></_></_>
- <_>
- <!-- tree 167 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 2 9 6 -1.</_>
- <_>11 2 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0206840001046658</threshold>
- <left_val>0.2004809975624085</left_val>
- <right_val>-0.0441869981586933</right_val></_></_>
- <_>
- <!-- tree 168 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 16 20 -1.</_>
- <_>4 3 8 10 2.</_>
- <_>12 13 8 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0670379996299744</threshold>
- <left_val>0.3261860013008118</left_val>
- <right_val>-0.2055040001869202</right_val></_></_>
- <_>
- <!-- tree 169 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 10 12 -1.</_>
- <_>12 6 5 6 2.</_>
- <_>7 12 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0468150004744530</threshold>
- <left_val>0.1582529991865158</left_val>
- <right_val>-0.9553509950637817</right_val></_></_>
- <_>
- <!-- tree 170 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 7 12 -1.</_>
- <_>0 6 7 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0784439966082573</threshold>
- <left_val>-0.0746510028839111</left_val>
- <right_val>-2.1161499023437500</right_val></_></_>
- <_>
- <!-- tree 171 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 17 11 6 -1.</_>
- <_>12 19 11 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0663800016045570</threshold>
- <left_val>0.1164190024137497</left_val>
- <right_val>-1.6113519668579102</right_val></_></_>
- <_>
- <!-- tree 172 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 12 8 -1.</_>
- <_>4 7 6 4 2.</_>
- <_>10 11 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0300539992749691</threshold>
- <left_val>-0.1656260043382645</left_val>
- <right_val>0.7002540230751038</right_val></_></_>
- <_>
- <!-- tree 173 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 11 8 10 -1.</_>
- <_>12 11 4 5 2.</_>
- <_>8 16 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0171199999749660</threshold>
- <left_val>0.2262769937515259</left_val>
- <right_val>-0.4011499881744385</right_val></_></_>
- <_>
- <!-- tree 174 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 4 9 -1.</_>
- <_>11 1 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0200730003416538</threshold>
- <left_val>-0.1938969939947128</left_val>
- <right_val>0.4442029893398285</right_val></_></_>
- <_>
- <!-- tree 175 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 3 22 -1.</_>
- <_>15 0 1 22 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0331019982695580</threshold>
- <left_val>0.1163749992847443</left_val>
- <right_val>-1.5771679878234863</right_val></_></_>
- <_>
- <!-- tree 176 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 0 3 22 -1.</_>
- <_>8 0 1 22 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0148820001631975</threshold>
- <left_val>-0.8968030214309692</left_val>
- <right_val>-0.0420100018382072</right_val></_></_>
- <_>
- <!-- tree 177 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 7 18 4 -1.</_>
- <_>13 7 9 2 2.</_>
- <_>4 9 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0102810002863407</threshold>
- <left_val>0.3560299873352051</left_val>
- <right_val>-0.0131240002810955</right_val></_></_>
- <_>
- <!-- tree 178 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 4 15 -1.</_>
- <_>10 7 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0286950003355742</threshold>
- <left_val>-0.4603959918022156</left_val>
- <right_val>0.0268019996583462</right_val></_></_>
- <_>
- <!-- tree 179 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 3 12 -1.</_>
- <_>12 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.7189998440444469e-003</threshold>
- <left_val>0.2378879934549332</left_val>
- <right_val>-0.0655189976096153</right_val></_></_>
- <_>
- <!-- tree 180 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 18 13 -1.</_>
- <_>9 0 9 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.3220160007476807</threshold>
- <left_val>-0.0284899994730949</left_val>
- <right_val>-0.8423460125923157</right_val></_></_>
- <_>
- <!-- tree 181 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 0 3 24 -1.</_>
- <_>17 0 1 24 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0170450005680323</threshold>
- <left_val>-0.5093880295753479</left_val>
- <right_val>0.1605760008096695</right_val></_></_>
- <_>
- <!-- tree 182 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 3 24 -1.</_>
- <_>6 0 1 24 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.3469998314976692e-003</threshold>
- <left_val>-0.5415499806404114</left_val>
- <right_val>4.7320001758635044e-003</right_val></_></_>
- <_>
- <!-- tree 183 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 15 5 8 -1.</_>
- <_>10 19 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0300019998103380</threshold>
- <left_val>-0.8878579735755920</left_val>
- <right_val>0.1362179964780808</right_val></_></_>
- <_>
- <!-- tree 184 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 18 18 2 -1.</_>
- <_>2 19 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0112929996103048</threshold>
- <left_val>0.8061519861221314</left_val>
- <right_val>-0.1615950018167496</right_val></_></_>
- <_>
- <!-- tree 185 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 8 20 3 -1.</_>
- <_>2 9 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.7749998047947884e-003</threshold>
- <left_val>0.0129680000245571</left_val>
- <right_val>0.5507990121841431</right_val></_></_>
- <_>
- <!-- tree 186 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 6 9 6 -1.</_>
- <_>7 8 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.0710001960396767e-003</threshold>
- <left_val>-0.0457280017435551</left_val>
- <right_val>-1.0766259431838989</right_val></_></_>
- <_>
- <!-- tree 187 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 19 10 -1.</_>
- <_>3 7 19 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1934410035610199</threshold>
- <left_val>0.0712620019912720</left_val>
- <right_val>1.1694519519805908</right_val></_></_>
- <_>
- <!-- tree 188 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 7 19 3 -1.</_>
- <_>2 8 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.3750001825392246e-003</threshold>
- <left_val>-0.1973620057106018</left_val>
- <right_val>0.3820689916610718</right_val></_></_>
- <_>
- <!-- tree 189 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 6 9 4 -1.</_>
- <_>15 8 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0682760030031204</threshold>
- <left_val>-5.4372339248657227</left_val>
- <right_val>0.1115190014243126</right_val></_></_>
- <_>
- <!-- tree 190 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 2 18 8 -1.</_>
- <_>8 2 6 8 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0349330008029938</threshold>
- <left_val>0.4479340016841888</left_val>
- <right_val>-0.1865790039300919</right_val></_></_>
- <_>
- <!-- tree 191 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 9 14 4 -1.</_>
- <_>10 9 7 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.1219998858869076e-003</threshold>
- <left_val>-0.0148719996213913</left_val>
- <right_val>0.1841389983892441</right_val></_></_>
- <_>
- <!-- tree 192 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 6 16 -1.</_>
- <_>7 4 3 16 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0953119993209839</threshold>
- <left_val>-0.1511709988117218</left_val>
- <right_val>0.9499149918556213</right_val></_></_>
- <_>
- <!-- tree 193 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 8 9 16 -1.</_>
- <_>18 8 3 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0628490000963211</threshold>
- <left_val>0.4647360146045685</left_val>
- <right_val>0.0384050011634827</right_val></_></_>
- <_>
- <!-- tree 194 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 9 16 -1.</_>
- <_>3 8 3 16 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1704069972038269</threshold>
- <left_val>-1.6499999761581421</left_val>
- <right_val>-0.0632369965314865</right_val></_></_>
- <_>
- <!-- tree 195 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 0 6 14 -1.</_>
- <_>20 0 2 14 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0105839995667338</threshold>
- <left_val>-0.0383489988744259</left_val>
- <right_val>0.4191380143165588</right_val></_></_>
- <_>
- <!-- tree 196 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 6 14 -1.</_>
- <_>2 0 2 14 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0415790006518364</threshold>
- <left_val>0.3446190059185028</left_val>
- <right_val>-0.2118770033121109</right_val></_></_>
- <_>
- <!-- tree 197 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 0 6 22 -1.</_>
- <_>17 0 2 22 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1271860003471375</threshold>
- <left_val>0.1239819973707199</left_val>
- <right_val>-2.1254889965057373</right_val></_></_>
- <_>
- <!-- tree 198 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 6 22 -1.</_>
- <_>5 0 2 22 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0825570002198219</threshold>
- <left_val>-0.0620240010321140</left_val>
- <right_val>-1.4875819683074951</right_val></_></_>
- <_>
- <!-- tree 199 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 2 12 20 -1.</_>
- <_>16 2 4 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0852930024266243</threshold>
- <left_val>0.0170879997313023</left_val>
- <right_val>0.3207660019397736</right_val></_></_>
- <_>
- <!-- tree 200 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 2 12 20 -1.</_>
- <_>4 2 4 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0555440001189709</threshold>
- <left_val>-0.2741400003433228</left_val>
- <right_val>0.1897639930248261</right_val></_></_>
- <_>
- <!-- tree 201 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 4 9 -1.</_>
- <_>11 6 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.5650000683963299e-003</threshold>
- <left_val>-0.1792020052671433</left_val>
- <right_val>0.2796730101108551</right_val></_></_>
- <_>
- <!-- tree 202 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 6 16 -1.</_>
- <_>12 0 3 16 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0129979997873306</threshold>
- <left_val>-0.3229750096797943</left_val>
- <right_val>0.2694180011749268</right_val></_></_>
- <_>
- <!-- tree 203 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 1 3 12 -1.</_>
- <_>12 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0578919984400272</threshold>
- <left_val>0.1264439970254898</left_val>
- <right_val>-0.6071349978446960</right_val></_></_>
- <_>
- <!-- tree 204 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 4 18 6 -1.</_>
- <_>3 4 9 3 2.</_>
- <_>12 7 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0228240005671978</threshold>
- <left_val>-0.4968209862709045</left_val>
- <right_val>0.0223769992589951</right_val></_></_>
- <_>
- <!-- tree 205 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 5 16 8 -1.</_>
- <_>13 5 8 4 2.</_>
- <_>5 9 8 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0483120009303093</threshold>
- <left_val>0.0436070002615452</left_val>
- <right_val>0.4853779971599579</right_val></_></_>
- <_>
- <!-- tree 206 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 10 6 -1.</_>
- <_>0 15 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0257140006870031</threshold>
- <left_val>-0.0429509989917278</left_val>
- <right_val>-0.9302350282669067</right_val></_></_>
- <_>
- <!-- tree 207 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 14 9 6 -1.</_>
- <_>8 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.9269998930394650e-003</threshold>
- <left_val>-2.9680000152438879e-003</left_val>
- <right_val>0.3429630100727081</right_val></_></_>
- <_>
- <!-- tree 208 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 2 9 6 -1.</_>
- <_>9 2 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0344469994306564</threshold>
- <left_val>-1.5299769639968872</left_val>
- <right_val>-0.0610149987041950</right_val></_></_>
- <_>
- <!-- tree 209 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 1 10 8 -1.</_>
- <_>19 1 5 4 2.</_>
- <_>14 5 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0293879993259907</threshold>
- <left_val>0.0375959984958172</left_val>
- <right_val>0.6417239904403687</right_val></_></_>
- <_>
- <!-- tree 210 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 3 12 -1.</_>
- <_>9 7 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.4319998919963837e-003</threshold>
- <left_val>0.0990889966487885</left_val>
- <right_val>-0.3968810141086578</right_val></_></_></trees>
- <stage_threshold>-3.3703000545501709</stage_threshold>
- <parent>22</parent>
- <next>-1</next></_>
- <_>
- <!-- stage 24 -->
- <trees>
- <_>
- <!-- tree 0 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 9 -1.</_>
- <_>6 7 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0959440022706985</threshold>
- <left_val>0.6241909861564636</left_val>
- <right_val>-0.4587520062923431</right_val></_></_>
- <_>
- <!-- tree 1 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 12 6 -1.</_>
- <_>10 5 4 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0168340001255274</threshold>
- <left_val>-0.9307280182838440</left_val>
- <right_val>0.2156360000371933</right_val></_></_>
- <_>
- <!-- tree 2 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 1 8 5 -1.</_>
- <_>5 1 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0260499995201826</threshold>
- <left_val>-0.4053229987621307</left_val>
- <right_val>0.4225659966468811</right_val></_></_>
- <_>
- <!-- tree 3 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 12 6 8 -1.</_>
- <_>12 16 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.6500001442618668e-004</threshold>
- <left_val>0.0952880010008812</left_val>
- <right_val>-0.6329810023307800</right_val></_></_>
- <_>
- <!-- tree 4 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 12 12 6 -1.</_>
- <_>3 14 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.6940002143383026e-003</threshold>
- <left_val>0.3724380135536194</left_val>
- <right_val>-0.3033240139484406</right_val></_></_>
- <_>
- <!-- tree 5 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 18 12 6 -1.</_>
- <_>15 18 6 3 2.</_>
- <_>9 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0188740007579327</threshold>
- <left_val>-0.2335720062255859</left_val>
- <right_val>0.4033069908618927</right_val></_></_>
- <_>
- <!-- tree 6 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 13 6 6 -1.</_>
- <_>4 16 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-1.6300000424962491e-004</threshold>
- <left_val>0.0428869985044003</left_val>
- <right_val>-0.7779679894447327</right_val></_></_>
- <_>
- <!-- tree 7 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 3 7 18 -1.</_>
- <_>11 12 7 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0762590020895004</threshold>
- <left_val>-0.4962849915027618</left_val>
- <right_val>0.1633539944887161</right_val></_></_>
- <_>
- <!-- tree 8 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 18 3 -1.</_>
- <_>9 9 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0501490011811256</threshold>
- <left_val>0.0327470004558563</left_val>
- <right_val>-0.8004789948463440</right_val></_></_>
- <_>
- <!-- tree 9 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 3 19 2 -1.</_>
- <_>5 4 19 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-2.9239999130368233e-003</threshold>
- <left_val>-0.5000280141830444</left_val>
- <right_val>0.2548060119152069</right_val></_></_>
- <_>
- <!-- tree 10 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 2 12 6 -1.</_>
- <_>4 2 6 3 2.</_>
- <_>10 5 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0162439998239279</threshold>
- <left_val>0.0389130003750324</left_val>
- <right_val>-0.7072489857673645</right_val></_></_>
- <_>
- <!-- tree 11 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 6 9 -1.</_>
- <_>11 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0378119982779026</threshold>
- <left_val>-0.0662679970264435</left_val>
- <right_val>0.7386879920959473</right_val></_></_>
- <_>
- <!-- tree 12 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 6 9 -1.</_>
- <_>10 6 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0123199997469783</threshold>
- <left_val>0.4869639873504639</left_val>
- <right_val>-0.2448559999465942</right_val></_></_>
- <_>
- <!-- tree 13 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 9 5 15 -1.</_>
- <_>16 14 5 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0580039992928505</threshold>
- <left_val>0.1345909982919693</left_val>
- <right_val>-0.1323210000991821</right_val></_></_>
- <_>
- <!-- tree 14 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 9 5 15 -1.</_>
- <_>3 14 5 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.8630000092089176e-003</threshold>
- <left_val>-0.4417290091514587</left_val>
- <right_val>0.1400559991598129</right_val></_></_>
- <_>
- <!-- tree 15 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 6 14 6 -1.</_>
- <_>13 6 7 3 2.</_>
- <_>6 9 7 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0456909984350204</threshold>
- <left_val>0.0312179997563362</left_val>
- <right_val>0.8981829881668091</right_val></_></_>
- <_>
- <!-- tree 16 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 3 14 -1.</_>
- <_>8 13 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0213210005313158</threshold>
- <left_val>0.0120080001652241</left_val>
- <right_val>-0.8606619834899902</right_val></_></_>
- <_>
- <!-- tree 17 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 24 5 -1.</_>
- <_>8 16 8 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1567910015583038</threshold>
- <left_val>0.0140559999272227</left_val>
- <right_val>0.8533290028572083</right_val></_></_>
- <_>
- <!-- tree 18 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 20 20 3 -1.</_>
- <_>10 20 10 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0103289997205138</threshold>
- <left_val>0.2902280092239380</left_val>
- <right_val>-0.2947880029678345</right_val></_></_>
- <_>
- <!-- tree 19 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 10 18 2 -1.</_>
- <_>5 11 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.4290001019835472e-003</threshold>
- <left_val>-0.4043990075588226</left_val>
- <right_val>0.1940020024776459</right_val></_></_>
- <_>
- <!-- tree 20 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 6 10 -1.</_>
- <_>2 6 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0233389995992184</threshold>
- <left_val>0.3294520080089569</left_val>
- <right_val>-0.2571269869804382</right_val></_></_>
- <_>
- <!-- tree 21 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 1 20 3 -1.</_>
- <_>2 2 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.8970001302659512e-003</threshold>
- <left_val>-0.5335299968719482</left_val>
- <right_val>0.2163520008325577</right_val></_></_>
- <_>
- <!-- tree 22 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 13 6 11 -1.</_>
- <_>11 13 2 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0344030000269413</threshold>
- <left_val>-1.4425489902496338</left_val>
- <right_val>-0.0446829982101917</right_val></_></_>
- <_>
- <!-- tree 23 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 15 6 8 -1.</_>
- <_>9 19 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0212350003421307</threshold>
- <left_val>-0.7901750206947327</left_val>
- <right_val>0.1908410042524338</right_val></_></_>
- <_>
- <!-- tree 24 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 9 -1.</_>
- <_>9 15 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.0620001014322042e-003</threshold>
- <left_val>-0.2693119943141937</left_val>
- <right_val>0.3148800134658814</right_val></_></_>
- <_>
- <!-- tree 25 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 18 2 -1.</_>
- <_>5 12 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.2190002277493477e-003</threshold>
- <left_val>-0.5446439981460571</left_val>
- <right_val>0.1657460033893585</right_val></_></_>
- <_>
- <!-- tree 26 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 6 15 6 -1.</_>
- <_>2 8 15 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0143349999561906</threshold>
- <left_val>0.0221050009131432</left_val>
- <right_val>-0.6234250068664551</right_val></_></_>
- <_>
- <!-- tree 27 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 18 3 -1.</_>
- <_>6 1 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.2120001316070557e-003</threshold>
- <left_val>-0.4988499879837036</left_val>
- <right_val>0.1923709958791733</right_val></_></_>
- <_>
- <!-- tree 28 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 3 18 -1.</_>
- <_>6 0 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.3350000679492950e-003</threshold>
- <left_val>-0.7913119792938232</left_val>
- <right_val>-0.0141439996659756</right_val></_></_>
- <_>
- <!-- tree 29 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 3 6 10 -1.</_>
- <_>20 3 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0379379987716675</threshold>
- <left_val>0.7984129786491394</left_val>
- <right_val>-0.0337990000844002</right_val></_></_>
- <_>
- <!-- tree 30 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 6 10 -1.</_>
- <_>2 3 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.7059999778866768e-003</threshold>
- <left_val>-0.3316340148448944</left_val>
- <right_val>0.2072629928588867</right_val></_></_>
- <_>
- <!-- tree 31 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 8 9 -1.</_>
- <_>10 5 4 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-4.4499998912215233e-003</threshold>
- <left_val>-0.2725630104541779</left_val>
- <right_val>0.1840219944715500</right_val></_></_>
- <_>
- <!-- tree 32 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 5 8 9 -1.</_>
- <_>10 5 4 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>5.2189999260008335e-003</threshold>
- <left_val>-0.5309600234031677</left_val>
- <right_val>0.0526079982519150</right_val></_></_>
- <_>
- <!-- tree 33 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 2 20 3 -1.</_>
- <_>3 3 20 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.5399999991059303e-003</threshold>
- <left_val>-0.5648540258407593</left_val>
- <right_val>0.1926939934492111</right_val></_></_>
- <_>
- <!-- tree 34 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 13 4 -1.</_>
- <_>5 4 13 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0449699983000755</threshold>
- <left_val>-0.1741150021553040</left_val>
- <right_val>0.9538260102272034</right_val></_></_>
- <_>
- <!-- tree 35 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>17 0 7 14 -1.</_>
- <_>17 7 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0142090003937483</threshold>
- <left_val>-0.0919490009546280</left_val>
- <right_val>0.2483610063791275</right_val></_></_>
- <_>
- <!-- tree 36 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 7 14 -1.</_>
- <_>0 7 7 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1638019979000092</threshold>
- <left_val>-0.0584970004856586</left_val>
- <right_val>-1.6404409408569336</right_val></_></_>
- <_>
- <!-- tree 37 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 11 10 6 -1.</_>
- <_>9 11 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.5579999200999737e-003</threshold>
- <left_val>0.2344799935817719</left_val>
- <right_val>-0.0927340015769005</right_val></_></_>
- <_>
- <!-- tree 38 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 10 6 -1.</_>
- <_>10 11 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.8499999791383743e-003</threshold>
- <left_val>0.1788070052862167</left_val>
- <right_val>-0.3584409952163696</right_val></_></_>
- <_>
- <!-- tree 39 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 6 3 18 -1.</_>
- <_>11 12 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0252219997346401</threshold>
- <left_val>-0.4290300011634827</left_val>
- <right_val>0.2024450004100800</right_val></_></_>
- <_>
- <!-- tree 40 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 18 3 -1.</_>
- <_>0 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0194150004535913</threshold>
- <left_val>0.5801630020141602</left_val>
- <right_val>-0.1880639940500259</right_val></_></_>
- <_>
- <!-- tree 41 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 16 18 3 -1.</_>
- <_>6 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0144199999049306</threshold>
- <left_val>0.0328469984233379</left_val>
- <right_val>0.8198050260543823</right_val></_></_>
- <_>
- <!-- tree 42 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 9 10 -1.</_>
- <_>4 11 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0515829995274544</threshold>
- <left_val>0.0691760033369064</left_val>
- <right_val>-0.4586629867553711</right_val></_></_>
- <_>
- <!-- tree 43 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 7 15 4 -1.</_>
- <_>9 9 15 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0379600003361702</threshold>
- <left_val>-1.2553000450134277</left_val>
- <right_val>0.1433289945125580</right_val></_></_>
- <_>
- <!-- tree 44 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 6 12 6 -1.</_>
- <_>5 6 6 3 2.</_>
- <_>11 9 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0295609999448061</threshold>
- <left_val>0.5315179824829102</left_val>
- <right_val>-0.2059649974107742</right_val></_></_>
- <_>
- <!-- tree 45 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 1 12 9 -1.</_>
- <_>6 4 12 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0391109995543957</threshold>
- <left_val>1.1658719778060913</left_val>
- <right_val>0.0538970008492470</right_val></_></_>
- <_>
- <!-- tree 46 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 9 6 12 -1.</_>
- <_>7 9 3 6 2.</_>
- <_>10 15 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0291590001434088</threshold>
- <left_val>0.3930760025978088</left_val>
- <right_val>-0.2218450009822846</right_val></_></_>
- <_>
- <!-- tree 47 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 5 13 6 -1.</_>
- <_>11 7 13 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0836170017719269</threshold>
- <left_val>-0.7374449968338013</left_val>
- <right_val>0.1426820009946823</right_val></_></_>
- <_>
- <!-- tree 48 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 11 22 13 -1.</_>
- <_>12 11 11 13 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.4200400114059448</threshold>
- <left_val>-0.1427740007638931</left_val>
- <right_val>1.7894840240478516</right_val></_></_>
- <_>
- <!-- tree 49 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 8 6 6 -1.</_>
- <_>18 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0600050017237663</threshold>
- <left_val>0.1197670027613640</left_val>
- <right_val>-1.8886189460754395</right_val></_></_>
- <_>
- <!-- tree 50 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 6 6 -1.</_>
- <_>0 11 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0189810004085302</threshold>
- <left_val>-1.4148449897766113</left_val>
- <right_val>-0.0565229989588261</right_val></_></_>
- <_>
- <!-- tree 51 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 6 24 3 -1.</_>
- <_>0 7 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.0049998573958874e-003</threshold>
- <left_val>0.4417079985141754</left_val>
- <right_val>-0.1020080000162125</right_val></_></_>
- <_>
- <!-- tree 52 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 10 6 -1.</_>
- <_>0 7 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0582140013575554</threshold>
- <left_val>-1.3918470144271851</left_val>
- <right_val>-0.0482689999043942</right_val></_></_>
- <_>
- <!-- tree 53 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 7 18 3 -1.</_>
- <_>6 8 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0122710000723600</threshold>
- <left_val>0.5131769776344299</left_val>
- <right_val>-0.0936969965696335</right_val></_></_>
- <_>
- <!-- tree 54 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 10 6 -1.</_>
- <_>0 2 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0465859994292259</threshold>
- <left_val>-0.0574840009212494</left_val>
- <right_val>-1.4283169507980347</right_val></_></_>
- <_>
- <!-- tree 55 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 0 3 19 -1.</_>
- <_>20 0 1 19 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.2110000243410468e-003</threshold>
- <left_val>-0.0808919966220856</left_val>
- <right_val>0.3233320116996765</right_val></_></_>
- <_>
- <!-- tree 56 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 6 12 16 -1.</_>
- <_>4 6 6 8 2.</_>
- <_>10 14 6 8 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0886420011520386</threshold>
- <left_val>-0.8644909858703613</left_val>
- <right_val>-0.0331469997763634</right_val></_></_>
- <_>
- <!-- tree 57 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>19 6 4 18 -1.</_>
- <_>21 6 2 9 2.</_>
- <_>19 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0231849998235703</threshold>
- <left_val>0.5216220021247864</left_val>
- <right_val>-0.0161680001765490</right_val></_></_>
- <_>
- <!-- tree 58 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 6 4 18 -1.</_>
- <_>1 6 2 9 2.</_>
- <_>3 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0430900007486343</threshold>
- <left_val>-0.1615380048751831</left_val>
- <right_val>1.0915000438690186</right_val></_></_>
- <_>
- <!-- tree 59 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 21 18 3 -1.</_>
- <_>3 22 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.0599999697878957e-004</threshold>
- <left_val>-0.1709149926900864</left_val>
- <right_val>0.3123669922351837</right_val></_></_>
- <_>
- <!-- tree 60 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 19 9 4 -1.</_>
- <_>0 21 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.9159999042749405e-003</threshold>
- <left_val>-6.7039998248219490e-003</left_val>
- <right_val>-0.6881039738655090</right_val></_></_>
- <_>
- <!-- tree 61 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 18 12 6 -1.</_>
- <_>18 18 6 3 2.</_>
- <_>12 21 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0177529994398355</threshold>
- <left_val>0.6329280138015747</left_val>
- <right_val>-4.2360001243650913e-003</right_val></_></_>
- <_>
- <!-- tree 62 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 18 9 4 -1.</_>
- <_>7 20 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.2299999408423901e-003</threshold>
- <left_val>-0.3363719880580902</left_val>
- <right_val>0.1279059946537018</right_val></_></_>
- <_>
- <!-- tree 63 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 16 10 8 -1.</_>
- <_>17 16 5 4 2.</_>
- <_>12 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0227700006216764</threshold>
- <left_val>-0.0347039997577667</left_val>
- <right_val>0.3914180099964142</right_val></_></_>
- <_>
- <!-- tree 64 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 16 10 8 -1.</_>
- <_>2 16 5 4 2.</_>
- <_>7 20 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0215349998325109</threshold>
- <left_val>0.6476510167121887</left_val>
- <right_val>-0.2009779959917069</right_val></_></_>
- <_>
- <!-- tree 65 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 0 10 12 -1.</_>
- <_>19 0 5 6 2.</_>
- <_>14 6 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0617589987814426</threshold>
- <left_val>0.0542970001697540</left_val>
- <right_val>0.9070010185241699</right_val></_></_>
- <_>
- <!-- tree 66 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 10 12 -1.</_>
- <_>0 0 5 6 2.</_>
- <_>5 6 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0780699998140335</threshold>
- <left_val>0.6552339792251587</left_val>
- <right_val>-0.1975439935922623</right_val></_></_>
- <_>
- <!-- tree 67 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 14 9 6 -1.</_>
- <_>15 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0113150002434850</threshold>
- <left_val>0.1938530057668686</left_val>
- <right_val>-0.5170729756355286</right_val></_></_>
- <_>
- <!-- tree 68 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 9 6 -1.</_>
- <_>0 16 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0255900006741285</threshold>
- <left_val>-0.9309650063514710</left_val>
- <right_val>-0.0315469987690449</right_val></_></_>
- <_>
- <!-- tree 69 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 14 10 6 -1.</_>
- <_>14 16 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0380589999258518</threshold>
- <left_val>-0.6832690238952637</left_val>
- <right_val>0.1270910054445267</right_val></_></_>
- <_>
- <!-- tree 70 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 10 6 -1.</_>
- <_>0 16 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>9.7970003262162209e-003</threshold>
- <left_val>0.0155239999294281</left_val>
- <right_val>-0.6334789991378784</right_val></_></_>
- <_>
- <!-- tree 71 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 18 18 2 -1.</_>
- <_>5 19 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0138419996947050</threshold>
- <left_val>1.0060529708862305</left_val>
- <right_val>0.0628129988908768</right_val></_></_>
- <_>
- <!-- tree 72 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 18 18 3 -1.</_>
- <_>0 19 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.3459997549653053e-003</threshold>
- <left_val>-0.2338320016860962</left_val>
- <right_val>0.3098269999027252</right_val></_></_>
- <_>
- <!-- tree 73 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 5 18 12 -1.</_>
- <_>12 5 9 6 2.</_>
- <_>3 11 9 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0714399963617325</threshold>
- <left_val>-0.7250540256500244</left_val>
- <right_val>0.1714829951524735</right_val></_></_>
- <_>
- <!-- tree 74 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 3 7 9 -1.</_>
- <_>5 6 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0100060002878308</threshold>
- <left_val>-0.2207199931144714</left_val>
- <right_val>0.3526619970798492</right_val></_></_>
- <_>
- <!-- tree 75 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 19 15 -1.</_>
- <_>4 5 19 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1100530028343201</threshold>
- <left_val>0.1666200011968613</left_val>
- <right_val>-0.7431899905204773</right_val></_></_>
- <_>
- <!-- tree 76 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 0 16 4 -1.</_>
- <_>3 2 16 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0353109985589981</threshold>
- <left_val>-0.2398270070552826</left_val>
- <right_val>0.4143599867820740</right_val></_></_>
- <_>
- <!-- tree 77 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 12 16 12 -1.</_>
- <_>4 12 8 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1117469966411591</threshold>
- <left_val>0.5104539990425110</left_val>
- <right_val>2.2319999989122152e-003</right_val></_></_>
- <_>
- <!-- tree 78 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 3 12 15 -1.</_>
- <_>10 3 6 15 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1136780008673668</threshold>
- <left_val>0.9047520160675049</left_val>
- <right_val>-0.1661529988050461</right_val></_></_>
- <_>
- <!-- tree 79 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 4 2 19 -1.</_>
- <_>16 4 1 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0166679993271828</threshold>
- <left_val>0.1402450054883957</left_val>
- <right_val>-0.5217850208282471</right_val></_></_>
- <_>
- <!-- tree 80 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 2 19 -1.</_>
- <_>7 4 1 19 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.0340001732110977e-003</threshold>
- <left_val>-0.6617839932441711</left_val>
- <right_val>3.7640000227838755e-003</right_val></_></_>
- <_>
- <!-- tree 81 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 14 8 10 -1.</_>
- <_>17 14 4 5 2.</_>
- <_>13 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0330969989299774</threshold>
- <left_val>0.8018590211868286</left_val>
- <right_val>0.0593850016593933</right_val></_></_>
- <_>
- <!-- tree 82 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 14 8 10 -1.</_>
- <_>3 14 4 5 2.</_>
- <_>7 19 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0125479996204376</threshold>
- <left_val>-0.3354550004005432</left_val>
- <right_val>0.1457860022783279</right_val></_></_>
- <_>
- <!-- tree 83 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 3 18 -1.</_>
- <_>12 12 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0420739986002445</threshold>
- <left_val>-0.5550910234451294</left_val>
- <right_val>0.1326660066843033</right_val></_></_>
- <_>
- <!-- tree 84 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 11 12 6 -1.</_>
- <_>5 11 6 3 2.</_>
- <_>11 14 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0252219997346401</threshold>
- <left_val>-0.0616319999098778</left_val>
- <right_val>-1.3678770065307617</right_val></_></_>
- <_>
- <!-- tree 85 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 8 10 -1.</_>
- <_>14 5 4 5 2.</_>
- <_>10 10 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0242689996957779</threshold>
- <left_val>0.3418509960174561</left_val>
- <right_val>-7.4160001240670681e-003</right_val></_></_>
- <_>
- <!-- tree 86 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 4 12 10 -1.</_>
- <_>6 4 6 5 2.</_>
- <_>12 9 6 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0122800003737211</threshold>
- <left_val>0.2774580121040344</left_val>
- <right_val>-0.3103390038013458</right_val></_></_>
- <_>
- <!-- tree 87 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 18 10 -1.</_>
- <_>15 8 9 5 2.</_>
- <_>6 13 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1137709990143776</threshold>
- <left_val>1.1719540357589722</left_val>
- <right_val>0.0836810022592545</right_val></_></_>
- <_>
- <!-- tree 88 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 18 10 -1.</_>
- <_>0 8 9 5 2.</_>
- <_>9 13 9 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0847719982266426</threshold>
- <left_val>0.8169479966163635</left_val>
- <right_val>-0.1783750057220459</right_val></_></_>
- <_>
- <!-- tree 89 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 3 18 -1.</_>
- <_>12 12 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0245520006865263</threshold>
- <left_val>-0.1862729936838150</left_val>
- <right_val>0.1434009969234467</right_val></_></_>
- <_>
- <!-- tree 90 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 14 18 3 -1.</_>
- <_>0 15 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-9.0269995853304863e-003</threshold>
- <left_val>0.3265919983386993</left_val>
- <right_val>-0.2354129999876022</right_val></_></_>
- <_>
- <!-- tree 91 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 6 3 18 -1.</_>
- <_>12 12 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0111779998987913</threshold>
- <left_val>0.1976120024919510</left_val>
- <right_val>-0.0217010006308556</right_val></_></_>
- <_>
- <!-- tree 92 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 6 3 18 -1.</_>
- <_>9 12 3 6 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0293669998645782</threshold>
- <left_val>-0.9341480135917664</left_val>
- <right_val>-0.0217049997299910</right_val></_></_>
- <_>
- <!-- tree 93 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 14 18 3 -1.</_>
- <_>6 15 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.3640000298619270e-003</threshold>
- <left_val>0.0255730003118515</left_val>
- <right_val>0.4641279876232147</right_val></_></_>
- <_>
- <!-- tree 94 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 5 18 3 -1.</_>
- <_>0 6 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0140260001644492</threshold>
- <left_val>-0.2122859954833984</left_val>
- <right_val>0.4007880091667175</right_val></_></_>
- <_>
- <!-- tree 95 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 5 22 3 -1.</_>
- <_>2 6 22 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0133419996127486</threshold>
- <left_val>0.7420269846916199</left_val>
- <right_val>0.0290019996464252</right_val></_></_>
- <_>
- <!-- tree 96 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 21 10 -1.</_>
- <_>7 0 7 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.2842279970645905</threshold>
- <left_val>-0.1924359947443008</left_val>
- <right_val>0.4363119900226593</right_val></_></_>
- <_>
- <!-- tree 97 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 3 18 17 -1.</_>
- <_>12 3 6 17 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2372400015592575</threshold>
- <left_val>0.6973639726638794</left_val>
- <right_val>0.0693079978227615</right_val></_></_>
- <_>
- <!-- tree 98 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 18 17 -1.</_>
- <_>6 3 6 17 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1116970032453537</threshold>
- <left_val>0.3914720118045807</left_val>
- <right_val>-0.2092200070619583</right_val></_></_>
- <_>
- <!-- tree 99 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 24 11 -1.</_>
- <_>8 12 8 11 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1278750002384186</threshold>
- <left_val>-0.0725559964776039</left_val>
- <right_val>0.3608820140361786</right_val></_></_>
- <_>
- <!-- tree 100 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 10 16 6 -1.</_>
- <_>4 13 16 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0629009976983070</threshold>
- <left_val>0.9542499780654907</left_val>
- <right_val>-0.1540279984474182</right_val></_></_>
- <_>
- <!-- tree 101 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 8 6 8 -1.</_>
- <_>12 12 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0174390003085136</threshold>
- <left_val>-0.0511349998414516</left_val>
- <right_val>0.2775030136108398</right_val></_></_>
- <_>
- <!-- tree 102 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 14 8 7 -1.</_>
- <_>10 14 4 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.2319999514147639e-003</threshold>
- <left_val>0.0756279975175858</left_val>
- <right_val>-0.3645609915256500</right_val></_></_>
- <_>
- <!-- tree 103 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 10 6 14 -1.</_>
- <_>18 10 3 7 2.</_>
- <_>15 17 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0274950005114079</threshold>
- <left_val>0.0518440008163452</left_val>
- <right_val>0.4156259894371033</right_val></_></_>
- <_>
- <!-- tree 104 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 6 14 -1.</_>
- <_>3 10 3 7 2.</_>
- <_>6 17 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0435439981520176</threshold>
- <left_val>0.7196999788284302</left_val>
- <right_val>-0.1713220030069351</right_val></_></_>
- <_>
- <!-- tree 105 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 12 18 2 -1.</_>
- <_>6 13 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0110259996727109</threshold>
- <left_val>0.1435460001230240</left_val>
- <right_val>-0.6540300250053406</right_val></_></_>
- <_>
- <!-- tree 106 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 10 6 -1.</_>
- <_>5 10 10 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0208659991621971</threshold>
- <left_val>0.0400890000164509</left_val>
- <right_val>-0.4574329853057861</right_val></_></_>
- <_>
- <!-- tree 107 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 11 9 4 -1.</_>
- <_>12 13 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0223040003329515</threshold>
- <left_val>0.5385500192642212</left_val>
- <right_val>0.0716629996895790</right_val></_></_>
- <_>
- <!-- tree 108 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 11 9 6 -1.</_>
- <_>0 13 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0324920006096363</threshold>
- <left_val>-0.0459919981658459</left_val>
- <right_val>-1.0047069787979126</right_val></_></_>
- <_>
- <!-- tree 109 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 2 3 18 -1.</_>
- <_>12 2 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0122699998319149</threshold>
- <left_val>0.0343349985778332</left_val>
- <right_val>0.4243179857730866</right_val></_></_>
- <_>
- <!-- tree 110 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 2 3 18 -1.</_>
- <_>11 2 1 18 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.3820000290870667e-003</threshold>
- <left_val>-0.2585060000419617</left_val>
- <right_val>0.2626349925994873</right_val></_></_>
- <_>
- <!-- tree 111 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 12 6 10 -1.</_>
- <_>11 12 2 10 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0373539999127388</threshold>
- <left_val>0.1569249927997589</left_val>
- <right_val>-1.0429090261459351</right_val></_></_>
- <_>
- <!-- tree 112 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 10 6 9 -1.</_>
- <_>1 13 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0141110001131892</threshold>
- <left_val>-0.7317770123481751</left_val>
- <right_val>-0.0202769991010427</right_val></_></_>
- <_>
- <!-- tree 113 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 16 6 -1.</_>
- <_>14 9 8 3 2.</_>
- <_>6 12 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0570669993758202</threshold>
- <left_val>0.0833600014448166</left_val>
- <right_val>1.5661499500274658</right_val></_></_>
- <_>
- <!-- tree 114 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 8 9 6 -1.</_>
- <_>1 10 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.9680001102387905e-003</threshold>
- <left_val>-0.3531819880008698</left_val>
- <right_val>0.1469839960336685</right_val></_></_>
- <_>
- <!-- tree 115 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 7 16 6 -1.</_>
- <_>7 9 16 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0244929995387793</threshold>
- <left_val>0.2832590043544769</left_val>
- <right_val>-3.4640000667423010e-003</right_val></_></_>
- <_>
- <!-- tree 116 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 0 18 3 -1.</_>
- <_>0 1 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0112549997866154</threshold>
- <left_val>-0.8401749730110169</left_val>
- <right_val>-0.0362519994378090</right_val></_></_>
- <_>
- <!-- tree 117 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 0 6 9 -1.</_>
- <_>12 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0345330014824867</threshold>
- <left_val>0.1499850004911423</left_val>
- <right_val>-0.8736709952354431</right_val></_></_>
- <_>
- <!-- tree 118 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 5 6 6 -1.</_>
- <_>12 5 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0243030004203320</threshold>
- <left_val>-0.1878750026226044</left_val>
- <right_val>0.5948399901390076</right_val></_></_>
- <_>
- <!-- tree 119 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 18 -1.</_>
- <_>12 6 2 9 2.</_>
- <_>10 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-7.8790001571178436e-003</threshold>
- <left_val>0.4431569874286652</left_val>
- <right_val>-0.0565709993243217</right_val></_></_>
- <_>
- <!-- tree 120 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 0 6 9 -1.</_>
- <_>10 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0351420007646084</threshold>
- <left_val>-0.0564949996769428</left_val>
- <right_val>-1.3617190122604370</right_val></_></_>
- <_>
- <!-- tree 121 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 6 9 -1.</_>
- <_>9 4 6 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.6259998343884945e-003</threshold>
- <left_val>-0.3116169869899750</left_val>
- <right_val>0.2544769942760468</right_val></_></_>
- <_>
- <!-- tree 122 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 0 18 9 -1.</_>
- <_>1 3 18 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0831310003995895</threshold>
- <left_val>1.6424349546432495</left_val>
- <right_val>-0.1442939937114716</right_val></_></_>
- <_>
- <!-- tree 123 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 3 24 3 -1.</_>
- <_>0 4 24 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0140159996226430</threshold>
- <left_val>-0.7781950235366821</left_val>
- <right_val>0.1717330068349838</right_val></_></_>
- <_>
- <!-- tree 124 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 14 9 4 -1.</_>
- <_>6 16 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.2450000504031777e-003</threshold>
- <left_val>-0.2319139987230301</left_val>
- <right_val>0.2852790057659149</right_val></_></_>
- <_>
- <!-- tree 125 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 9 8 10 -1.</_>
- <_>12 9 4 5 2.</_>
- <_>8 14 4 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0168030001223087</threshold>
- <left_val>-0.3596509993076325</left_val>
- <right_val>0.2041299939155579</right_val></_></_>
- <_>
- <!-- tree 126 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 13 9 -1.</_>
- <_>5 5 13 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0767479985952377</threshold>
- <left_val>0.7805050015449524</left_val>
- <right_val>-0.1561280041933060</right_val></_></_>
- <_>
- <!-- tree 127 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 16 9 -1.</_>
- <_>4 7 16 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2367199957370758</threshold>
- <left_val>1.1813700199127197</left_val>
- <right_val>0.0781119987368584</right_val></_></_>
- <_>
- <!-- tree 128 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 4 14 9 -1.</_>
- <_>4 7 14 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1005740016698837</threshold>
- <left_val>-0.4710409939289093</left_val>
- <right_val>0.0791729986667633</right_val></_></_>
- <_>
- <!-- tree 129 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 5 9 6 -1.</_>
- <_>8 7 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.3239999534562230e-003</threshold>
- <left_val>0.2226269990205765</left_val>
- <right_val>-0.3709979951381683</right_val></_></_>
- <_>
- <!-- tree 130 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 7 16 6 -1.</_>
- <_>1 9 16 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0221529994159937</threshold>
- <left_val>-0.0386490002274513</left_val>
- <right_val>-0.9227499961853027</right_val></_></_>
- <_>
- <!-- tree 131 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 5 13 9 -1.</_>
- <_>10 8 13 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1124619990587235</threshold>
- <left_val>0.4189960062503815</left_val>
- <right_val>0.0804110020399094</right_val></_></_>
- <_>
- <!-- tree 132 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 5 13 9 -1.</_>
- <_>1 8 13 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0164810009300709</threshold>
- <left_val>-0.1675669997930527</left_val>
- <right_val>0.7184240221977234</right_val></_></_>
- <_>
- <!-- tree 133 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 4 24 6 -1.</_>
- <_>12 4 12 3 2.</_>
- <_>0 7 12 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0681139975786209</threshold>
- <left_val>0.1571989953517914</left_val>
- <right_val>-0.8768110275268555</right_val></_></_>
- <_>
- <!-- tree 134 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 14 10 9 -1.</_>
- <_>1 17 10 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0160119999200106</threshold>
- <left_val>-4.1600000113248825e-003</left_val>
- <right_val>-0.5932779908180237</right_val></_></_>
- <_>
- <!-- tree 135 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 17 18 3 -1.</_>
- <_>5 18 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.6640001237392426e-003</threshold>
- <left_val>-0.0301539991050959</left_val>
- <right_val>0.4834530055522919</right_val></_></_>
- <_>
- <!-- tree 136 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 18 3 -1.</_>
- <_>0 17 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.7579997703433037e-003</threshold>
- <left_val>-0.2266740053892136</left_val>
- <right_val>0.3366230130195618</right_val></_></_>
- <_>
- <!-- tree 137 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 17 9 6 -1.</_>
- <_>9 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.7289999201893806e-003</threshold>
- <left_val>-0.0603739991784096</left_val>
- <right_val>0.3145810067653656</right_val></_></_>
- <_>
- <!-- tree 138 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 20 22 4 -1.</_>
- <_>1 20 11 2 2.</_>
- <_>12 22 11 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.5869999080896378e-003</threshold>
- <left_val>-0.2987259924411774</left_val>
- <right_val>0.1778749972581863</right_val></_></_>
- <_>
- <!-- tree 139 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 14 8 6 -1.</_>
- <_>8 17 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.8989999555051327e-003</threshold>
- <left_val>0.2189020067453384</left_val>
- <right_val>-0.2956709861755371</right_val></_></_>
- <_>
- <!-- tree 140 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 6 8 15 -1.</_>
- <_>8 11 8 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0300539992749691</threshold>
- <left_val>1.2150429487228394</left_val>
- <right_val>-0.1435499936342239</right_val></_></_>
- <_>
- <!-- tree 141 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 4 18 3 -1.</_>
- <_>5 5 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0141810001805425</threshold>
- <left_val>0.0124519998207688</left_val>
- <right_val>0.5549010038375855</right_val></_></_>
- <_>
- <!-- tree 142 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 3 5 10 -1.</_>
- <_>9 8 5 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0605270005762577</threshold>
- <left_val>-1.4933999776840210</left_val>
- <right_val>-0.0652270019054413</right_val></_></_>
- <_>
- <!-- tree 143 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 8 12 3 -1.</_>
- <_>6 8 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0198829993605614</threshold>
- <left_val>-0.3852640092372894</left_val>
- <right_val>0.1976120024919510</right_val></_></_>
- <_>
- <!-- tree 144 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 6 18 6 -1.</_>
- <_>2 6 9 3 2.</_>
- <_>11 9 9 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0312189999967813</threshold>
- <left_val>-0.2128120064735413</left_val>
- <right_val>0.2944650053977966</right_val></_></_>
- <_>
- <!-- tree 145 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 6 4 18 -1.</_>
- <_>12 6 2 9 2.</_>
- <_>10 15 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0182719994336367</threshold>
- <left_val>9.7200000891461968e-004</left_val>
- <right_val>0.6681420207023621</right_val></_></_>
- <_>
- <!-- tree 146 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>7 5 6 6 -1.</_>
- <_>10 5 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>1.1089999461546540e-003</threshold>
- <left_val>-0.6246790289878845</left_val>
- <right_val>-1.6599999507889152e-003</right_val></_></_>
- <_>
- <!-- tree 147 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 5 2 18 -1.</_>
- <_>14 14 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0367139987647533</threshold>
- <left_val>-0.4233390092849731</left_val>
- <right_val>0.1208470016717911</right_val></_></_>
- <_>
- <!-- tree 148 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>8 5 2 18 -1.</_>
- <_>8 14 2 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0120440004393458</threshold>
- <left_val>0.0258820001035929</left_val>
- <right_val>-0.5073239803314209</right_val></_></_>
- <_>
- <!-- tree 149 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 2 10 6 -1.</_>
- <_>9 2 5 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0747490003705025</threshold>
- <left_val>0.1318469941616058</left_val>
- <right_val>-0.2173960059881210</right_val></_></_>
- <_>
- <!-- tree 150 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 18 12 -1.</_>
- <_>12 1 9 12 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.2347320020198822</threshold>
- <left_val>1.1775610446929932</left_val>
- <right_val>-0.1511469930410385</right_val></_></_>
- <_>
- <!-- tree 151 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 2 17 22 -1.</_>
- <_>5 13 17 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1409649997949600</threshold>
- <left_val>0.0339910015463829</left_val>
- <right_val>0.3992309868335724</right_val></_></_>
- <_>
- <!-- tree 152 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>4 0 12 6 -1.</_>
- <_>4 2 12 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>6.1789997853338718e-003</threshold>
- <left_val>-0.3180670142173767</left_val>
- <right_val>0.1168169975280762</right_val></_></_>
- <_>
- <!-- tree 153 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 9 16 6 -1.</_>
- <_>14 9 8 3 2.</_>
- <_>6 12 8 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0572169981896877</threshold>
- <left_val>0.8439909815788269</left_val>
- <right_val>0.0838890001177788</right_val></_></_>
- <_>
- <!-- tree 154 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 0 5 18 -1.</_>
- <_>9 9 5 9 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0552270002663136</threshold>
- <left_val>0.3688830137252808</left_val>
- <right_val>-0.1891340017318726</right_val></_></_>
- <_>
- <!-- tree 155 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 0 6 9 -1.</_>
- <_>14 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0215830001980066</threshold>
- <left_val>-0.5216180086135864</left_val>
- <right_val>0.1577260047197342</right_val></_></_>
- <_>
- <!-- tree 156 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 0 6 9 -1.</_>
- <_>8 0 2 9 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0257479995489120</threshold>
- <left_val>-0.0599219985306263</left_val>
- <right_val>-1.0674990415573120</right_val></_></_>
- <_>
- <!-- tree 157 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 6 12 -1.</_>
- <_>11 1 2 12 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0130989998579025</threshold>
- <left_val>0.7895839810371399</left_val>
- <right_val>0.0520999990403652</right_val></_></_>
- <_>
- <!-- tree 158 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 9 13 4 -1.</_>
- <_>5 11 13 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.2799998987466097e-003</threshold>
- <left_val>-1.1704430580139160</left_val>
- <right_val>-0.0593569986522198</right_val></_></_>
- <_>
- <!-- tree 159 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 19 3 -1.</_>
- <_>5 9 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>8.8060004636645317e-003</threshold>
- <left_val>0.0417179986834526</left_val>
- <right_val>0.6635259985923767</right_val></_></_>
- <_>
- <!-- tree 160 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 9 6 8 -1.</_>
- <_>9 13 6 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-8.9699998497962952e-003</threshold>
- <left_val>-0.3586269915103912</left_val>
- <right_val>0.0604580007493496</right_val></_></_>
- <_>
- <!-- tree 161 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 9 4 15 -1.</_>
- <_>11 14 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.0230001322925091e-003</threshold>
- <left_val>0.2097939997911453</left_val>
- <right_val>-0.2480600029230118</right_val></_></_>
- <_>
- <!-- tree 162 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 0 6 14 -1.</_>
- <_>2 0 3 7 2.</_>
- <_>5 7 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0250170007348061</threshold>
- <left_val>-0.1879590004682541</left_val>
- <right_val>0.3954710066318512</right_val></_></_>
- <_>
- <!-- tree 163 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 1 6 14 -1.</_>
- <_>18 1 3 7 2.</_>
- <_>15 8 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-5.9009999968111515e-003</threshold>
- <left_val>0.2566390037536621</left_val>
- <right_val>-0.0949190035462379</right_val></_></_>
- <_>
- <!-- tree 164 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 1 6 14 -1.</_>
- <_>3 1 3 7 2.</_>
- <_>6 8 3 7 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>4.3850000947713852e-003</threshold>
- <left_val>0.0331390015780926</left_val>
- <right_val>-0.4607540071010590</right_val></_></_>
- <_>
- <!-- tree 165 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 20 18 4 -1.</_>
- <_>12 20 9 2 2.</_>
- <_>3 22 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0337719991803169</threshold>
- <left_val>-0.9888160228729248</left_val>
- <right_val>0.1463689953088760</right_val></_></_>
- <_>
- <!-- tree 166 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 0 4 20 -1.</_>
- <_>5 0 2 10 2.</_>
- <_>7 10 2 10 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0445230007171631</threshold>
- <left_val>-0.1328669935464859</left_val>
- <right_val>1.5796790122985840</right_val></_></_>
- <_>
- <!-- tree 167 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 8 8 12 -1.</_>
- <_>20 8 4 6 2.</_>
- <_>16 14 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0409290008246899</threshold>
- <left_val>0.3387709856033325</left_val>
- <right_val>0.0749709978699684</right_val></_></_>
- <_>
- <!-- tree 168 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 8 8 12 -1.</_>
- <_>0 8 4 6 2.</_>
- <_>4 14 4 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0393519997596741</threshold>
- <left_val>-0.1832789927721024</left_val>
- <right_val>0.4698069989681244</right_val></_></_>
- <_>
- <!-- tree 169 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 13 10 8 -1.</_>
- <_>18 13 5 4 2.</_>
- <_>13 17 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0703229978680611</threshold>
- <left_val>-0.9832270145416260</left_val>
- <right_val>0.1180810034275055</right_val></_></_>
- <_>
- <!-- tree 170 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 13 10 8 -1.</_>
- <_>1 13 5 4 2.</_>
- <_>6 17 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0357430018484592</threshold>
- <left_val>-0.0330509990453720</left_val>
- <right_val>-0.8361089825630188</right_val></_></_>
- <_>
- <!-- tree 171 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 8 4 15 -1.</_>
- <_>15 13 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0429619997739792</threshold>
- <left_val>1.1670809984207153</left_val>
- <right_val>0.0806920006871223</right_val></_></_>
- <_>
- <!-- tree 172 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>5 8 4 15 -1.</_>
- <_>5 13 4 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0210079997777939</threshold>
- <left_val>0.6386979818344116</left_val>
- <right_val>-0.1762630045413971</right_val></_></_>
- <_>
- <!-- tree 173 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 11 16 12 -1.</_>
- <_>6 15 16 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.1574220061302185</threshold>
- <left_val>-0.2330249994993210</left_val>
- <right_val>0.1251749992370606</right_val></_></_>
- <_>
- <!-- tree 174 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>2 11 16 12 -1.</_>
- <_>2 15 16 4 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>7.8659998252987862e-003</threshold>
- <left_val>-0.2203799933195114</left_val>
- <right_val>0.2719680070877075</right_val></_></_>
- <_>
- <!-- tree 175 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>14 12 7 9 -1.</_>
- <_>14 15 7 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0236220005899668</threshold>
- <left_val>0.1612730026245117</left_val>
- <right_val>-0.4332900047302246</right_val></_></_>
- <_>
- <!-- tree 176 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>10 1 3 21 -1.</_>
- <_>10 8 3 7 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0746920034289360</threshold>
- <left_val>-0.1699199974536896</left_val>
- <right_val>0.5888490080833435</right_val></_></_>
- <_>
- <!-- tree 177 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 11 9 4 -1.</_>
- <_>13 13 9 2 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-6.4799998654052615e-004</threshold>
- <left_val>0.2584289908409119</left_val>
- <right_val>-0.0359119996428490</right_val></_></_>
- <_>
- <!-- tree 178 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 10 17 9 -1.</_>
- <_>3 13 17 3 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0162909999489784</threshold>
- <left_val>-0.7676439881324768</left_val>
- <right_val>-0.0204729996621609</right_val></_></_>
- <_>
- <!-- tree 179 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>13 8 8 15 -1.</_>
- <_>13 13 8 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0331339985132217</threshold>
- <left_val>-0.2718009948730469</left_val>
- <right_val>0.1432570070028305</right_val></_></_>
- <_>
- <!-- tree 180 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 8 8 15 -1.</_>
- <_>3 13 8 5 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0487979985773563</threshold>
- <left_val>0.0764089971780777</left_val>
- <right_val>-0.4144519865512848</right_val></_></_>
- <_>
- <!-- tree 181 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>11 14 10 8 -1.</_>
- <_>16 14 5 4 2.</_>
- <_>11 18 5 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>2.2869999520480633e-003</threshold>
- <left_val>-0.0386289991438389</left_val>
- <right_val>0.2075379937887192</right_val></_></_>
- <_>
- <!-- tree 182 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 18 22 6 -1.</_>
- <_>0 18 11 3 2.</_>
- <_>11 21 11 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0453040003776550</threshold>
- <left_val>-0.1777790039777756</left_val>
- <right_val>0.6346139907836914</right_val></_></_>
- <_>
- <!-- tree 183 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 16 24 4 -1.</_>
- <_>0 16 12 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.1070580035448074</threshold>
- <left_val>0.1897229999303818</left_val>
- <right_val>-0.5123620033264160</right_val></_></_>
- <_>
- <!-- tree 184 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>6 20 12 3 -1.</_>
- <_>12 20 6 3 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0405250005424023</threshold>
- <left_val>0.7061499953269959</left_val>
- <right_val>-0.1780329942703247</right_val></_></_>
- <_>
- <!-- tree 185 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>18 12 6 12 -1.</_>
- <_>21 12 3 6 2.</_>
- <_>18 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0319689996540546</threshold>
- <left_val>0.0681499987840652</left_val>
- <right_val>0.6873310208320618</right_val></_></_>
- <_>
- <!-- tree 186 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 12 6 12 -1.</_>
- <_>0 12 3 6 2.</_>
- <_>3 18 3 6 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0576170012354851</threshold>
- <left_val>0.7517049908638001</left_val>
- <right_val>-0.1576499938964844</right_val></_></_>
- <_>
- <!-- tree 187 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 6 -1.</_>
- <_>15 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0135939996689558</threshold>
- <left_val>0.1941190063953400</left_val>
- <right_val>-0.2456189990043640</right_val></_></_>
- <_>
- <!-- tree 188 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>1 6 22 10 -1.</_>
- <_>1 6 11 5 2.</_>
- <_>12 11 11 5 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0713960006833076</threshold>
- <left_val>-0.0468810014426708</left_val>
- <right_val>-0.8819829821586609</right_val></_></_>
- <_>
- <!-- tree 189 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 6 -1.</_>
- <_>15 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0148959998041391</threshold>
- <left_val>-0.4453240036964417</left_val>
- <right_val>0.1767989993095398</right_val></_></_>
- <_>
- <!-- tree 190 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 18 18 2 -1.</_>
- <_>0 19 18 1 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0100260004401207</threshold>
- <left_val>0.6512269973754883</left_val>
- <right_val>-0.1670999974012375</right_val></_></_>
- <_>
- <!-- tree 191 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 15 19 3 -1.</_>
- <_>3 16 19 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>3.7589999847114086e-003</threshold>
- <left_val>-0.0583010017871857</left_val>
- <right_val>0.3448329865932465</right_val></_></_>
- <_>
- <!-- tree 192 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 18 3 -1.</_>
- <_>0 14 18 1 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0162630006670952</threshold>
- <left_val>-0.1558150053024292</left_val>
- <right_val>0.8643270134925842</right_val></_></_>
- <_>
- <!-- tree 193 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>15 17 9 6 -1.</_>
- <_>15 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0401760004460812</threshold>
- <left_val>-0.6102859973907471</left_val>
- <right_val>0.1179639995098114</right_val></_></_>
- <_>
- <!-- tree 194 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 17 9 6 -1.</_>
- <_>0 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0270809996873140</threshold>
- <left_val>-0.0496019981801510</left_val>
- <right_val>-0.8999000191688538</right_val></_></_>
- <_>
- <!-- tree 195 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>12 17 9 6 -1.</_>
- <_>12 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0524200014770031</threshold>
- <left_val>0.1129719987511635</left_val>
- <right_val>-1.0833640098571777</right_val></_></_>
- <_>
- <!-- tree 196 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>3 17 9 6 -1.</_>
- <_>3 19 9 2 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0191600006073713</threshold>
- <left_val>-0.7988010048866272</left_val>
- <right_val>-0.0340790003538132</right_val></_></_>
- <_>
- <!-- tree 197 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>16 2 3 20 -1.</_>
- <_>17 2 1 20 3.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-3.7730000913143158e-003</threshold>
- <left_val>-0.1912409961223602</left_val>
- <right_val>0.2153519988059998</right_val></_></_>
- <_>
- <!-- tree 198 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>0 13 24 8 -1.</_>
- <_>0 17 24 4 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>0.0757620036602020</threshold>
- <left_val>-0.1342169940471649</left_val>
- <right_val>1.6807060241699219</right_val></_></_>
- <_>
- <!-- tree 199 -->
- <_>
- <!-- root node -->
- <feature>
- <rects>
- <_>9 1 6 22 -1.</_>
- <_>12 1 3 11 2.</_>
- <_>9 12 3 11 2.</_></rects>
- <tilted>0</tilted></feature>
- <threshold>-0.0221730004996061</threshold>
- <left_val>0.4860099852085114</left_val>
- <right_val>3.6160000599920750e-003</right_val></_></_></trees>
- <stage_threshold>-2.9928278923034668</stage_threshold>
- <parent>23</parent>
- <next>-1</next></_></stages></haarcascade_frontalface_default>
-</opencv_storage>
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / OpenCV demo module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <gpac/modules/codec.h>
-#include <gpac/scenegraph_vrml.h>
-#include <gpac/thread.h>
-
-#include <cvaux.h>
-#include <highgui.h>
-
-
-
-typedef struct
-{
- GF_Thread *th;
- Bool running;
-
-} GF_OpenCV;
-
-
-static Bool OCV_RegisterDevice(struct __input_device *ifce, const char *urn, GF_BitStream *dsi, void (*AddField)(struct __input_device *_this, u32 fieldType, const char *name))
-{
- if (strncmp(urn, "OpenCV", 6)) return 0;
-
- AddField(ifce, GF_SG_VRML_SFVEC2F, "position");
-
- return 1;
-}
-
-
-
-CvHaarClassifierCascade* load_object_detector( const char* cascade_path )
-{
- return (CvHaarClassifierCascade*)cvLoad( cascade_path, NULL, NULL, NULL );
-}
-
-int prev_x0=0, prev_y0=0;
-
-void detect_and_draw_objects(GF_InputSensorDevice *ifce, IplImage* image,
- CvHaarClassifierCascade* cascade,
- int do_pyramids )
-{
- IplImage* small_image = image;
- CvMemStorage* storage = cvCreateMemStorage(0);
- CvSeq* faces;
- int i, scale = 1;
- //CvRect* theRealFace;
- int theRealX=0, theRealY=0, theRealHeight=0 , theRealWidth=0;
-
- int tmpMaxSurface=0;
-
-
- if( do_pyramids )
- {
- small_image = cvCreateImage( cvSize(image->width/2,image->height/2), IPL_DEPTH_8U, 3 );
- cvPyrDown( image, small_image, CV_GAUSSIAN_5x5 );
- scale = 2;
- }
-
- faces = cvHaarDetectObjects( small_image, cascade, storage, 1.2, 2, CV_HAAR_DO_CANNY_PRUNING, cvSize(0,0) );
-
- for( i = 0; i < faces->total; i++ )
- {
-
- CvRect face_rect = *(CvRect*)cvGetSeqElem( faces, i );
- /* cvRectangle( image, cvPoint(face_rect.x*scale,face_rect.y*scale),
- cvPoint((face_rect.x+face_rect.width)*scale,
- (face_rect.y+face_rect.height)*scale),
- CV_RGB(0,255,0), 3 );*/
- if(face_rect.width*face_rect.height>tmpMaxSurface) {
- theRealX=face_rect.x;
- theRealY=face_rect.y;
- theRealHeight=face_rect.height;
- theRealWidth=face_rect.width;
- tmpMaxSurface=face_rect.width*face_rect.height;
- }
-
- }
- cvRectangle( image, cvPoint(theRealX*scale,theRealY*scale),
- cvPoint((theRealX+theRealWidth)*scale,
- (theRealY+theRealHeight)*scale),
- CV_RGB(0,255,0), 3, 8, 0 );
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[OpenCV] translation selon X : %d - translation selon Y : %d\n", (theRealX - prev_x0), (theRealY -prev_y0) ));
-
- /*send data frame to GPAC*/
- {
- char *buf;
- u32 buf_size;
- GF_BitStream *bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- gf_bs_write_int(bs, 1, 1);
- gf_bs_write_float(bs, (Float) (theRealX - 640/2) );
- gf_bs_write_float(bs, (Float) (480/2 - theRealY) );
-
- gf_bs_align(bs);
- gf_bs_get_content(bs, &buf, &buf_size);
- gf_bs_del(bs);
- ifce->DispatchFrame(ifce, buf, buf_size);
- gf_free(buf);
- }
-
-
- prev_x0=theRealX;
- prev_y0=theRealY;
-
- if( small_image != image )
- cvReleaseImage( &small_image );
-
- cvReleaseMemStorage( &storage );
-}
-
-static u32 OCV_Run(void *par)
-{
- IplImage* image;
- CvCapture *capture;
- GF_InputSensorDevice *ifce = (GF_InputSensorDevice *)par;
- GF_OpenCV *ocv = (GF_OpenCV *)ifce->udta;
-
- capture= cvCaptureFromCAM(0);
- cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH,640 );
- cvSetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT, 480 );
-
- cvNamedWindow( "test", 0 );
-
- image = NULL;
- while (ocv->running) {
- if (cvGrabFrame(capture)) {
- CvHaarClassifierCascade* cascade;
-
- image = cvRetrieveFrame(capture);
-
- cascade = load_object_detector("haarcascade_frontalface_default.xml");
- detect_and_draw_objects(ifce, image, cascade, 1 );
-
-
- cvShowImage( "test", image );
- cvWaitKey(40);
- }
- }
- if (image) cvReleaseImage( &image);
- return 0;
-}
-
-static void OCV_Start(struct __input_device *ifce)
-{
- GF_OpenCV *ocv = (GF_OpenCV*)ifce->udta;
- ocv->running = 1;
- gf_th_run(ocv->th, OCV_Run, ifce);
-}
-
-static void OCV_Stop(struct __input_device *ifce)
-{
- GF_OpenCV *ocv = (GF_OpenCV*)ifce->udta;
- ocv->running = 0;
-}
-
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_INPUT_DEVICE_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- GF_InputSensorDevice *plug;
- GF_OpenCV *udta;
- if (InterfaceType != GF_INPUT_DEVICE_INTERFACE) return NULL;
-
- GF_SAFEALLOC(plug, GF_InputSensorDevice);
- GF_REGISTER_MODULE_INTERFACE(plug, GF_INPUT_DEVICE_INTERFACE, "GPAC Demo InputSensor", "gpac distribution")
-
- plug->RegisterDevice = OCV_RegisterDevice;
- plug->Start = OCV_Start;
- plug->Stop = OCV_Stop;
-
- GF_SAFEALLOC(udta, GF_OpenCV);
- plug->udta = udta;
- udta->th = gf_th_new("OpenCV");
-
- return (GF_BaseInterface *)plug;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *bi)
-{
- GF_InputSensorDevice *ifcn = (GF_InputSensorDevice*)bi;
- if (ifcn->InterfaceType==GF_INPUT_DEVICE_INTERFACE) {
- gf_free(bi);
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( opencv_is )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/osd
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-LINKLIBS= -lgpac
-LOCAL_LIB=../../bin/gcc
-
-#common objects
-OBJS=osd.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_osd$(DYN_LIB_SUFFIX)
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L$(LOCAL_LIB) $(LINKLIBS) $(LDFLAGS)
-
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2011-2012
- * All rights reserved
- *
- * This file is part of GPAC / Sampe On-Scvreen Display sub-project
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/modules/term_ext.h>
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/compositor_dev.h>
-#include <gpac/nodes_mpeg4.h>
-
-
-typedef struct
-{
- GF_ObjectManager *odm;
- GF_Terminal *term;
- GF_TermEventFilter evt_filter;
-
- /*some of our nodes*/
- M_Switch *visible;
- M_Transform2D *transform;
- M_CompositeTexture2D *ct2d;
- M_Text *text;
-
- char statBuffer[100];
- u32 refresh_time_ms;
- GF_SystemRTInfo rti;
-} GF_OSD;
-
-#if 0
-static GFINLINE GF_Node *create_node(GF_OSD *osd, u32 tag, GF_Node *par)
-{
- GF_Node *n = gf_node_new(osd->odm->subscene->graph, tag);
- if (n) {
- gf_node_init(n);
- if (par) {
- gf_node_list_add_child( & ((GF_ParentNode *)par)->children, n);
- gf_node_register(n, par);
- }
- }
- return n;
-}
-#endif
-
-const char *osd_scene_graph = "\
-EXTERNPROTO Untransform [\
- exposedField MFNode children []\
-]\
-[ \"urn:inet:gpac:builtin:Untransform\"]\
-OrderedGroup {\
- children [\
- Untransform {\
- children [\
- DEF N1 Switch {\
- whichChoice 0\
- choice [\
- DEF N2 Transform2D {\
- children [\
- Shape {\
- appearance Appearance {\
- material Material2D {\
- transparency 0\
- filled TRUE\
- }\
- texture DEF N3 CompositeTexture2D {\
- pixelWidth 256\
- pixelHeight 16\
- children [\
- Background2D {backColor 0.6 0.6 0.6}\
- Shape {\
- appearance Appearance {\
- material Material2D {\
- emissiveColor 0 0 0\
- filled TRUE\
- }\
- }\
- geometry DEF N4 Text {\
- string [\"My Sample Text !\"]\
- fontStyle FontStyle {\
- size 12\
- justify [\"MIDDLE\", \"MIDDLE\"]\
- family [\"SANS\"]\
- }\
- }\
- }\
- ]\
- }\
- }\
- geometry Bitmap {}\
- }\
- ]\
- }\
- ]\
- }\
- ]\
- }\
- ]\
-}\
-";
-
-void osd_on_resize(GF_Node *hdl, GF_DOM_Event *event, GF_Node *observer)
-{
- GF_DOMHandler *the_hdl = (GF_DOMHandler *) hdl;
- GF_OSD *osd = the_hdl->evt_listen_obj;
-
- if (osd->ct2d) {
- //osd->ct2d->pixelWidth = FIX2INT(event->screen_rect.width);
- gf_node_dirty_set((GF_Node *) osd->ct2d, GF_SG_NODE_DIRTY, 1);
-
- if (osd->transform) {
- osd->transform->translation.y = INT2FIX( (FIX2INT(event->screen_rect.height) - osd->ct2d->pixelHeight) / 2 ) ;
- gf_node_dirty_set((GF_Node *) osd->transform, GF_SG_NODE_DIRTY, 1);
- }
- }
-}
-
-Bool osd_load_scene(GF_OSD *osd)
-{
- GF_Node *n;
- GF_List *nodes;
- const char *opt;
- GF_DOMHandler *hdl;
- /*BT/VRML from string*/
- GF_List *gf_sm_load_bt_from_string(GF_SceneGraph *in_scene, const char *node_str, Bool force_wrl);
-
- /*create a new scene*/
- osd->odm = gf_odm_new();
- osd->odm->term = osd->term;
- osd->odm->subscene = gf_scene_new(NULL);
- osd->odm->subscene->root_od = osd->odm;
- gf_sg_set_scene_size_info(osd->odm->subscene->graph, 0, 0, 1);
-
- /*create a scene graph*/
- nodes = gf_sm_load_bt_from_string(osd->odm->subscene->graph, osd_scene_graph, 0);
- n = gf_list_get(nodes, 0);
- gf_list_del(nodes);
-
- if (!n) return 0;
-
- gf_sg_set_root_node(osd->odm->subscene->graph, n);
- gf_sg_set_scene_size_info(osd->odm->subscene->graph, 0, 0, 1);
-
- hdl = gf_dom_listener_build(n, GF_EVENT_RESIZE, 0);
- hdl->handle_event = osd_on_resize;
- hdl->evt_listen_obj = osd;
-
- osd->visible = (M_Switch *)gf_sg_find_node_by_name(osd->odm->subscene->graph, "N1");
- osd->transform = (M_Transform2D *)gf_sg_find_node_by_name(osd->odm->subscene->graph, "N2");
- osd->ct2d = (M_CompositeTexture2D *)gf_sg_find_node_by_name(osd->odm->subscene->graph, "N3");
- osd->text = (M_Text *)gf_sg_find_node_by_name(osd->odm->subscene->graph, "N4");
- if (osd->text->string.vals[0]) {
- gf_free(osd->text->string.vals[0]);
- osd->text->string.vals[0] = NULL;
- }
- strcpy(osd->statBuffer, "Hello World !");
- osd->text->string.vals[0] = osd->statBuffer;
-
- opt = gf_opts_get_key("OSD", "Visible");
- if (!opt || strcmp(opt, "yes")) osd->visible->whichChoice = -1;
-
-
- return 1;
-}
-
-
-Bool osd_on_event_play(void *udta, GF_Event *event, Bool consumed_by_compositor)
-{
- GF_OSD* osd = (GF_OSD*)udta;
- switch (event->type) {
- case GF_EVENT_SCENE_SIZE:
- gf_sg_set_scene_size_info(osd->odm->subscene->graph, event->size.width, event->size.height, 1);
- break;
- case GF_EVENT_KEYUP:
- if ( (event->key.key_code == GF_KEY_I) && (event->key.flags & GF_KEY_MOD_CTRL)) {
- if (osd->visible->whichChoice==0) {
- osd->visible->whichChoice = -1;
- gf_cfg_set_key(osd->term->user->config, "OSD", "Visible", "no");
- } else {
- osd->visible->whichChoice = 0;
- gf_cfg_set_key(osd->term->user->config, "OSD", "Visible", "yes");
- }
- gf_node_dirty_set((GF_Node *) osd->visible, GF_SG_NODE_DIRTY, 1);
- }
- break;
- }
- return 0;
-}
-static Bool osd_process(GF_TermExt *termext, u32 action, void *param)
-{
- const char *opt;
- GF_OSD *osd = termext->udta;
-
- switch (action) {
- case GF_TERM_EXT_START:
- osd->term = (GF_Terminal *) param;
- opt = gf_opts_get_key("OSD", "Enabled");
- if (!opt || strcmp(opt, "yes")) return 0;
-
- /*load scene*/
- if (! osd_load_scene(osd)) return 0;
- /*attach scene to compositor*/
- gf_sc_register_extra_graph(osd->term->compositor, osd->odm->subscene->graph, 0);
-
-
- /*we are not threaded*/
- termext->caps |= GF_TERM_EXTENSION_NOT_THREADED;
-
- osd->refresh_time_ms = 500;
- osd->evt_filter.on_event = osd_on_event_play;
- osd->evt_filter.udta = osd;
- gf_term_add_event_filter(osd->term, &osd->evt_filter);
- return 1;
-
- case GF_TERM_EXT_STOP:
- osd->text->string.vals[0] = NULL;
- /*remove scene to compositor*/
- gf_sc_register_extra_graph(osd->term->compositor, osd->odm->subscene->graph, 1);
- gf_odm_disconnect(osd->odm, 1);
- osd->odm = NULL;
-
- gf_term_remove_event_filter(osd->term, &osd->evt_filter);
- osd->term = NULL;
- break;
-
- case GF_TERM_EXT_PROCESS:
- /*flush all events until current time if reached*/
- if ((osd->visible->whichChoice==0) && gf_sys_get_rti(osd->refresh_time_ms, &osd->rti, 0)) {
- sprintf(osd->statBuffer, "CPU %02d - FPS %02.2f - MEM "LLU" KB", osd->rti.process_cpu_usage, gf_sc_get_fps(osd->term->compositor, 0), osd->rti.process_memory/1000);
- gf_node_dirty_set((GF_Node *) osd->text, GF_SG_NODE_DIRTY, 1);
- }
- break;
- }
- return 0;
-}
-
-
-GF_TermExt *osd_new()
-{
- GF_TermExt *dr;
- GF_OSD *osd;
- dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));
- memset(dr, 0, sizeof(GF_TermExt));
- GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC OnScreen Display", "gpac distribution");
-
- GF_SAFEALLOC(osd, GF_OSD);
- dr->process = osd_process;
- dr->udta = osd;
- return dr;
-}
-
-
-void osd_delete(GF_BaseInterface *ifce)
-{
- GF_TermExt *dr = (GF_TermExt *) ifce;
- GF_OSD *osd = dr->udta;
- gf_free(osd);
- gf_free(dr);
-}
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_TERM_EXT_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_TERM_EXT_INTERFACE) return (GF_BaseInterface *)osd_new();
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- switch (ifce->InterfaceType) {
- case GF_TERM_EXT_INTERFACE:
- osd_delete(ifce);
- break;
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( osd )
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-#include "PltUPnP.h"
-#include "GPACFileMediaServer.h"
-#include "PltMediaItem.h"
-#include "PltService.h"
-#include "PltTaskManager.h"
-#include "PltHttpServer.h"
-#include "PltDidl.h"
-#include "PltMetadataHandler.h"
-#include "PltVersion.h"
-
-#include <gpac/network.h>
-
-NPT_SET_LOCAL_LOGGER("gpac.media.server.file")
-
-GPAC_FileMediaServer::GPAC_FileMediaServer(const char* friendly_name,
- bool show_ip,
- const char* uuid,
- NPT_UInt16 port) : PLT_FileMediaServer("", friendly_name, show_ip, uuid, port)
-{
-}
-
-void GPAC_FileMediaServer::AddSharedDirectory(const char *path, const char *alias, Bool is_hidden)
-{
- u8 buf[10];
- if (!alias) {
- sprintf((char*)buf, "%08X", gf_crc_32((char*) path, (u32) strlen(path)));
- alias = (const char *)buf;
- }
- m_Directories.Add(GPAC_MediaDirectory(alias, path, is_hidden));
-}
-
-
-
-NPT_Result
-GPAC_FileMediaServer::OnBrowseDirectChildren(PLT_ActionReference& action,
- const char* object_id,
- const char* filter,
- NPT_UInt32 start_index,
- NPT_UInt32 req_count,
- const char* sort_criteria,
- const PLT_HttpRequestContext& context)
-{
- /*not the root of our server*/
- if (strcmp(object_id, "/") && strcmp(object_id, "\\") && strcmp(object_id, "0")) {
- return PLT_MediaServer::OnBrowseDirectChildren(action, object_id, filter, start_index, req_count, sort_criteria, context);
- }
-
- unsigned long cur_index = 0;
- unsigned long num_returned = 0;
- unsigned long total_matches = 0;
- NPT_String didl = didl_header;
-
- PLT_MediaObjectReference item;
- for (u32 i=0; i<m_Directories.GetItemCount(); i++) {
- GPAC_MediaDirectory *alias;
- m_Directories.Get(i, alias);
- if (alias->m_Hide) continue;
-
- item = BuildFromFilePath(alias->m_Path, context, true, false);
-
- if (!item.IsNull()) {
- if ((cur_index >= start_index) && ((num_returned < req_count) || (req_count == 0))) {
- NPT_String tmp;
- NPT_CHECK_SEVERE(PLT_Didl::ToDidl(*item.AsPointer(), filter, tmp));
-
- didl += tmp;
- num_returned++;
- }
- cur_index++;
- total_matches++;
- }
- };
-
- didl += didl_footer;
-
- NPT_CHECK_SEVERE(action->SetArgumentValue("Result", didl));
- NPT_CHECK_SEVERE(action->SetArgumentValue("NumberReturned", NPT_String::FromInteger(num_returned)));
- NPT_CHECK_SEVERE(action->SetArgumentValue("TotalMatches", NPT_String::FromInteger(total_matches))); // 0 means we don't know how many we have but most browsers don't like that!!
- NPT_CHECK_SEVERE(action->SetArgumentValue("UpdateId", "1"));
-
- return NPT_SUCCESS;
-}
-
-NPT_Result
-GPAC_FileMediaServer::ServeFile(const NPT_HttpRequest& request,
- const NPT_HttpRequestContext& context,
- NPT_HttpResponse& response,
- const NPT_String& _file_path)
-{
- NPT_COMPILER_UNUSED(context);
-
- NPT_String file_path = _file_path;
- NPT_String uri_path = NPT_Uri::PercentDecode(request.GetUrl().GetPath());
- NPT_String query = request.GetUrl().GetQuery();
- if (! query.IsEmpty()) {
- uri_path += "?";
- uri_path += query;
- }
-
- // prevent hackers from accessing files outside of our root
- if ((file_path.Find("/..") >= 0) || (file_path.Find("\\..") >= 0)) {
- return NPT_FAILURE;
- }
-
- NPT_String file_id = (const char *) file_path + ((file_path[0]=='0') ? 2:1);
- for (u32 i=0; i<m_Directories.GetItemCount(); i++) {
- GPAC_MediaDirectory *dir;
- m_Directories.Get(i, dir);
- if (file_id.StartsWith(dir->m_Alias)) {
- file_path = dir->m_Path + ((const char *) file_id + strlen(dir->m_Alias)+1);
- break;
- }
- }
-
- //Virtual File request
- for (u32 i=0; i<m_VirtualFiles.GetItemCount(); i++) {
- GPAC_VirtualFile vfile;
- m_VirtualFiles.Get(i, vfile);
-
- NPT_String path = uri_path;
- path.Replace('/', NPT_FilePath::Separator);
-
- if (path == vfile.m_URI) {
- NPT_Result res;
- NPT_Position start, end;
-#if 0
- PLT_HttpHelper::GetRange(request, start, end);
-#else
- start = end = -1;
-#endif
- res = ServeVirtualFile(response, &vfile, start, end, !request.GetMethod().Compare("HEAD"));
- if (vfile.m_temporary) {
- m_VirtualFiles.Remove(vfile);
- }
- return res;
- }
- }
-
- // File requested
- NPT_String path = m_FileRoot;
- if (path.Compare(uri_path.Left(path.GetLength()), true) == 0) {
-#if 0
- NPT_Position start, end;
- PLT_HttpHelper::GetRange(request, start, end);
-
- return PLT_HttpServer::ServeFile(response,
- file_path,
- start,
- end,
- !request.GetMethod().Compare("HEAD"));
-#else
- return PLT_HttpServer::ServeFile(request, context, response, NPT_FilePath::Create(m_FileRoot, file_path) );
-#endif
- }
-
-
- return NPT_FAILURE;
-}
-
-NPT_Result
-GPAC_FileMediaServer::GetFilePath(const char* object_id,
- NPT_String& filepath)
-{
- if (!object_id) return NPT_ERROR_INVALID_PARAMETERS;
-
- NPT_String obj_id = object_id + (object_id[0]=='0' ? 2 : 1);
- filepath = "";
- for (u32 i=0; i<m_Directories.GetItemCount(); i++) {
- GPAC_MediaDirectory *dir;
- m_Directories.Get(i, dir);
- if (obj_id.StartsWith(dir->m_Alias)) {
- filepath = dir->m_Path;
- object_id += (object_id[0]=='0' ? 2 : 1);
- if (!strcmp(object_id, dir->m_Alias)) {
- object_id = "";
- } else {
- object_id += strlen(dir->m_Alias) + 1;
- }
- break;
- }
- }
-
- if (NPT_StringLength(object_id) > 2 || object_id[0]!='0') {
- filepath += (const char*)object_id + (object_id[0]=='0'?1:0);
- }
-
- return NPT_SUCCESS;
-}
-
-PLT_MediaObject*
-GPAC_FileMediaServer::BuildFromFilePath(const NPT_String& filepath,
- const PLT_HttpRequestContext &context,
- bool with_count,
- bool keep_extension_in_title,
- bool allip)
-{
- return BuildFromFilePathAndHost(filepath, &context, with_count, keep_extension_in_title, NULL);
-
-}
-
-PLT_MediaObject*
-GPAC_FileMediaServer::BuildFromFilePathAndHost(const NPT_String& __filepath,
- const PLT_HttpRequestContext *context,
- bool with_count /* = true */,
- bool keep_extension_in_title /* = false */,
- const char *host)
-{
- PLT_MediaItemResource resource;
- PLT_MediaObject* object = NULL;
- NPT_String filepath = __filepath;
- unsigned int len;
-
- /* retrieve the entry type (directory or file) */
- NPT_FileInfo info;
- NPT_CHECK_LABEL_FATAL(NPT_File::GetInfo(__filepath, &info), failure);
-
- len = 0;
- for (u32 i=0; i<m_Directories.GetItemCount(); i++) {
- GPAC_MediaDirectory *dir;
- m_Directories.Get(i, dir);
- if (__filepath.StartsWith(dir->m_Path) && (dir->m_Path.GetLength() > len) ) {
- char *fp = __filepath;
- filepath = NPT_FilePath::Separator + dir->m_Alias + NPT_String( fp + strlen(dir->m_Path) - 1);
- len = dir->m_Path.GetLength();
- }
- }
-
-
- if (info.m_Type == NPT_FileInfo::FILE_TYPE_REGULAR) {
- NPT_IpAddress ip;
-
- object = new PLT_MediaItem();
-
- /* Set the title using the filename for now */
- object->m_Title = NPT_FilePath::BaseName(filepath, keep_extension_in_title);
- if (object->m_Title.GetLength() == 0) goto failure;
-
- /* Set the protocol Info from the extension */
- resource.m_ProtocolInfo = PLT_ProtocolInfo(PLT_ProtocolInfo::GetProtocolInfo(filepath, true, context));
- if (!resource.m_ProtocolInfo.IsValid()) goto failure;
-
- /* Set the resource file size */
- resource.m_Size = info.m_Size;
-
- /* format the resource URI */
- NPT_String url = "0" + filepath;
-
-
- if (host) {
- ip.Parse(host);
-
- NPT_List<NPT_NetworkInterface*> if_list;
- NPT_List<NPT_NetworkInterface*>::Iterator net_if;
- NPT_List<NPT_NetworkInterfaceAddress>::Iterator net_if_addr;
-
- NPT_CHECK_LABEL_SEVERE(PLT_UPnPMessageHelper::GetNetworkInterfaces(if_list, true), failure);
-
- for (net_if = if_list.GetFirstItem(); net_if; net_if++) {
- if ( (*net_if)->IsAddressInNetwork(ip) ) {
- ip = (*net_if)->GetAddresses().GetFirstItem()->GetPrimaryAddress();
- break;
- }
- }
-
- } else if (context) {
- ip = context->GetLocalAddress().GetIpAddress();
- } else {
- // get list of ip addresses
- NPT_List<NPT_IpAddress> ips;
- NPT_CHECK_LABEL_SEVERE(PLT_UPnPMessageHelper::GetIPAddresses(ips), failure);
-
- // iterate through list and build list of resources
- NPT_List<NPT_IpAddress>::Iterator ipi = ips.GetFirstItem();
-
- ip = *ipi;
- }
-
-#if 0
- /* Look to see if a metadatahandler exists for this extension */
- PLT_MetadataHandler* handler = NULL;
- NPT_Result res = NPT_ContainerFind(
- m_MetadataHandlers,
- PLT_MetadataHandlerFinder(NPT_FilePath::FileExtension(filepath)),
- handler);
- if (NPT_SUCCEEDED(res) && handler) {
- /* if it failed loading data, reset the metadatahandler so we don't use it */
- if (NPT_SUCCEEDED(handler->Load(filepath))) {
- /* replace the title with the one from the Metadata */
- NPT_String newTitle;
- if (handler->GetTitle(newTitle) != NULL) {
- object->m_Title = newTitle;
- }
-
- /* assign description */
- handler->GetDescription(object->m_Description.long_description);
-
- /* assign album art uri if we haven't yet */
- /* prepend the album art base URI and url encode it */
- if (object->m_ExtraInfo.album_art_uri.GetLength() == 0) {
- object->m_ExtraInfo.album_art_uri =
- NPT_Uri::PercentEncode(BuildResourceUri(m_AlbumArtBaseUri, ip.ToString(), url),
- NPT_Uri::UnsafeCharsToEncode);
- }
-
- /* duration */
- handler->GetDuration(resource.m_Duration);
-
- /* protection */
- handler->GetProtection(resource.m_Protection);
- }
- }
-#endif
- object->m_ObjectClass.type = PLT_MediaItem::GetUPnPClass(filepath, context);
-
- NPT_HttpUrl base_uri(m_FileRoot);
- resource.m_Uri = BuildResourceUri(base_uri/*m_FileBaseUri*/, ip.ToString(), url);
- object->m_Resources.Add(resource);
-
- } else {
- object = new PLT_MediaContainer;
-
- /* Assign a title for this container */
- if ((filepath.Compare("/", true) == 0) || (filepath.Compare("\\", true) == 0)) {
- object->m_Title = "Root";
- } else {
- filepath.TrimRight("/\\");
- object->m_Title = NPT_FilePath::BaseName(filepath, keep_extension_in_title);
- if (object->m_Title.GetLength() == 0) goto failure;
- }
-
-#ifndef _WIN32_WCE
- /* Get the number of children for this container */
- NPT_Cardinal count = 0;
-
- // reset output params
- count = 0;
- if (with_count ) {
- NPT_List<NPT_String> entries;
- NPT_File::ListDir(__filepath, entries);
- count = entries.GetItemCount();
- ((PLT_MediaContainer*)object)->m_ChildrenCount = count;
- }
-#endif //_WIN32_WCE
-
- object->m_ObjectClass.type = "object.container";
- }
-
- /* is it the root? */
- if ((filepath.Compare("/", true) == 0) || (filepath.Compare("\\", true) == 0)) {
- object->m_ParentID = "-1";
- object->m_ObjectID = "0";
- } else {
- NPT_String directory = NPT_FilePath::DirName(filepath);
- /* is the parent path the root? */
- if ((directory.Compare("/", true) == 0) || (directory.Compare("\\", true) == 0)) {
- object->m_ParentID = "0";
- } else {
- object->m_ParentID = "0" + directory;
- }
- object->m_ObjectID = "0" + filepath;
- }
- return object;
-
-failure:
- delete object;
- return NULL;
-}
-
-
-NPT_String GPAC_FileMediaServer::GetResourceURI(const char *url, const char *for_host)
-{
- char *abs_url;
- NPT_String res = url, path;
-
- abs_url = NULL;
- for (u32 i=0; i<m_Directories.GetItemCount(); i++) {
- GPAC_MediaDirectory *dir;
- m_Directories.Get(i, dir);
- abs_url = gf_url_concatenate(dir->m_Path, url);
- FILE *f = gf_fopen(abs_url, "rt");
- if (f) {
- gf_fclose(f);
- break;
- }
- gf_free((void*)abs_url);
- abs_url = NULL;
- }
- if (!abs_url ) return res;
-
- /*url was absolute, add its root directory*/
- if (!strcmp(abs_url, url)) {
- Bool found = GF_FALSE;
- NPT_String newdir;
- /*if the path is /my/example/path/test.ext, we want to share the parent directory
- /my/example/, otherwise we will loose the ability to browse for resource in the parent dir
- */
- u32 nb_sep=0;
- u32 len = (u32) strlen(abs_url);
- u32 i=0;
- while (i<=len) {
- if ((abs_url[len-i]=='\\') || (abs_url[len-i]=='/') ) {
- nb_sep++;
- if (nb_sep==2) break;
- }
- i++;
- }
- /*if no parent directory, we don't allow sharing of the resource*/
- if (nb_sep!=2) return "";
-
- char sep = abs_url[len-i];
- abs_url[len-i] = 0;
- newdir = abs_url;
- abs_url[len-i] = sep;
-
- newdir.Replace('/', NPT_FilePath::Separator);
- newdir += NPT_FilePath::Separator;
-
- for (u32 i=0; i<m_Directories.GetItemCount(); i++) {
- GPAC_MediaDirectory *dir;
- m_Directories.Get(i, dir);
- if (!strcmp(newdir, dir->m_Path)) {
- found = GF_TRUE;
- }
- }
- if (!found)
- AddSharedDirectory(newdir, NULL, GF_TRUE);
- }
-
- path = abs_url;
- /*replace all '/' with neptune file path separator otherwise file functions get screwed up ...*/
- path.Replace('/', NPT_FilePath::Separator);
-
- gf_free((void*)abs_url);
-
- PLT_MediaObject*mobj = BuildFromFilePathAndHost(path, NULL, true, false, for_host);
- if (mobj) {
- res = mobj->m_Resources[0].m_Uri;
- delete mobj;
- }
- return res;
-}
-
-void GPAC_FileMediaServer::ShareVirtualResource(const char *res_uri, const char *res_val, const char *res_mime, Bool temporary)
-{
- NPT_String the_uri;
- char *uri = (char *)res_uri;
- char *sep = (char *) strstr(res_uri, "://");
- if (sep) {
- sep = strchr(sep+3, '/');
- if (sep) uri = sep;
- else uri = (char*)"/";
- }
- the_uri = "";
- while (1) {
- sep = strchr(uri, '%');
- if (!sep) break;
-
- if (!strnicmp(sep, "%3f", 3) || !strnicmp(sep, "%5c", 3) || !strnicmp(sep, "%2f", 3)) {
- sep[0]=0;
- the_uri += uri;
- sep[0]='%';
-
- if (!strnicmp(sep, "%3f", 3))
- the_uri += "?";
- else if (!strnicmp(sep, "%5c", 3))
- the_uri += "/";
- else
- the_uri += " ";
- uri= sep+3;
- continue;
- } else {
- the_uri += "%";
- uri= sep+1;
- }
- }
- the_uri += uri;
- the_uri.Replace('/', NPT_FilePath::Separator);
-
- GPAC_VirtualFile vres(the_uri, res_val, res_mime, temporary);
-
- m_VirtualFiles.Add(vres);
- GF_LOG(GF_LOG_DEBUG, GF_LOG_NETWORK, ("[UPnP] sharing virtual file %s as %s\n", res_uri, (const char *)the_uri));
-}
-
-NPT_Result
-GPAC_FileMediaServer::ServeVirtualFile(NPT_HttpResponse& response,
- GPAC_VirtualFile *vfile,
- NPT_Position start,
- NPT_Position end,
- bool request_is_head)
-{
- NPT_LargeSize total_len;
- NPT_Result result;
-
- NPT_MemoryStream* memory_stream = new NPT_MemoryStream(vfile->m_Content.GetChars(), vfile->m_Content.GetLength() );
- NPT_InputStreamReference stream(memory_stream);
-
- if (NPT_FAILED(result = stream->GetSize(total_len)) ) {
- response.SetStatus(404, "File Not Found");
- return NPT_SUCCESS;
- }
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_NETWORK, ("[UPnP] Serving virtual file %s\n", vfile->m_Content.GetChars()));
-
- NPT_HttpEntity* entity = new NPT_HttpEntity();
- entity->SetContentLength(total_len);
- response.SetEntity(entity);
- entity->SetContentType(vfile->m_MIME);
-
- // request is HEAD, returns without setting a body
- if (request_is_head) return NPT_SUCCESS;
-
- // see if it was a byte range request
- if (start != (NPT_Position)-1 || end != (NPT_Position)-1) {
- // we can only support a range from an offset to the end of the resource for now
- // due to the fact we can't limit how much to read from a stream yet
- NPT_Position start_offset = (NPT_Position)-1, end_offset = total_len - 1, len;
- if (start == (NPT_Position)-1 && end != (NPT_Position)-1) {
- // we are asked for the last N=end bytes
- // adjust according to total length
- if (end >= total_len) {
- start_offset = 0;
- } else {
- start_offset = total_len-end;
- }
- } else if (start != (NPT_Position)-1) {
- start_offset = start;
- // if the end is specified but incorrect
- // set the end_offset in order to generate a bad response
- if (end != (NPT_Position)-1 && end < start) {
- end_offset = (NPT_Position)-1;
- }
- }
-
- // in case the range request was invalid or we can't seek then respond appropriately
- if (start_offset == (NPT_Position)-1 || end_offset == (NPT_Position)-1 ||
- start_offset > end_offset || NPT_FAILED(stream->Seek(start_offset))) {
- response.SetStatus(416, "Requested range not satisfiable");
- } else {
- len = end_offset - start_offset + 1;
- response.SetStatus(206, "Partial Content");
- entity->SetInputStream(stream);
- entity->SetContentLength(len);
- }
- } else {
- entity->SetInputStream(stream);
- }
- return NPT_SUCCESS;
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-
-#ifndef _GPAC_FILE_MEDIA_SERVER_H_
-#define _GPAC_FILE_MEDIA_SERVER_H_
-
-#include "PltFileMediaServer.h"
-
-#include <gpac/list.h>
-
-#define MAX_PATH_LENGTH 1024
-
-class PLT_MetadataHandler;
-
-class GPAC_MediaDirectory
-{
-public:
- /*
- if is_hidden is set, directory is not visible during BrowseDirectChildren
- if alias is NULL, a CRC32 of the path name will be used
- */
- GPAC_MediaDirectory(const char *alias, const char *path, Bool is_hidden = GF_FALSE)
- {
- m_Path = path;
- m_Path.Replace('/', NPT_FilePath::Separator);
- m_Path.TrimRight("/\\");
- m_Path += NPT_FilePath::Separator;
- m_Alias = alias;
- m_Alias.TrimRight("/\\");
- m_Alias.TrimLeft("/\\");
- m_Hide = is_hidden;
- }
- NPT_String m_Path;
- NPT_String m_Alias;
- Bool m_Hide;
-};
-
-class GPAC_VirtualFile
-{
-public:
- GPAC_VirtualFile(const char *uri="", const char *val="", const char *mime="", Bool temporary= GF_FALSE)
- {
- m_URI = uri;
- m_Content = val;
- m_MIME = mime;
- m_temporary = temporary;
- }
- bool operator==(const GPAC_VirtualFile & v1) {
- return m_URI==v1.m_URI;
- }
-
- NPT_String m_URI;
- NPT_String m_Content;
- NPT_String m_MIME;
- Bool m_temporary;
-};
-
-class GPAC_FileMediaServer : public PLT_FileMediaServer
-{
-public:
- GPAC_FileMediaServer(const char* friendly_name,
- bool show_ip = false,
- const char* uuid = NULL,
- NPT_UInt16 port = 0);
-
-
- void AddSharedDirectory(const char *path, const char *alias, Bool is_hidden = GF_FALSE);
-
- NPT_String GetResourceURI(const char *file_path, const char *for_host);
- void ShareVirtualResource(const char *res_uri, const char *res_val, const char *res_mime, Bool temporary = GF_FALSE);
-
-protected:
- virtual NPT_Result OnBrowseDirectChildren(PLT_ActionReference& action,
- const char* object_id,
- const char* filter,
- NPT_UInt32 starting_index,
- NPT_UInt32 requested_count,
- const char * sort_criteria,
- const PLT_HttpRequestContext& context);
-
- virtual NPT_Result GetFilePath(const char* object_id, NPT_String& filepath);
-
- virtual NPT_Result ServeFile(const NPT_HttpRequest& request,
- const NPT_HttpRequestContext& context,
- NPT_HttpResponse& response,
- const NPT_String& file_path);
-
- virtual PLT_MediaObject* BuildFromFilePath(const NPT_String& filepath,
- const PLT_HttpRequestContext& context,
- bool with_count = true,
- bool keep_extension_in_title = false,
- bool allip = false);
-
- PLT_MediaObject* BuildFromFilePathAndHost(const NPT_String& filepath,
- const PLT_HttpRequestContext *context = NULL,
- bool with_count = true,
- bool keep_extension_in_title = false,
- const char *for_host = NULL);
-
- NPT_Result ServeVirtualFile(NPT_HttpResponse& response,
- GPAC_VirtualFile *vfile,
- NPT_Position start,
- NPT_Position end,
- bool request_is_head);
-
-private:
- NPT_List<GPAC_MediaDirectory> m_Directories;
- NPT_List<GPAC_VirtualFile> m_VirtualFiles;
-};
-
-#endif /* _PLT_FILE_MEDIA_SERVER_H_ */
+++ /dev/null
-
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-
-#include "GPACPlatinum.h"
-
-GPAC_MediaController::GPAC_MediaController(PLT_CtrlPointReference& ctrlPoint, GF_UPnP *upnp)
-{
- m_MediaController = new PLT_MediaController(ctrlPoint, this);
- m_MediaBrowser = new PLT_MediaBrowser(ctrlPoint, this);
-
- m_MediaServers = gf_list_new();
- m_MediaRenderers = gf_list_new();
- m_ControlPointLock = gf_mx_new("AVControlPoint");
- m_pUPnP = upnp;
-}
-
-
-GPAC_MediaController::~GPAC_MediaController()
-{
- delete m_MediaController;
- m_MediaController=NULL;
- delete m_MediaBrowser;
- m_MediaBrowser=NULL;
-
- while (gf_list_count(m_MediaServers)) {
- GPAC_MediaServerItem*ms = (GPAC_MediaServerItem*)gf_list_get(m_MediaServers, 0);
- gf_list_rem(m_MediaServers, 0);
- delete ms;
- }
- gf_list_del(m_MediaServers);
-
- while (gf_list_count(m_MediaRenderers)) {
- GPAC_MediaRendererItem *ms = (GPAC_MediaRendererItem *)gf_list_get(m_MediaRenderers, 0);
- gf_list_rem(m_MediaRenderers, 0);
- delete ms;
- }
- gf_list_del(m_MediaRenderers);
-
- gf_mx_del(m_ControlPointLock);
-}
-
-
-
-
-bool
-GPAC_MediaController::OnMRAdded(PLT_DeviceDataReference& device)
-{
- NPT_String uuid = device->GetUUID();
-
- gf_mx_p(m_ControlPointLock);
-
- // test if it's a media renderer
- PLT_Service* service;
- if (NPT_SUCCEEDED(device->FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", service))) {
- gf_list_add(m_MediaRenderers, new GPAC_MediaRendererItem(device, uuid) );
- }
- m_pUPnP->OnMediaRendererAdd(device, 1);
- gf_mx_v(m_ControlPointLock);
- return true;
-}
-
-
-void
-GPAC_MediaController::OnMRRemoved(PLT_DeviceDataReference& device)
-{
- NPT_String uuid = device->GetUUID();
-
- gf_mx_p(m_ControlPointLock);
-
- u32 i, count;
- count = gf_list_count(m_MediaRenderers);
- for (i=0; i<count; i++) {
- GPAC_MediaRendererItem *ms = (GPAC_MediaRendererItem *) gf_list_get(m_MediaRenderers, i);
- if (ms->m_UUID==uuid) {
- delete ms;
- gf_list_rem(m_MediaRenderers, i);
- break;
- }
- }
-
- m_pUPnP->OnMediaRendererAdd(device, 0);
- gf_mx_v(m_ControlPointLock);
-}
-
-bool
-GPAC_MediaController::OnMSAdded(PLT_DeviceDataReference& device)
-{
- NPT_String uuid = device->GetUUID();
-
- gf_mx_p(m_ControlPointLock);
- // test if it's a media server
- PLT_Service* service;
- if (NPT_SUCCEEDED(device->FindServiceByType("urn:schemas-upnp-org:service:ContentDirectory:1", service))) {
- gf_list_add(m_MediaServers, new GPAC_MediaServerItem(device, uuid) );
- }
- m_pUPnP->OnMediaServerAdd(device, 1);
- gf_mx_v(m_ControlPointLock);
- return true;
-}
-
-
-void
-GPAC_MediaController::OnMSRemoved(PLT_DeviceDataReference& device)
-{
- NPT_String uuid = device->GetUUID();
-
- gf_mx_p(m_ControlPointLock);
- u32 i, count;
- count = gf_list_count(m_MediaServers);
- for (i=0; i<count; i++) {
- GPAC_MediaServerItem *ms = (GPAC_MediaServerItem *) gf_list_get(m_MediaServers, i);
- if (ms->m_UUID==uuid) {
- delete ms;
- gf_list_rem(m_MediaServers, i);
- break;
- }
- }
- m_pUPnP->OnMediaServerAdd(device, 0);
- gf_mx_v(m_ControlPointLock);
-}
-
-
-
-NPT_Result
-GPAC_MediaController::OnActionResponse(NPT_Result res,
- PLT_ActionReference& action,
- void* userdata)
-{
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaController::OnEventNotify(PLT_Service* service, NPT_List<PLT_StateVariable*>* vars)
-{
- return NPT_SUCCESS;
-}
-
-void GPAC_MediaController::OnMRStateVariablesChanged(PLT_Service* service, NPT_List<PLT_StateVariable*>* vars )
-{
- u32 count;
- u32 i;
- s32 render_idx = -1;
-
- count = gf_list_count(m_MediaRenderers);
- for (i=0; i<count; i++) {
- GPAC_MediaRendererItem *mr = (GPAC_MediaRendererItem *) gf_list_get(m_MediaRenderers, i);
- if ( mr->m_device.AsPointer() == service->GetDevice() ) {
- render_idx = i;
- break;
- }
- }
- if (render_idx < 0) return;
-
- count = vars->GetItemCount();
- for (i=0; i<count; i++) {
- PLT_StateVariable *svar;
- vars->Get(i, svar);
- if (svar->GetName() == NPT_String("AbsoluteTimePosition")) {
- u32 h, m, s;
- if (sscanf((char *) svar->GetValue(), "%d:%d:%d", &h, &m, &s)==3) {
- Double time = h*3600 + m*60 + s;
- this->m_pUPnP->onTimeChanged(render_idx, time);
- }
- }
- else if (svar->GetName() == NPT_String("CurrentTrackDuration")) {
- u32 h, m, s;
- if (sscanf((char *) svar->GetValue(), "%d:%d:%d", &h, &m, &s)==3) {
- Double time = h*3600 + m*60 + s;
- this->m_pUPnP->onDurationChanged(render_idx, time);
- }
- }
-
- }
-}
-
-
-void GPAC_MediaController::OnBrowseResult(NPT_Result res, PLT_DeviceDataReference& device, PLT_BrowseInfo* info, void* userdata)
-{
- NPT_COMPILER_UNUSED(device);
-
- NPT_COMPILER_UNUSED(device);
-
- if (!userdata) return;
-
- GPAC_BrowseDataReference* data = (GPAC_BrowseDataReference*) userdata;
- (*data)->res = res;
- if (NPT_SUCCEEDED(res) && info) {
- (*data)->info = *info;
- }
- (*data)->shared_var.SetValue(1);
- delete data;
-}
-
-void
-GPAC_MediaController::OnMSStateVariablesChanged(PLT_Service* service, NPT_List<PLT_StateVariable*>* vars)
-{
- GPAC_MediaServerItem *ms = NULL;
- gf_mx_p(m_ControlPointLock);
-
- u32 i, count;
- count = gf_list_count(m_MediaServers);
- for (i=0; i<count; i++) {
- GPAC_MediaServerItem *ms = (GPAC_MediaServerItem *) gf_list_get(m_MediaServers, i);
- if (ms->m_UUID==service->GetDevice()->GetUUID()) {
- break;
- }
- ms = NULL;
- }
-
- if (!ms) {
- gf_mx_v(m_ControlPointLock);
- return;
- }
-
- PLT_StateVariable* var = PLT_StateVariable::Find(*vars, "ContainerUpdateIDs");
- if (var) {
- // variable found, parse value
- NPT_String value = var->GetValue();
- NPT_String item_id, update_id;
- int index;
-
- while (value.GetLength()) {
- // look for container id
- index = value.Find(',');
- if (index < 0) break;
- item_id = value.Left(index);
- value = value.SubString(index+1);
-
- // look for update id
- if (value.GetLength()) {
- index = value.Find(',');
- update_id = (index<0)?value:value.Left(index);
- value = (index<0)?"":value.SubString(index+1);
-
- m_pUPnP->ContainerChanged(ms->m_device, item_id, update_id);
- }
- }
- }
- gf_mx_v(m_ControlPointLock);
-}
-
-NPT_Result
-GPAC_MediaController::WaitForResponse(NPT_SharedVariable& shared_var)
-{
- return shared_var.WaitUntilEquals(1, 30000);
-}
-
-
-NPT_Result
-GPAC_MediaController::Browse(GPAC_BrowseDataReference& browse_data,
- PLT_DeviceDataReference& device,
- const char* object_id,
- NPT_Int32 index,
- NPT_Int32 count,
- bool browse_metadata,
- const char* filter,
- const char* sort)
-{
- NPT_Result res;
-
- browse_data->shared_var.SetValue(0);
-
- // send off the browse packet. Note that this will
- // not block. There is a call to WaitForResponse in order
- // to block until the response comes back.
- res = m_MediaBrowser->Browse(device,
- (const char*)object_id,
- index,
- count,
- browse_metadata,
- filter,
- sort,
- new GPAC_BrowseDataReference(browse_data));
- NPT_CHECK_SEVERE(res);
-
- return WaitForResponse(browse_data->shared_var);
-}
-
-NPT_Result
-GPAC_MediaController::Browse(GPAC_MediaServerItem *server, const char *object_id, const char *filter)
-{
- NPT_Result res = NPT_FAILURE;
- NPT_Int32 index = 0;
-
- // reset output params
- server->m_BrowseResults = NULL;
-
-
- do {
- GPAC_BrowseDataReference browse_data(new GPAC_BrowseData());
-
- // send off the browse packet. Note that this will
- // not block. There is a call to WaitForResponse in order
- // to block until the response comes back.
- res = Browse(browse_data,
- server->m_device,
- (const char*)object_id,
- index,
- 1024,
- false,
- filter,
- "");
- NPT_CHECK_LABEL_WARNING(res, done);
-
- if (NPT_FAILED(browse_data->res)) {
- res = browse_data->res;
- NPT_CHECK_LABEL_WARNING(res, done);
- }
-
- if (browse_data->info.items->GetItemCount() == 0)
- break;
-
- if (server->m_BrowseResults.IsNull()) {
- server->m_BrowseResults = browse_data->info.items;
- } else {
- server->m_BrowseResults->Add(*browse_data->info.items);
- // clear the list items so that the data inside is not
- // cleaned up by PLT_MediaItemList dtor since we copied
- // each pointer into the new list.
- browse_data->info.items->Clear();
- }
-
- // stop now if our list contains exactly what the server said it had
- if (browse_data->info.tm && browse_data->info.tm == server->m_BrowseResults->GetItemCount())
- break;
-
- // ask for the next chunk of entries
- index = server->m_BrowseResults->GetItemCount();
- } while(1);
-
-done:
- return res;
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-#ifndef _GPAC_MEDIA_CONTROLLER_H_
-#define _GPAC_MEDIA_CONTROLLER_H_
-
-#include "PltMediaServer.h"
-#include "PltMediaController.h"
-#include "PltMediaBrowser.h"
-#include "NptMap.h"
-#include "NptStack.h"
-
-#include <gpac/thread.h>
-
-typedef struct {
- NPT_SharedVariable shared_var;
- NPT_Result res;
- PLT_BrowseInfo info;
-} GPAC_BrowseData;
-
-/*basic class to hold each media renderer*/
-class GPAC_MediaRendererItem
-{
-public:
- GPAC_MediaRendererItem(PLT_DeviceDataReference device, NPT_String uuid) : m_device(device), m_UUID(uuid) { }
- PLT_DeviceDataReference m_device;
- NPT_String m_UUID;
-};
-
-/*basic class to hold each media server*/
-class GPAC_MediaServerItem
-{
-public:
- GPAC_MediaServerItem(PLT_DeviceDataReference device, NPT_String uuid) : m_device(device), m_UUID(uuid) , m_BrowseResults(NULL) { }
- PLT_DeviceDataReference m_device;
- NPT_String m_UUID;
- /*results of the last browse request on this server*/
- PLT_MediaObjectListReference m_BrowseResults;
- /*parent directory stack*/
- NPT_Stack<NPT_String> m_ParentDirectories;
-};
-
-typedef NPT_Reference<GPAC_BrowseData> GPAC_BrowseDataReference;
-
-class GF_UPnP;
-
-class GPAC_MediaController : public PLT_CtrlPointListener,
- public PLT_MediaControllerDelegate,
- public PLT_MediaBrowserDelegate
-{
-public:
- GPAC_MediaController(PLT_CtrlPointReference& ctrlPoint, GF_UPnP *upnp);
- ~GPAC_MediaController();
-
- virtual NPT_Result OnDeviceAdded(PLT_DeviceDataReference& device)
- {
- return NPT_SUCCESS;
- }
- virtual NPT_Result OnDeviceRemoved(PLT_DeviceDataReference& device)
- {
- return NPT_SUCCESS;
- }
- virtual NPT_Result OnActionResponse(NPT_Result res,
- PLT_ActionReference& action,
- void* userdata);
- virtual NPT_Result OnEventNotify(PLT_Service* service, NPT_List<PLT_StateVariable*>* vars);
-
- // PLT_MediaControllerDelegate
- virtual bool OnMRAdded(PLT_DeviceDataReference& device);
- virtual void OnMRRemoved(PLT_DeviceDataReference& device);
- virtual void OnMRStateVariablesChanged(PLT_Service* /* service */, NPT_List<PLT_StateVariable*>* /* vars */);
-
- //PLT_MediaBrowserDelegate
- virtual bool OnMSAdded(PLT_DeviceDataReference& device);
- virtual void OnMSRemoved(PLT_DeviceDataReference& device);
- virtual void OnMSStateVariablesChanged(PLT_Service *service, NPT_List<PLT_StateVariable*>* vars);
- virtual void OnBrowseResult(NPT_Result res,
- PLT_DeviceDataReference& device,
- PLT_BrowseInfo* info,
- void* userdata);
-
- NPT_Result Browse(GPAC_MediaServerItem *server, const char *id, const char *filter);
-
-
- GF_List *m_MediaRenderers;
- GF_List *m_MediaServers;
-
- /* The UPnP MediaRenderer control point. */
- PLT_MediaController* m_MediaController;
- /* The UPnP MediaServer control point. */
- PLT_MediaBrowser *m_MediaBrowser;
-
-protected:
- NPT_Result Browse(GPAC_BrowseDataReference& browse_data,
- PLT_DeviceDataReference& device,
- const char* object_id,
- NPT_Int32 index,
- NPT_Int32 count,
- bool browse_metadata = false,
- const char* filter = "*",
- const char* sort = "");
-
-private:
- NPT_Result WaitForResponse(NPT_SharedVariable& shared_var);
-
- GF_UPnP *m_pUPnP;
- GF_Mutex *m_ControlPointLock;
-
-};
-
-#endif /* _GPAC_MEDIA_CONTROLLER_H_ */
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-#include "GPACPlatinum.h"
-
-NPT_SET_LOCAL_LOGGER("gpac.media.renderer")
-
-extern NPT_UInt8 RDR_ConnectionManagerSCPD[];
-extern NPT_UInt8 RDR_AVTransportSCPD[];
-extern NPT_UInt8 RDR_RenderingControlSCPD[];
-
-
-void format_time_string(char *str, Double dur)
-{
- u32 h, m, s;
- h = (u32) (dur / 3600);
- m = (u32) ( (dur - h*3600) / 60);
- s = (u32) ((dur - h*3600 - m*60));
- sprintf(str, "%02d:%02d:%02d", h, m, s);
-}
-
-GPAC_MediaRenderer::GPAC_MediaRenderer(GF_UPnP *upnp, const char* friendly_name,
- bool show_ip,
- const char* uuid,
- unsigned int port) :
- PLT_DeviceHost("/", uuid, "urn:schemas-upnp-org:device:MediaRenderer:1", friendly_name, show_ip, port)
-{
- m_mediaHistoryList = gf_list_new();
- m_pUPnP = upnp;
- m_connected = GF_FALSE;
- m_Duration = m_Time = 0;
-}
-
-GPAC_MediaRenderer::~GPAC_MediaRenderer()
-{
- if (m_mediaHistoryList) {
- /* empty mediaHistoryList */
- while (gf_list_count(m_mediaHistoryList) > 0) {
- char * last = (char*)gf_list_last(m_mediaHistoryList);
- gf_list_rem_last(m_mediaHistoryList);
- gf_free(last);
- }
- gf_list_del(m_mediaHistoryList);
- }
-}
-
-NPT_Result
-GPAC_MediaRenderer::SetupServices()
-{
- PLT_Service* service;
-
- {
- /* AVTransport */
- m_pAVService = new PLT_Service(
- this,
- "urn:schemas-upnp-org:service:AVTransport:1",
- "urn:upnp-org:serviceId:AVTransport",
- "AVTransport",
- "urn:schemas-upnp-org:metadata-1-0/AVT/");
-
- NPT_CHECK_FATAL(m_pAVService->SetSCPDXML((const char*) RDR_AVTransportSCPD));
- NPT_CHECK_FATAL(AddService(m_pAVService));
-
- m_pAVService->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f));
- m_pAVService->SetStateVariable("A_ARG_TYPE_InstanceID", "0");
-
- // GetCurrentTransportActions
- m_pAVService->SetStateVariable("CurrentTransportActions", "Play,Pause,Stop,Seek,Next,Previous");
-
- // GetDeviceCapabilities
- m_pAVService->SetStateVariable("PossiblePlaybackStorageMedia", "NONE,NETWORK");
- m_pAVService->SetStateVariable("PossibleRecordStorageMedia", "NOT_IMPLEMENTED");
- m_pAVService->SetStateVariable("PossibleRecordQualityModes", "NOT_IMPLEMENTED");
-
- // GetMediaInfo
- m_pAVService->SetStateVariable("NumberOfTracks", "0");
- m_pAVService->SetStateVariable("CurrentMediaDuration", "00:00:00");
- m_pAVService->SetStateVariable("AVTransportURI", "");
- m_pAVService->SetStateVariable("AVTransportURIMetadata", "");
- m_pAVService->SetStateVariable("NextAVTransportURI", "NOT_IMPLEMENTED");
- m_pAVService->SetStateVariable("NextAVTransportURIMetadata", "NOT_IMPLEMENTED");
- m_pAVService->SetStateVariable("PlaybackStorageMedium", "NONE");
- m_pAVService->SetStateVariable("RecordStorageMedium", "NOT_IMPLEMENTED");
- m_pAVService->SetStateVariable("RecordMediumWriteStatus", "NOT_IMPLEMENTED");
-
- // GetPositionInfo
- m_pAVService->SetStateVariable("CurrentTrack", "0");
- m_pAVService->SetStateVariable("CurrentTrackDuration", "00:00:00");
- m_pAVService->SetStateVariable("CurrentTrackMetadata", "");
- m_pAVService->SetStateVariable("CurrentTrackURI", "");
- m_pAVService->SetStateVariable("RelativeTimePosition", "00:00:00");
- m_pAVService->SetStateVariable("AbsoluteTimePosition", "00:00:00");
- m_pAVService->SetStateVariable("RelativeCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
- m_pAVService->SetStateVariable("AbsoluteCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
-
- // disable indirect eventing for certain state variables
- //PLT_StateVariable* var;
- //var =
- m_pAVService->FindStateVariable("RelativeTimePosition");
- //if (var) var->DisableIndirectEventing();
- //var =
- m_pAVService->FindStateVariable("AbsoluteTimePosition");
- //if (var) var->DisableIndirectEventing();
- //var =
- m_pAVService->FindStateVariable("RelativeCounterPosition");
- //if (var) var->DisableIndirectEventing();
- //var =
- m_pAVService->FindStateVariable("AbsoluteCounterPosition");
- //if (var) var->DisableIndirectEventing();
-
- // GetTransportInfo
- m_pAVService->SetStateVariable("TransportState", "NO_MEDIA_PRESENT");
- m_pAVService->SetStateVariable("TransportStatus", "OK");
- m_pAVService->SetStateVariable("TransportPlaySpeed", "1");
-
- // GetTransportSettings
- m_pAVService->SetStateVariable("CurrentPlayMode", "NORMAL");
- m_pAVService->SetStateVariable("CurrentRecordQualityMode", "NOT_IMPLEMENTED");
- }
-
- {
- /* ConnectionManager */
- service = new PLT_Service(
- this,
- "urn:schemas-upnp-org:service:ConnectionManager:1",
- "urn:upnp-org:serviceId:ConnectionManager",
- "ConnectionManager");
- NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_ConnectionManagerSCPD));
- NPT_CHECK_FATAL(AddService(service));
-
- service->SetStateVariable("CurrentConnectionIDs", "0");
-
- // put all supported mime types here instead
- service->SetStateVariable("SinkProtocolInfo", "http-get:*:*:*, rtsp-rtp-udp:*:*:*");
- service->SetStateVariable("SourceProtocolInfo", "");
- }
-
- {
- /* RenderingControl */
- service = new PLT_Service(
- this,
- "urn:schemas-upnp-org:service:RenderingControl:1",
- "urn:upnp-org:serviceId:RenderingControl",
- "RenderingControl",
- "urn:schemas-upnp-org:metadata-1-0/RCS/");
- NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_RenderingControlSCPD));
- NPT_CHECK_FATAL(AddService(service));
-
- service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f));
-
- service->SetStateVariable("Mute", "0");
- service->SetStateVariable("Volume", "100");
- }
-
- {
- static NPT_UInt8 MIGRATION_SCPDXML[] = "<scpd xmlns=\"urn:schemas-upnp-org:service-1-0\">\
- <serviceStateTable>\
- <stateVariable>\
- <name>MigrationStatus</name>\
- <sendEventsAttribute>no</sendEventsAttribute>\
- <dataType>string</dataType>\
- <allowedValueList>\
- <allowedValue>OK</allowedValue>\
- <allowedValue>ERROR_OCCURRED</allowedValue>\
- </allowedValueList>\
- </stateVariable>\
- <stateVariable>\
- <name>MigrationMetaData</name>\
- <sendEventsAttribute>no</sendEventsAttribute>\
- <dataType>string</dataType>\
- </stateVariable>\
- <stateVariable>\
- <name>A_ARG_TYPE_InstanceID</name>\
- <sendEventsAttribute>no</sendEventsAttribute>\
- <dataType>ui4</dataType>\
- </stateVariable>\
- </serviceStateTable>\
- <actionList>\
- <action>\
- <name>StopForMigration</name>\
- <argumentList>\
- <argument>\
- <name>InstanceID</name>\
- <direction>in</direction>\
- <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>\
- </argument>\
- <argument>\
- <name>MigrationStatus</name>\
- <direction>out</direction>\
- <relatedStateVariable>MigrationStatus</relatedStateVariable>\
- </argument>\
- <argument>\
- <name>MigrationMetaData</name>\
- <direction>out</direction>\
- <relatedStateVariable>MigrationMetaData</relatedStateVariable>\
- </argument>\
- </argumentList>\
- </action>\
- </actionList>\
-</scpd>";
-
- /* MigrationService */
- m_pMigrationService = new PLT_Service(this, "urn:intermedia:service:migration:1", "urn:intermedia:service:migration.001", "SessionMigration");
-
- NPT_CHECK_FATAL(m_pMigrationService->SetSCPDXML((const char*) MIGRATION_SCPDXML));
- NPT_CHECK_FATAL(AddService(m_pMigrationService));
-
- m_pMigrationService->SetStateVariable("MigrationStatus", "OK");
- m_pMigrationService->SetStateVariable("MigrationMetaData", "");
- }
-
- return NPT_SUCCESS;
-}
-
-NPT_Result
-GPAC_MediaRenderer::OnAction(PLT_ActionReference& action,
- const PLT_HttpRequestContext& context)
-{
- NPT_COMPILER_UNUSED(context);
-
- /* parse the action name */
- NPT_String name = action->GetActionDesc().GetName();
-
- m_ip_src = context.GetRemoteAddress().GetIpAddress().ToString();
-
- /* Is it a ConnectionManager Service Action ? */
- if (name.Compare("GetCurrentConnectionIDs", true) == 0) {
- if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
- return NPT_FAILURE;
- }
- return NPT_SUCCESS;
- }
- if (name.Compare("GetProtocolInfo", true) == 0) {
- if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
- return NPT_FAILURE;
- }
- return NPT_SUCCESS;
- }
- if (name.Compare("GetCurrentConnectionInfo", true) == 0) {
- return OnGetCurrentConnectionInfo(action);
- }
- if (name.Compare("StopForMigration", true) == 0) {
- NPT_String res = m_pUPnP->OnMigrate();
- m_pMigrationService->SetStateVariable("MigrationStatus", "OK");
- m_pMigrationService->SetStateVariable("MigrationMetaData", res);
-
- if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
- return NPT_FAILURE;
- }
- return NPT_SUCCESS;
- }
-
- /* Is it a AVTransport Service Action ? */
-
- // since all actions take an instance ID and we only support 1 instance
- // verify that the Instance ID is 0 and return an error here now if not
- NPT_String serviceType = action->GetActionDesc().GetService()->GetServiceType();
- if (serviceType.Compare("urn:schemas-upnp-org:service:AVTransport:1", true) == 0) {
- if (NPT_FAILED(action->VerifyArgumentValue("InstanceID", "0"))) {
- action->SetError(802,"Not valid InstanceID.");
- return NPT_FAILURE;
- }
- }
-
- if (name.Compare("GetCurrentTransportActions", true) == 0) {
- if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
- return NPT_FAILURE;
- }
- return NPT_SUCCESS;
- }
- if (name.Compare("GetDeviceCapabilities", true) == 0) {
- if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
- return NPT_FAILURE;
- }
- return NPT_SUCCESS;
- }
- if (name.Compare("GetMediaInfo", true) == 0) {
- if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
- return NPT_FAILURE;
- }
- return NPT_SUCCESS;
- }
- if (name.Compare("GetPositionInfo", true) == 0) {
- if (m_pUPnP->m_pTerm->root_scene) {
- char szVal[100];
-
- m_pAVService->SetStateVariable("CurrentTrack", "0");
- format_time_string(szVal, m_Duration);
- m_pAVService->SetStateVariable("CurrentTrackDuration", szVal);
-
- m_pAVService->SetStateVariable("CurrentTrackMetadata", "");
- m_pAVService->SetStateVariable("CurrentTrackURI", "");
- format_time_string(szVal, m_Time);
- m_pAVService->SetStateVariable("RelativeTimePosition", szVal);
- m_pAVService->SetStateVariable("AbsoluteTimePosition", szVal);
- m_pAVService->SetStateVariable("RelativeCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
- m_pAVService->SetStateVariable("AbsoluteCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
- } else {
- if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
- return NPT_FAILURE;
- }
- }
- return NPT_SUCCESS;
- }
- if (name.Compare("GetTransportInfo", true) == 0) {
- if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
- return NPT_FAILURE;
- }
- return NPT_SUCCESS;
- }
- if (name.Compare("GetTransportSettings", true) == 0) {
- if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
- return NPT_FAILURE;
- }
- return NPT_SUCCESS;
- }
- if (name.Compare("Next", true) == 0) {
- return OnNext(action);
- }
- if (name.Compare("Pause", true) == 0) {
- return OnPause(action);
- }
- if (name.Compare("Play", true) == 0) {
- return OnPlay(action);
- }
- if (name.Compare("Previous", true) == 0) {
- return OnPrevious(action);
- }
- if (name.Compare("Seek", true) == 0) {
- return OnSeek(action);
- }
- if (name.Compare("Stop", true) == 0) {
- return OnStop(action);
- }
- if (name.Compare("SetAVTransportURI", true) == 0) {
- return OnSetAVTransportURI(action);
- }
- if (name.Compare("SetPlayMode", true) == 0) {
- return OnSetPlayMode(action);
- }
-
- /* Is it a RendererControl Service Action ? */
- if (serviceType.Compare("urn:schemas-upnp-org:service:RenderingControl:1", true) == 0) {
- /* we only support master channel */
- if (NPT_FAILED(action->VerifyArgumentValue("Channel", "Master"))) {
- action->SetError(402,"Invalid Args.");
- return NPT_FAILURE;
- }
- }
-
- if ((name.Compare("GetVolume", true) == 0) || (name.Compare("GetVolumeRangeDB", true) == 0) ) {
- NPT_CHECK_SEVERE(action->SetArgumentsOutFromStateVariable());
- return NPT_SUCCESS;
- }
-
- if (name.Compare("GetMute", true) == 0) {
- NPT_CHECK_SEVERE(action->SetArgumentsOutFromStateVariable());
- return NPT_SUCCESS;
- }
-
- if (name.Compare("SetVolume", true) == 0) {
- return OnSetVolume(action);
- }
- if (name.Compare("SetVolumeDB", true) == 0) {
- return OnSetVolumeDB(action);
- }
-
- if (name.Compare("SetMute", true) == 0) {
- return OnSetMute(action);
- }
-
- action->SetError(401,"No Such Action.");
- return NPT_FAILURE;
-}
-
-NPT_Result
-GPAC_MediaRenderer::OnGetCurrentConnectionInfo(PLT_ActionReference& action)
-{
- if (NPT_FAILED(action->VerifyArgumentValue("ConnectionID", "0"))) {
- action->SetError(706,"No Such Connection.");
- return NPT_FAILURE;
- }
-
- if (NPT_FAILED(action->SetArgumentValue("RcsID", "0"))) {
- return NPT_FAILURE;
- }
- if (NPT_FAILED(action->SetArgumentValue("AVTransportID", "0"))) {
- return NPT_FAILURE;
- }
- if (NPT_FAILED(action->SetArgumentValue("ProtocolInfo", "http-get:*:*:*"))) {
- return NPT_FAILURE;
- }
- if (NPT_FAILED(action->SetArgumentValue("PeerConnectionManager", "/"))) {
- return NPT_FAILURE;
- }
- if (NPT_FAILED(action->SetArgumentValue("PeerConnectionID", "-1"))) {
- return NPT_FAILURE;
- }
- if (NPT_FAILED(action->SetArgumentValue("Direction", "Input"))) {
- return NPT_FAILURE;
- }
- if (NPT_FAILED(action->SetArgumentValue("Status", "Unknown"))) {
- return NPT_FAILURE;
- }
-
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaRenderer::OnSetAVTransportURI(PLT_ActionReference& action)
-{
- char the_url[4096], szVal[100];
- NPT_String url_id;
- const char *MediaUri;
- if (NPT_FAILED(action->GetArgumentValue("CurrentURI", url_id))) {
- return NPT_FAILURE;
- }
- MediaUri = url_id;
- if (!MediaUri) return NPT_FAILURE;
-
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Request: change media\n"));
-
- if (m_connected) {
- m_connected = GF_FALSE;
- m_pUPnP->OnStop(m_ip_src);
- }
- const char *ext = strrchr(MediaUri, '.');
- if (ext && !stricmp(ext, ".m3u")) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_NETWORK, ("[UPnP] M3U playlists not supported yet\n"));
- return NPT_SUCCESS;
- }
-
- /* Load and add to mediaHistoryList */
- strcpy(the_url, MediaUri);
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Adding media to the list : %s\n", MediaUri));
- gf_list_add(m_mediaHistoryList, gf_strdup(MediaUri));
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Opening URL %s\n", the_url));
- m_track_pos = gf_list_count(m_mediaHistoryList);
-
- m_connected = GF_TRUE;
- m_pUPnP->OnConnect(the_url, m_ip_src);
- /* Set UPnP datas */
- m_pAVService->SetStateVariable("TransportState", "PLAYING");
- m_pAVService->SetStateVariable("AVTransportURI", the_url);
-
- sprintf(szVal, "%d", gf_list_count(m_mediaHistoryList));
- m_pAVService->SetStateVariable("NumberOfTracks", szVal);
- sprintf(szVal, "%d", m_track_pos);
- m_pAVService->SetStateVariable("CurrentTrack", szVal);
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaRenderer::OnPause(PLT_ActionReference& action)
-{
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Request: change state : PAUSE\n"));
- m_pAVService->SetStateVariable("TransportState", "PAUSED_PLAYBACK");
- m_pUPnP->OnPause(GF_FALSE, m_ip_src);
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaRenderer::OnPlay(PLT_ActionReference& action)
-{
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Request: change state : PLAY\n"));
-
- /* if nothing playing, connect to first media of mediaHistoryList */
- if (m_connected) {
- m_pAVService->SetStateVariable("TransportState", "PLAYING");
- m_pUPnP->OnPause(GF_TRUE, m_ip_src);
- } else if (gf_list_count(m_mediaHistoryList) >= 1) {
- char *track = (char *) gf_list_get(m_mediaHistoryList, 0);
- m_track_pos = 1;
-
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Reading first media : %s\n", track));
- m_pAVService->SetStateVariable("TransportState", "PLAYING");
- m_connected = GF_TRUE;
- m_pUPnP->OnConnect(track, m_ip_src);
- //MRSetTrack(track, upnph->TrackPosition);
- }
- return NPT_SUCCESS;
-}
-
-
-NPT_Result GPAC_MediaRenderer::OnStop(PLT_ActionReference& action)
-{
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Request: change state : STOP\n"));
- if (m_pUPnP->m_pTerm->root_scene) {
- m_pAVService->SetStateVariable("TransportState", "STOPPED");
- m_pUPnP->OnStop(m_ip_src);
- }
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaRenderer::OnPrevious(PLT_ActionReference& action)
-{
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaRenderer::OnNext(PLT_ActionReference& action)
-{
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaRenderer::OnSeek(PLT_ActionReference& action)
-{
- u32 h, m, s;
- Double time;
- NPT_String unit, target;
- if (NPT_FAILED(action->GetArgumentValue("Unit", unit))) {
- return NPT_FAILURE;
- }
- if (NPT_FAILED(action->GetArgumentValue("Target", target))) {
- return NPT_FAILURE;
- }
- if ((unit!="ABS_TIME") && (unit!="REL_TIME")) {
- action->SetError(710,"Seek mode not supported");
- return NPT_FAILURE;
- }
- sscanf(target, "%d:%d:%d", &h, &m, &s);
- time = h*3600.0 + m*60.0 + s;
- m_pUPnP->OnSeek(time);
- return NPT_SUCCESS;
-}
-
-
-NPT_Result GPAC_MediaRenderer::OnSetPlayMode(PLT_ActionReference& action)
-{
- return NPT_SUCCESS;
-}
-
-
-NPT_Result GPAC_MediaRenderer::OnSetVolume(PLT_ActionReference& action)
-{
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaRenderer::OnSetVolumeDB(PLT_ActionReference& action)
-{
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaRenderer::OnSetMute(PLT_ActionReference& action)
-{
- return NPT_SUCCESS;
-}
-
-NPT_Result GPAC_MediaRenderer::OnGetVolumeDBRange(PLT_ActionReference& action )
-{
- return NPT_SUCCESS;
-}
-
-void GPAC_MediaRenderer::SetDuration(Double duration, Bool can_seek)
-{
- char szVal[100];
- format_time_string(szVal, duration);
- m_Duration = duration;
- m_pAVService->SetStateVariable("CurrentTrackDuration", szVal);
-}
-
-void GPAC_MediaRenderer::SetTime(Double time)
-{
- char szVal[100];
- format_time_string(szVal, time);
- m_Time = time;
- m_pAVService->SetStateVariable("RelativeTimePosition", szVal);
- m_pAVService->SetStateVariable("AbsoluteTimePosition", szVal);
-}
-
-void GPAC_MediaRenderer::SetConnected(const char *url)
-{
- m_pAVService->SetStateVariable("AVTransportURI", url);
- m_pAVService->SetStateVariable("CurrentTrackURI", url);
- m_pAVService->SetStateVariable("TransportState", "PLAYING");
- m_connected = url ? GF_TRUE : GF_FALSE;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-
-
-#ifndef _GPAC_MEDIA_RENDER_H_
-#define _GPAC_MEDIA_RENDER_H_
-
-#include "Neptune.h"
-#include "PltMediaRenderer.h"
-#include "PltService.h"
-
-class GF_UPnP;
-
-class GPAC_MediaRenderer : public PLT_DeviceHost,
- public PLT_MediaRendererDelegate
-{
-public:
- GPAC_MediaRenderer (GF_UPnP *upnp, const char* friendly_name,
- bool show_ip = false,
- const char* uuid = NULL,
- unsigned int port = 0);
-
- // PLT_DeviceHost methods
- virtual NPT_Result SetupServices();
- virtual NPT_Result OnAction(PLT_ActionReference &action, const PLT_HttpRequestContext& context);
-
- /*these are called when event filtering is used (no JS)*/
- void SetDuration(Double duration, Bool can_seek);
- void SetTime(Double time);
- void SetConnected(const char *url);
-
-protected:
- virtual ~GPAC_MediaRenderer();
-
- // PLT_MediaRendererInterface methods
- // ConnectionManager
- virtual NPT_Result OnGetCurrentConnectionInfo(PLT_ActionReference& action);
-
- // AVTransport
- virtual NPT_Result OnNext(PLT_ActionReference& action);
- virtual NPT_Result OnPause(PLT_ActionReference& action);
- virtual NPT_Result OnPlay(PLT_ActionReference& action);
- virtual NPT_Result OnPrevious(PLT_ActionReference& action);
- virtual NPT_Result OnSeek(PLT_ActionReference& action);
- virtual NPT_Result OnStop(PLT_ActionReference& action);
- virtual NPT_Result OnSetAVTransportURI(PLT_ActionReference& action);
- virtual NPT_Result OnSetPlayMode(PLT_ActionReference& action);
-
- // RenderingControl
- //virtual NPT_Result OnGetVolume(PLT_ActionReference& action);
- virtual NPT_Result OnSetVolume(PLT_ActionReference& action);
- virtual NPT_Result OnSetVolumeDB(PLT_ActionReference& action);
- virtual NPT_Result OnSetMute(PLT_ActionReference& action);
- virtual NPT_Result OnGetVolumeDBRange(PLT_ActionReference &action);
-
-
-private:
- GF_UPnP *m_pUPnP;
-
- Bool m_connected;
-
- /*pointer to the AV service for further StateVariable modifications*/
- PLT_Service *m_pAVService;
- PLT_Service *m_pMigrationService;
-
- GF_List *m_mediaHistoryList;
- u32 m_track_pos;
-// u32 m_volume;
-// Bool m_muted, m_l_muted, m_r_muted;
- NPT_String m_ip_src;
- Double m_Duration, m_Time;
-};
-
-#endif /*_GPAC_MEDIA_RENDER_H_*/
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-//declaration of export functions is done first due to a linker bug on OSX ...
-#include <gpac/modules/term_ext.h>
-
-GF_TermExt *upnp_new();
-void upnp_delete(GF_BaseInterface *ifce);
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_TERM_EXT_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_TERM_EXT_INTERFACE) return (GF_BaseInterface *)upnp_new();
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- switch (ifce->InterfaceType) {
- case GF_TERM_EXT_INTERFACE:
- upnp_delete(ifce);
- break;
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( platinum )
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#include "GPACPlatinum.h"
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-
-#if !defined(__GNUC__)
-# if defined(_WIN32_WCE)
-# pragma comment(lib, "js32")
-# elif defined (_WIN64)
-# pragma comment(lib, "js")
-# elif defined (WIN32)
-# pragma comment(lib, "js")
-# endif
-#endif
-
-#endif
-
-GF_UPnP::GF_UPnP()
-{
- m_pTerm = NULL;
- m_pPlatinum = NULL;
- m_pMediaRenderer = NULL;
- m_pMediaServer = NULL;
- m_pAVCtrlPoint = NULL;
- m_renderer_bound = GF_FALSE;
- m_pGenericController = NULL;
-
-#ifdef GPAC_HAS_SPIDERMONKEY
- m_Devices = NULL;
- m_pJSCtx = NULL;
- m_nbJSInstances=0;
- last_time = 0;
-#endif
-}
-
-GF_UPnP::~GF_UPnP()
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- if (m_Devices) gf_list_del(m_Devices);
-#endif
-}
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-void GF_UPnP::LockJavascript(Bool do_lock)
-{
- gf_sg_lock_javascript(m_pJSCtx, do_lock);
-}
-#endif
-
-void GF_UPnP::OnStop(const char *src_url)
-{
- if (m_renderer_bound) {
-#ifdef GPAC_HAS_SPIDERMONKEY
- jsval funval, rval;
- if (!m_pJSCtx) return;
- LockJavascript(GF_TRUE);
- JS_LookupProperty(m_pJSCtx, m_pObj, "onMediaStop", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval argv[1];
- argv[0] = GetUPnPDevice(src_url);
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 1, argv, &rval);
- }
- LockJavascript(GF_FALSE);
-#endif
- } else {
-// gf_term_disconnect(m_pTerm);
- gf_term_play_from_time(m_pTerm, 0, 1);
- }
-}
-
-NPT_String GF_UPnP::OnMigrate()
-{
- NPT_String res = "";
- if (m_renderer_bound) {
-#ifdef GPAC_HAS_SPIDERMONKEY
- jsval funval, rval;
- if (!m_pJSCtx) return res;
- LockJavascript(GF_TRUE);
- JS_LookupProperty(m_pJSCtx, m_pObj, "onMigrate", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 0, NULL, &rval);
- if (JSVAL_IS_STRING(rval)) {
- char *_res = SMJS_CHARS(m_pJSCtx, rval);
- res = _res;
- SMJS_FREE(m_pJSCtx, _res);
- }
- }
- LockJavascript(GF_FALSE);
-#endif
- } else {
- GF_NetworkCommand com;
-
- memset(&com, 0, sizeof(GF_NetworkCommand));
- com.base.command_type = GF_NET_SERVICE_MIGRATION_INFO;
- m_pTerm->root_scene->root_od->net_service->ifce->ServiceCommand(m_pTerm->root_scene->root_od->net_service->ifce, &com);
- if (com.migrate.data) {
- res = com.migrate.data;
- } else {
- res = m_pTerm->root_scene->root_od->net_service->url;
- }
- }
- return res;
-}
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-jsval GF_UPnP::GetUPnPDevice(const char *src_url)
-{
- return src_url ? STRING_TO_JSVAL( JS_NewStringCopyZ(m_pJSCtx, src_url ) ) : JSVAL_NULL;
-}
-#endif
-
-void GF_UPnP::OnConnect(const char *url, const char *src_url)
-{
- if (m_renderer_bound) {
-#ifdef GPAC_HAS_SPIDERMONKEY
- jsval funval, rval;
- if (!m_pJSCtx) return;
-
- LockJavascript(GF_TRUE);
- JS_LookupProperty(m_pJSCtx, m_pObj, "onMediaConnect", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval argv[2];
- argv[0] = STRING_TO_JSVAL( JS_NewStringCopyZ(m_pJSCtx, url ) );
- argv[1] = GetUPnPDevice(src_url);
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 2, argv, &rval);
- }
- LockJavascript(GF_FALSE);
-#endif
- } else {
- gf_term_navigate_to(m_pTerm, url);
- }
-}
-void GF_UPnP::OnPause(Bool do_resume, const char *src_url)
-{
- if (m_renderer_bound) {
-#ifdef GPAC_HAS_SPIDERMONKEY
- jsval funval, rval;
- if (!m_pJSCtx) return;
- LockJavascript(GF_TRUE);
- JS_LookupProperty(m_pJSCtx, m_pObj, do_resume ? "onMediaPlay" : "onMediaPause", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval argv[1];
- argv[0] = GetUPnPDevice(src_url);
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 1, argv, &rval);
- }
- LockJavascript(GF_FALSE);
-#endif
- } else {
- gf_term_set_option(m_pTerm, GF_OPT_PLAY_STATE, do_resume ? GF_STATE_PLAYING : GF_STATE_PAUSED);
- }
-}
-
-void GF_UPnP::OnSeek(Double time)
-{
- if (m_renderer_bound) {
-#ifdef GPAC_HAS_SPIDERMONKEY
- jsval funval, rval;
- if (!m_pJSCtx) return;
- LockJavascript(GF_TRUE);
- JS_LookupProperty(m_pJSCtx, m_pObj, "onMediaSeek", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval argv[1];
- argv[0] = DOUBLE_TO_JSVAL( JS_NewDouble(m_pJSCtx, time) );
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 2, argv, &rval);
- }
- LockJavascript(GF_FALSE);
-#endif
- } else {
- /* CanSeek and Duration set for each media by event_proc */
- if (!m_pTerm->root_scene || (m_pTerm->root_scene->root_od->flags & GF_ODM_NO_TIME_CTRL)
- || (m_pTerm->root_scene->duration<2000)
- ) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_NETWORK, ("[UPnP] Scene not seekable\n"));
- } else {
- gf_term_play_from_time(m_pTerm, (u64) (time * 1000), 0);
- }
- }
-}
-
-void GF_UPnP::ContainerChanged(PLT_DeviceDataReference& device, const char *item_id, const char *update_id)
-{
-}
-
-void GF_UPnP::onTimeChanged(s32 renderer_idx, Double time)
-{
- if (m_renderer_bound) {
-#ifdef GPAC_HAS_SPIDERMONKEY
- jsval funval, rval;
- if (!m_pJSCtx) return;
- LockJavascript(GF_TRUE);
- JS_LookupProperty(m_pJSCtx, m_pObj, "onMediaTimeChanged", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval argv[2];
- argv[0] = INT_TO_JSVAL( renderer_idx);
- argv[1] = DOUBLE_TO_JSVAL( JS_NewDouble(m_pJSCtx, time) );
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 2, argv, &rval);
- }
- LockJavascript(GF_FALSE);
-#endif
- }
-}
-
-void GF_UPnP::onDurationChanged(s32 renderer_idx, Double dur)
-{
- if (m_renderer_bound) {
-#ifdef GPAC_HAS_SPIDERMONKEY
- jsval funval, rval;
- if (!m_pJSCtx) return;
- LockJavascript(GF_TRUE);
- JS_LookupProperty(m_pJSCtx, m_pObj, "onMediaDurationChanged", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval argv[2];
- argv[0] = INT_TO_JSVAL( renderer_idx);
- argv[1] = DOUBLE_TO_JSVAL( JS_NewDouble(m_pJSCtx, dur) );
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 2, argv, &rval);
- }
- LockJavascript(GF_FALSE);
-#endif
- }
-}
-
-
-Bool GF_UPnP::ProcessEvent(GF_Event *evt)
-{
- if (!m_pMediaRenderer) return GF_FALSE;
- switch (evt->type) {
- case GF_EVENT_CONNECT:
- if (evt->connect.is_connected) {
- const char *url = gf_term_get_url(m_pTerm);
- if (url) {
- m_pMediaRenderer->SetConnected(url);
- }
- }
- break;
-
- case GF_EVENT_DURATION:
- m_pMediaRenderer->SetDuration(evt->duration.duration, evt->duration.can_seek);
- case GF_EVENT_METADATA:
- if (m_pTerm->root_scene) {
- char szName[1024];
- NetInfoCommand com;
- memset(&com, 0, sizeof(NetInfoCommand));
-
- /*get any service info*/
- if (gf_term_get_service_info(m_pTerm, m_pTerm->root_scene->root_od, &com) == GF_OK) {
- strcpy(szName, "");
- if (com.name) {
- strcat(szName, com.name);
- strcat(szName, " ");
- }
- if (com.album) {
- strcat(szName, "(");
- strcat(szName, com.album);
- strcat(szName, ")");
- }
-
- /*const char *artist = "Unknown";
- if (com.artist) artist = com.artist;
- else if (com.writer) artist = com.writer;
- else if (com.composer) artist = com.composer;
-
- MRSetMediaInfo(0, szName, com.artist ? com.artist : "Unknown");*/
- }
- }
- break;
- }
- return GF_FALSE;
-}
-
-Bool upnp_on_term_event(void *udta, GF_Event *evt, Bool consumed)
-{
- GF_UPnP *upnp = (GF_UPnP *) udta;
- if (!consumed && upnp) return upnp->ProcessEvent(evt);
- return GF_FALSE;
-}
-
-void GF_UPnP::Load(GF_Terminal *term)
-{
- u16 port = 0;
- Bool save_uuids=GF_FALSE;
- Bool ignore_local_devices=GF_FALSE;
- const char *uuid, *opt, *name;
- char hostname[100], friendly_name[1024];
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Starting UPnP\n"));
-
- m_pCtrlPoint = NULL;
- m_pTerm = term;
-
- m_pPlatinum = new PLT_UPnP();
- m_pPlatinum->SetIgnoreLocalUUIDs(false);
-
- gf_sk_get_host_name((char*)hostname);
-
- opt = gf_opts_get_key("UPnP", "AllowedDevicesIP");
- if (!opt) {
- gf_cfg_set_key(m_pTerm->user->config, "UPnP", "AllowedDevicesIP", "");
- opt="";
- }
- m_IPFilter = opt;
-
- opt = gf_opts_get_key("UPnP", "IgnoreCreatedDevices");
- if (!opt || !strcmp(opt, "yes")) {
- ignore_local_devices = GF_TRUE;
- if (!opt) gf_cfg_set_key(m_pTerm->user->config, "UPnP", "IgnoreCreatedDevices", "yes");
- }
-
-
-
- opt = gf_opts_get_key("UPnP", "IgnoreCreatedDevices");
- if (!opt || !strcmp(opt, "yes")) {
- ignore_local_devices = GF_TRUE;
- if (!opt) gf_cfg_set_key(m_pTerm->user->config, "UPnP", "IgnoreCreatedDevices", "yes");
- }
-
-
- opt = gf_opts_get_key("UPnP", "SaveUUIDs");
- if (opt && !strcmp(opt, "yes")) save_uuids = GF_TRUE;
-
- opt = gf_opts_get_key("UPnP", "MediaRendererEnabled");
- if (!opt || !strcmp(opt, "yes")) {
- if (!opt) gf_cfg_set_key(m_pTerm->user->config, "UPnP", "MediaRendererEnabled", "yes");
-
- name = gf_opts_get_key("UPnP", "MediaRendererName");
- if (!name) {
- sprintf(friendly_name, "GPAC @ %s", hostname);
- name = friendly_name;
- }
-
- port = 0;
- opt = gf_opts_get_key("UPnP", "MediaRendererPort");
- if (opt) port = atoi(opt);
-
- uuid = gf_opts_get_key("UPnP", "MediaRendererUUID");
- if (uuid) {
- m_pMediaRenderer = new GPAC_MediaRenderer(this, name, false, uuid, port);
- } else {
- m_pMediaRenderer = new GPAC_MediaRenderer(this, name, false, NULL, port);
- if (save_uuids) {
- uuid = m_pMediaRenderer->GetUUID();
- gf_cfg_set_key(m_pTerm->user->config, "UPnP", "MediaRendererUUID", uuid);
- }
- }
-
- PLT_DeviceHostReference device(m_pMediaRenderer );
- device->m_ModelDescription = "GPAC Media Renderer";
- device->m_ModelURL = "http://gpac.io";
- device->m_ModelNumber = gf_gpac_version();
- device->m_ModelName = "GPAC Media Renderer";
- device->m_Manufacturer = "Telecom ParisTech";
- device->m_ManufacturerURL = "http://www.telecom-paristech.fr/";
- m_pPlatinum->AddDevice(device);
- }
-
- opt = gf_opts_get_key("UPnP", "MediaServerEnabled");
- if (!opt || !strcmp(opt, "yes")) {
- char *media_root;
- if (!opt) gf_cfg_set_key(m_pTerm->user->config, "UPnP", "MediaServerEnabled", "yes");
-
- name = gf_opts_get_key("UPnP", "MediaServerName");
- if (!name) {
- sprintf(friendly_name, "GPAC @ %s", hostname);
- name = friendly_name;
- }
-
- port = 0;
- opt = gf_opts_get_key("UPnP", "MediaServerPort");
- if (opt) port = atoi(opt);
-
- uuid = gf_opts_get_key("UPnP", "MediaServerUUID");
- if (uuid) {
- m_pMediaServer = new GPAC_FileMediaServer(name, false, uuid, port);
- } else {
- m_pMediaServer = new GPAC_FileMediaServer(name, false, NULL, port);
- if (save_uuids) {
- uuid = m_pMediaServer->GetUUID();
- gf_cfg_set_key(m_pTerm->user->config, "UPnP", "MediaServerUUID", uuid);
- }
- }
- media_root = (char *) gf_opts_get_key("UPnP", "MediaServerRoot");
- if (!media_root) {
- gf_cfg_set_key(m_pTerm->user->config, "UPnP", "MediaServerRoot", "all:/");
- m_pMediaServer->AddSharedDirectory("/", "all");
- } else {
- while (media_root) {
- Bool is_hidden = GF_FALSE;
- char *sep1 = (char *)strchr(media_root, ':');
- if (!sep1) break;
- char *sep2 = (char *)strchr(sep1, ';');
-
- if (!strncmp(media_root, "(h)", 3)) {
- media_root+=3;
- is_hidden = GF_TRUE;
- }
- sep1[0] = 0;
- if (sep2) sep2[0] = 0;
- m_pMediaServer->AddSharedDirectory(sep1+1, media_root, is_hidden);
- sep1[0] = ':';
- if (sep2) sep2[0] = ';';
- else break;
- media_root = sep2+1;
- }
- }
- PLT_DeviceHostReference device(m_pMediaServer);
- device->m_ModelDescription = "GPAC Media Server";
- device->m_ModelURL = "http://gpac.io";
- device->m_ModelNumber = gf_gpac_version();
- device->m_ModelName = "GPAC Media Server";
- device->m_Manufacturer = "Telecom ParisTech";
- device->m_ManufacturerURL = "http://www.telecom-paristech.fr/";
- m_pPlatinum->AddDevice(device);
- }
-
- opt = gf_opts_get_key("UPnP", "GenericControllerEnabled");
- if (!opt || !strcmp(opt, "yes")) {
- if (!opt) gf_cfg_set_key(m_pTerm->user->config, "UPnP", "GenericControllerEnabled", "yes");
- /*create our generic control point*/
- if (!m_pCtrlPoint) {
- m_pCtrlPoint = new PLT_CtrlPoint();
- m_ctrlPtRef = PLT_CtrlPointReference(m_pCtrlPoint);
- }
- m_pGenericController = new GPAC_GenericController(m_ctrlPtRef, this);
- }
-
- opt = gf_opts_get_key("UPnP", "AVCPEnabled");
- if (!opt || !strcmp(opt, "yes")) {
- if (!opt) gf_cfg_set_key(m_pTerm->user->config, "UPnP", "AVCPEnabled", "yes");
-
- if (!m_pCtrlPoint) {
- m_pCtrlPoint = new PLT_CtrlPoint();
- m_ctrlPtRef = PLT_CtrlPointReference(m_pCtrlPoint);
- }
- m_pAVCtrlPoint = new GPAC_MediaController(m_ctrlPtRef, this);
- }
-
- // add control point to upnp engine
- if (m_pCtrlPoint) {
- if (ignore_local_devices) {
- if (m_pMediaServer) m_pCtrlPoint->IgnoreUUID(m_pMediaServer->GetUUID());
- if (m_pMediaRenderer) m_pCtrlPoint->IgnoreUUID(m_pMediaRenderer->GetUUID());
- }
- m_pPlatinum->AddCtrlPoint(m_ctrlPtRef);
- }
-
-
-
- gf_term_add_event_filter(term, &evt_filter);
-
- //start UPnP engine
- m_pPlatinum->Start();
-
- /*if we have a control point, force a rescan of the network servcies*/
- if (m_pCtrlPoint) {
- m_pCtrlPoint->Search();
- }
-}
-
-void GF_UPnP::Unload()
-{
- m_pPlatinum->Stop();
- if (m_pGenericController) delete m_pGenericController;
- if (m_pAVCtrlPoint) delete m_pAVCtrlPoint;
- /*this will delete all UPnP devices*/
- delete m_pPlatinum;
-
- /*final cleanup of UPnP lib*/
- NPT_AutomaticCleaner::Shutdown();
-}
-
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-
-void GF_UPnP::OnMediaRendererAdd(PLT_DeviceDataReference& device, int added)
-{
- jsval funval, rval;
- if (!m_pJSCtx) return;
-
- if (m_IPFilter.GetLength() && (strstr((const char*)m_IPFilter, (const char*)device->GetURLBase().GetHost()) == NULL) ) return;
-
- LockJavascript(GF_TRUE);
-
- JS_LookupProperty(m_pJSCtx, m_pObj, "onMediaRendererAdd", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval argv[3];
- argv[0] = STRING_TO_JSVAL( JS_NewStringCopyZ(m_pJSCtx, device->GetFriendlyName() ) );
- argv[1] = STRING_TO_JSVAL( JS_NewStringCopyZ(m_pJSCtx, device->GetUUID() ) );
- argv[2] = BOOLEAN_TO_JSVAL( added ? JS_TRUE : JS_FALSE);
-
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 3, argv, &rval);
- }
- LockJavascript(GF_FALSE);
-}
-
-
-void GF_UPnP::OnMediaServerAdd(PLT_DeviceDataReference& device, int added)
-{
- jsval funval, rval;
- if (!m_pJSCtx) return;
-
- if (m_IPFilter.GetLength() && (strstr((const char*)m_IPFilter, (const char*)device->GetURLBase().GetHost()) == NULL) ) return;
-
- LockJavascript(GF_TRUE);
- JS_LookupProperty(m_pJSCtx, m_pObj, "onMediaServerAdd", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval argv[3];
- argv[0] = STRING_TO_JSVAL( JS_NewStringCopyZ(m_pJSCtx, device->GetFriendlyName() ) );
- argv[1] = STRING_TO_JSVAL( JS_NewStringCopyZ(m_pJSCtx, device->GetUUID() ) );
- argv[2] = BOOLEAN_TO_JSVAL( added ? JS_TRUE : JS_FALSE);
-
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 3, argv, &rval);
- }
- LockJavascript(GF_FALSE);
-}
-
-static SMJS_DECL_FUNC_PROP_GET( upnpdevice_getProperty)
-{
-#ifdef USE_FFDEV_15
- JSObject *obj = (JSObject *) __hobj;
- jsid id = (jsid) __hid;
-#endif
-
- char *prop_name;
- GPAC_DeviceItem *dev = (GPAC_DeviceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!dev) return JS_FALSE;
-
- if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
- prop_name = SMJS_CHARS_FROM_STRING(c, SMJS_ID_TO_STRING(id));
- if (!prop_name) return JS_FALSE;
-
- if (!strcmp(prop_name, "Name")) {
- VPASSIGN( STRING_TO_JSVAL( JS_NewStringCopyZ(c, dev->m_device->GetFriendlyName()) ) );
- }
- else if (!strcmp(prop_name, "UUID")) {
- VPASSIGN( STRING_TO_JSVAL( JS_NewStringCopyZ(c, dev->m_device->GetUUID()) ) );
- }
- else if (!strcmp(prop_name, "PresentationURL")) {
- VPASSIGN( STRING_TO_JSVAL( JS_NewStringCopyZ(c, dev->m_device->m_PresentationURL) ) );
- }
- else if (!strcmp(prop_name, "ServicesCount")) {
- u32 count = gf_list_count(dev->m_Services);
- if (!count) {
- dev->RefreshServiceList();
- count = gf_list_count(dev->m_Services);
- }
- VPASSIGN( INT_TO_JSVAL(count) );
- }
- SMJS_FREE(c, prop_name);
- return JS_TRUE;
-}
-
-#ifdef GPAC_UNUSED_FUNC
-static JSBool upnp_device_subscribe(JSContext *c, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
-{
- PLT_Service* service;
- char *service_uuid;
- GPAC_DeviceItem *item = (GPAC_DeviceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!item || (argc!=2) ) return JS_FALSE;
-
- if (!JSVAL_IS_STRING(argv[0])) return JS_FALSE;
- if (!JSVAL_IS_OBJECT(argv[1])) return JS_FALSE;
-
- service_uuid = SMJS_CHARS(c, argv[0]);
- if (item->m_device->FindServiceByType(service_uuid, service) == NPT_SUCCESS) {
- item->m_pUPnP->m_pGenericController->m_CtrlPoint->Subscribe(service);
- }
- SMJS_FREE(c, service_uuid);
- return JS_TRUE;
-}
-#endif
-
-static JSBool SMJS_FUNCTION(upnp_device_find_service)
-{
- char *service_uuid;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_DeviceItem *item = (GPAC_DeviceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!item || !argc) return JS_FALSE;
- service_uuid = SMJS_CHARS(c, argv[0]);
-
- GPAC_ServiceItem *serv = item->FindService(service_uuid);
- SMJS_FREE(c, service_uuid);
- if (!serv) {
- SMJS_SET_RVAL( JSVAL_NULL );
- return JS_TRUE;
- }
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(serv->obj) );
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_device_get_service)
-{
- u32 service_index;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_DeviceItem *item = (GPAC_DeviceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!item || !argc || !JSVAL_IS_INT(argv[0])) return JS_FALSE;
- service_index = JSVAL_TO_INT(argv[0]);
-
- GPAC_ServiceItem *serv = (GPAC_ServiceItem*)gf_list_get(item->m_Services, service_index);
- if (!serv) {
- SMJS_SET_RVAL( JSVAL_NULL );
- return JS_TRUE;
- }
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(serv->obj) );
- return JS_TRUE;
-}
-
-
-void GF_UPnP::OnDeviceAdd(GPAC_DeviceItem *item, int added)
-{
- jsval funval, rval;
- if (!m_pJSCtx) return;
-
- if (m_IPFilter.GetLength() && (strstr((const char*)m_IPFilter, (const char*)item->m_device->GetURLBase().GetHost()) == NULL) ) return;
-
- LockJavascript(GF_TRUE);
-
- if (added) {
- item->js_ctx = m_pJSCtx;
- item->obj = JS_NewObject(m_pJSCtx, &upnpGenericDeviceClass._class, 0, 0);
- item->m_pUPnP = this;
- gf_js_add_root(m_pJSCtx, &item->obj, GF_JSGC_OBJECT);
- SMJS_SET_PRIVATE(item->js_ctx, item->obj, item);
- }
-
- JS_LookupProperty(m_pJSCtx, m_pObj, "onDeviceAdd", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval argv[2];
- argv[0] = OBJECT_TO_JSVAL( item->obj );
- argv[1] = BOOLEAN_TO_JSVAL( added ? JS_TRUE : JS_FALSE);
- JS_CallFunctionValue(m_pJSCtx, m_pObj, funval, 3, argv, &rval);
- }
- LockJavascript(GF_FALSE);
-}
-
-static SMJS_DECL_FUNC_PROP_GET( upnp_getProperty)
-{
-#ifdef USE_FFDEV_15
- JSObject *obj = (JSObject *) __hobj;
- jsid id = (jsid) __hid;
-#endif
-
-
- char *prop_name;
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp) return JS_FALSE;
-
- if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
- prop_name = SMJS_CHARS_FROM_STRING(c, SMJS_ID_TO_STRING(id));
- if (!prop_name) return JS_FALSE;
-
- if (!strcmp(prop_name, "MediaRendererEnabled")) {
- VPASSIGN( BOOLEAN_TO_JSVAL( upnp->m_pMediaRenderer ? JS_TRUE : JS_FALSE ) );
- }
- else if (!strcmp(prop_name, "MediaServerEnabled")) {
- VPASSIGN( BOOLEAN_TO_JSVAL( upnp->m_pMediaServer ? JS_TRUE : JS_FALSE) );
- }
- else if (!strcmp(prop_name, "MediaControlEnabled")) {
- VPASSIGN( BOOLEAN_TO_JSVAL( upnp->m_pAVCtrlPoint ? JS_TRUE : JS_FALSE) );
- }
- else if (!strcmp(prop_name, "MediaServersCount")) {
- VPASSIGN( INT_TO_JSVAL( upnp->m_pAVCtrlPoint ? gf_list_count(upnp->m_pAVCtrlPoint->m_MediaServers) : 0) );
- }
- else if (!strcmp(prop_name, "MediaRenderersCount")) {
- VPASSIGN( INT_TO_JSVAL( upnp->m_pAVCtrlPoint ? gf_list_count(upnp->m_pAVCtrlPoint->m_MediaRenderers) : 0) );
- }
- else if (!strcmp(prop_name, "DevicesCount")) {
- VPASSIGN( INT_TO_JSVAL( upnp->m_pGenericController ? gf_list_count(upnp->m_pGenericController->m_Devices) : 0) );
- }
- SMJS_FREE(c, prop_name);
- return JS_TRUE;
-}
-
-static SMJS_DECL_FUNC_PROP_SET(upnp_setProperty)
-{
-#ifdef USE_FFDEV_15
- JSObject *obj = (JSObject *) __hobj;
- jsid id = (jsid) __hid;
-#endif
- char *prop_name;
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp) return JS_FALSE;
-
- if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
- prop_name = SMJS_CHARS_FROM_STRING(c, SMJS_ID_TO_STRING(id));
- if (!prop_name) return JS_FALSE;
-
- if (upnp->m_pMediaRenderer ) {
- if (!strcmp(prop_name, "MovieDuration") && JSVAL_IS_DOUBLE( VPGET() )) {
- jsdouble d;
- JS_ValueToNumber(c, VPGET(), &d);
- upnp->m_pMediaRenderer->SetDuration(d, GF_TRUE);
- }
- else if (!strcmp(prop_name, "MovieTime") && JSVAL_IS_DOUBLE( VPGET() )) {
- jsdouble d;
- JS_ValueToNumber(c, VPGET(), &d);
- upnp->m_pMediaRenderer->SetTime(d);
- }
- else if (!strcmp(prop_name, "MovieURL") && JSVAL_IS_STRING( VPGET() ) ) {
- char *url = SMJS_CHARS(c, VPGET() );
- if (url) upnp->m_pMediaRenderer->SetConnected(url);
- SMJS_FREE(c, url);
- }
- }
- SMJS_FREE(c, prop_name);
- return JS_TRUE;
-}
-
-
-static JSBool SMJS_FUNCTION(upnp_get_device)
-{
- u32 idx;
- GPAC_DeviceItem *device;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || !argc || !JSVAL_IS_INT(argv[0]) ) return JS_FALSE;
-
- idx = JSVAL_TO_INT(argv[0]);
- if (!upnp->m_pGenericController) return JS_FALSE;
-
- device = (GPAC_DeviceItem *)gf_list_get(upnp->m_pGenericController->m_Devices, idx);
- if (!device) return JS_FALSE;
- if (!device->obj) {
- device->js_ctx = upnp->m_pJSCtx;
- device->obj = JS_NewObject(upnp->m_pJSCtx, &upnp->upnpGenericDeviceClass._class, 0, 0);
- device->m_pUPnP = upnp;
- gf_js_add_root(upnp->m_pJSCtx, &device->obj, GF_JSGC_OBJECT);
- SMJS_SET_PRIVATE(device->js_ctx, device->obj, device);
- }
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(device->obj) );
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_find_service)
-{
- char *dev_ip;
- char *serv_name;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || (argc!=2) || !JSVAL_IS_STRING(argv[0]) || !JSVAL_IS_STRING(argv[1]) ) return JS_FALSE;
-
- dev_ip = SMJS_CHARS(c, argv[0]);
- serv_name = SMJS_CHARS(c, argv[1]);
- SMJS_SET_RVAL(JSVAL_NULL);
- if (!dev_ip || !serv_name || !upnp->m_pGenericController) {
- SMJS_FREE(c, dev_ip);
- SMJS_FREE(c, serv_name);
- return JS_TRUE;
- }
-
- u32 i, count = gf_list_count(upnp->m_pGenericController->m_Devices);
- for (i=0; i<count; i++) {
- GPAC_DeviceItem *item = (GPAC_DeviceItem *) gf_list_get(upnp->m_pGenericController->m_Devices, i);
- if (item->m_device->GetURLBase().GetHost() == (const char *)dev_ip) {
- GPAC_ServiceItem *serv = item->FindService(serv_name);
- if (serv) {
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(serv->obj) );
- break;
- }
- }
- }
- SMJS_FREE(c, dev_ip);
- SMJS_FREE(c, serv_name);
- return JS_TRUE;
-}
-
-static GPAC_MediaRendererItem *upnp_renderer_get_device(GF_UPnP *upnp , JSContext *c, JSObject *obj)
-{
- char *uuid;
- jsval val;
- u32 i, count;
- GPAC_MediaRendererItem *render;
- if (!JS_LookupProperty(c, obj, "UUID", &val) || JSVAL_IS_NULL(val) || JSVAL_IS_VOID(val) )
- return NULL;
- uuid = SMJS_CHARS(c, val);
- if (!uuid) return NULL;
-
- count = gf_list_count(upnp->m_pAVCtrlPoint->m_MediaRenderers);
- for (i=0; i<count; i++) {
- render = (GPAC_MediaRendererItem *)gf_list_get(upnp->m_pAVCtrlPoint->m_MediaRenderers, i);
- if (render->m_UUID==(const char *)uuid) {
- SMJS_FREE(c, uuid);
- return render;
- }
- }
- SMJS_FREE(c, uuid);
- return NULL;
-}
-
-static GPAC_MediaServerItem *upnp_server_get_device(GF_UPnP *upnp , JSContext *c, JSObject *obj)
-{
- char *uuid;
- jsval val;
- u32 i, count;
- GPAC_MediaServerItem *server;
- if (!JS_LookupProperty(c, obj, "UUID", &val) || JSVAL_IS_NULL(val) || JSVAL_IS_VOID(val) )
- return NULL;
- uuid = SMJS_CHARS(c, val);
- if (!uuid) return NULL;
-
- count = gf_list_count(upnp->m_pAVCtrlPoint->m_MediaServers);
- for (i=0; i<count; i++) {
- server = (GPAC_MediaServerItem *)gf_list_get(upnp->m_pAVCtrlPoint->m_MediaServers, i);
- if (server->m_UUID==(const char *)uuid) {
- SMJS_FREE(c, uuid);
- return server;
- }
- }
- SMJS_FREE(c, uuid);
- return NULL;
-}
-
-
-static JSBool SMJS_FUNCTION(upnp_renderer_open)
-{
- JSObject *sobj, *fobj;
- jsval val;
- GPAC_MediaRendererItem *render;
- GPAC_MediaServerItem *server;
- char *item, *resource_url;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || (argc<1) ) return JS_FALSE;
-
- render = upnp_renderer_get_device(upnp, c, obj);
- if (!render) return JS_TRUE;
-
- PLT_Service* service;
- server = NULL;
- if (argc==2) {
- sobj = JSVAL_IS_NULL(argv[1]) ? NULL : JSVAL_TO_OBJECT(argv[1]);
- server = sobj ? upnp_server_get_device(upnp, c, sobj) : NULL;
- if (NPT_FAILED(server->m_device->FindServiceByType("urn:schemas-upnp-org:service:ContentDirectory:1", service))) {
- server = NULL;
- }
- if (!server) return JS_TRUE;
- }
- item = NULL;
- resource_url = NULL;
- if (JSVAL_IS_OBJECT(argv[0])) {
- fobj = JSVAL_TO_OBJECT(argv[0]);
- if (!JS_LookupProperty(c, fobj, "ObjectID", &val) || JSVAL_IS_NULL(val) || !JSVAL_IS_STRING(val)) return JS_TRUE;
- item = SMJS_CHARS(c, val);
- }
- else if (JSVAL_IS_STRING(argv[0]))
- resource_url = SMJS_CHARS(c, argv[0]);
-
- if (!item && !resource_url) {
- SMJS_FREE(c, item);
- SMJS_FREE(c, resource_url);
- return JS_TRUE;
- }
- if (item && !server) {
- SMJS_FREE(c, item);
- SMJS_FREE(c, resource_url);
- return JS_TRUE;
- }
-
- if (NPT_SUCCEEDED(render->m_device->FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", service))) {
- if (resource_url) {
- upnp->m_pAVCtrlPoint->m_MediaController->SetAVTransportURI(render->m_device, 0, resource_url, NULL, NULL);
- upnp->m_pAVCtrlPoint->m_MediaController->Play(render->m_device, 0, "1", NULL);
- } else {
- NPT_String objID = item;
-
- // look back for the PLT_MediaItem in the results
- NPT_List<PLT_MediaObject*>::Iterator item = server->m_BrowseResults->GetFirstItem();
- while (item) {
- if ((*item)->m_ObjectID == objID) {
- if ((*item)->m_Resources.GetItemCount()) {
- upnp->m_pAVCtrlPoint->m_MediaController->SetAVTransportURI(render->m_device, 0, (*item)->m_Resources[0].m_Uri, (*item)->m_Didl, NULL);
- upnp->m_pAVCtrlPoint->m_MediaController->Play(render->m_device, 0, "1", NULL);
- }
- break;
- }
- ++item;
- }
- }
- }
- SMJS_FREE(c, item);
- SMJS_FREE(c, resource_url);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION_EXT(upnp_renderer_playback, u32 act_type)
-{
- char szSpeed[20];
- GPAC_MediaRendererItem *render;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp) return JS_FALSE;
-
- render = upnp_renderer_get_device(upnp, c, obj);
- if (!render) return JS_TRUE;
-
- switch (act_type) {
- /*play/setspeed*/
- case 0:
- strcpy(szSpeed, "1");
- if (argc && JSVAL_IS_NUMBER(argv[0]) ) {
- jsdouble d;
- JS_ValueToNumber(c, argv[0], &d);
- sprintf(szSpeed, "%2.2f", d);
- }
- upnp->m_pAVCtrlPoint->m_MediaController->Play(render->m_device, 0, szSpeed, NULL);
- break;
- /*pause*/
- case 1:
- upnp->m_pAVCtrlPoint->m_MediaController->Pause(render->m_device, 0, NULL);
- break;
- /*stop*/
- case 2:
- upnp->m_pAVCtrlPoint->m_MediaController->Stop(render->m_device, 0, NULL);
- break;
- /*seek*/
- case 3:
- if (argc && JSVAL_IS_NUMBER(argv[0]) ) {
- char szVal[100];
- jsdouble d;
- JS_ValueToNumber(c, argv[0], &d);
- format_time_string(szVal, d);
- upnp->m_pAVCtrlPoint->m_MediaController->Seek(render->m_device, 0, "ABS_TIME", szVal, NULL);
- }
- break;
- }
- return JS_TRUE;
-}
-static JSBool SMJS_FUNCTION(upnp_renderer_play)
-{
- return upnp_renderer_playback(SMJS_CALL_ARGS, 0);
-}
-static JSBool SMJS_FUNCTION(upnp_renderer_pause)
-{
- return upnp_renderer_playback(SMJS_CALL_ARGS, 1);
-}
-static JSBool SMJS_FUNCTION(upnp_renderer_stop)
-{
- return upnp_renderer_playback(SMJS_CALL_ARGS, 2);
-}
-static JSBool SMJS_FUNCTION(upnp_renderer_seek)
-{
- return upnp_renderer_playback(SMJS_CALL_ARGS, 3);
-}
-
-static JSBool SMJS_FUNCTION(upnp_get_renderer)
-{
- JSObject *s_obj;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || !upnp->m_pAVCtrlPoint || (argc!=1) ) return JS_FALSE;
-
- GPAC_MediaRendererItem *mr = NULL;
- if (JSVAL_IS_INT(argv[0])) {
- u32 id = JSVAL_TO_INT(argv[0]);
- mr = (GPAC_MediaRendererItem *) gf_list_get(upnp->m_pAVCtrlPoint->m_MediaRenderers, id);
- }
- else if (JSVAL_IS_STRING(argv[0])) {
- u32 i=0;
- char *uuid = SMJS_CHARS(c, argv[0]);
- while ((mr = (GPAC_MediaRendererItem *) gf_list_enum(upnp->m_pAVCtrlPoint->m_MediaRenderers, &i))) {
- if (mr->m_UUID==(const char *)uuid) break;
- }
- SMJS_FREE(c, uuid);
- }
- if (!mr) return JS_FALSE;
-
- s_obj = JS_NewObject(c, &upnp->upnpDeviceClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, s_obj, upnp);
-
- JS_DefineProperty(c, s_obj, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mr->m_device->GetFriendlyName()) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, s_obj, "UUID", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mr->m_UUID ) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, s_obj, "HostName", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mr->m_device->GetURLBase().GetHost() ) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineFunction(c, s_obj, "Open", upnp_renderer_open, 2, 0);
- JS_DefineFunction(c, s_obj, "Play", upnp_renderer_play, 1, 0);
- JS_DefineFunction(c, s_obj, "Pause", upnp_renderer_pause, 0, 0);
- JS_DefineFunction(c, s_obj, "Stop", upnp_renderer_stop, 0, 0);
- JS_DefineFunction(c, s_obj, "Seek", upnp_renderer_seek, 0, 0);
-
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(s_obj) );
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_server_browse)
-{
- NPT_String parent;
- GPAC_MediaServerItem *server;
- char *dir, *filter, *_dir, *_filter;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || (argc!=2) ) return JS_FALSE;
-
- server = upnp_server_get_device(upnp, c, obj);
- if (!server) return JS_FALSE;
-
- _dir = _filter = NULL;
-
- dir = _dir = SMJS_CHARS(c, argv[0]);
- if (!dir) dir = (char*)"0";
- filter = _filter = SMJS_CHARS(c, argv[1]);
- if (!filter) filter = (char*)"*";
-
- PLT_Service* service;
- if (NPT_SUCCEEDED(server->m_device->FindServiceByType("urn:schemas-upnp-org:service:ContentDirectory:1", service))) {
- if (!strcmp(dir, "0") || !strcmp(dir, "\\") || !strcmp(dir, "/")) {
- server->m_ParentDirectories.Clear();
- }
- if (!strcmp(dir, "..")) {
- if (!server->m_ParentDirectories.GetItemCount()) {
- SMJS_FREE(c, _dir);
- SMJS_FREE(c, _filter);
- return JS_FALSE;
- }
- server->m_ParentDirectories.Pop(parent);
- server->m_ParentDirectories.Peek(parent);
- dir=parent;
-
- if (server->m_ParentDirectories.GetItemCount()==1)
- server->m_ParentDirectories.Clear();
-
- } else {
- server->m_ParentDirectories.Push(dir);
- }
- upnp->m_pAVCtrlPoint->Browse(server, dir, filter);
-
-
- jsval aval = INT_TO_JSVAL(0);
- if (!server->m_BrowseResults.IsNull()) {
- aval = INT_TO_JSVAL(server->m_BrowseResults->GetItemCount());
- }
- JS_SetProperty(c, obj, "FilesCount", &aval);
- }
- SMJS_FREE(c, _dir);
- SMJS_FREE(c, _filter);
- return JS_TRUE;
-}
-
-
-static JSBool SMJS_FUNCTION(upnp_server_has_parent_dir)
-{
- GPAC_MediaServerItem *server;
- SMJS_OBJ
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp) return JS_FALSE;
-
- server = upnp_server_get_device(upnp, c, obj);
- if (!server) return JS_TRUE;
- SMJS_SET_RVAL( BOOLEAN_TO_JSVAL( server->m_ParentDirectories.GetItemCount() ? JS_TRUE : JS_FALSE));
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_server_get_resource_uri)
-{
- u32 idx;
- SMJS_OBJ
- SMJS_ARGS
- PLT_MediaObject *mo = (PLT_MediaObject *)SMJS_GET_PRIVATE(c, obj);
- if (!mo || (argc!=1) || !JSVAL_IS_INT(argv[0]) ) return JS_FALSE;
- idx = JSVAL_TO_INT(argv[0]);
- if (idx<mo->m_Resources.GetItemCount()) {
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, mo->m_Resources[idx].m_Uri)));
- } else {
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, "")));
- }
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_server_get_file)
-{
- GPAC_MediaServerItem *server;
- u32 id;
- JSObject *f_obj;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || (argc!=1) || !JSVAL_IS_INT(argv[0]) ) return JS_FALSE;
-
- server = upnp_server_get_device(upnp, c, obj);
- if (!server) return JS_TRUE;
- if (server->m_BrowseResults.IsNull()) return JS_TRUE;
-
- id = JSVAL_TO_INT(argv[0]);
- PLT_MediaObject *mo;
- server->m_BrowseResults->Get(id, mo);
- if (!mo) return JS_TRUE;
-
- f_obj = JS_NewObject(c, &upnp->upnpDeviceClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, f_obj, mo);
-
- JS_DefineProperty(c, f_obj, "ObjectID", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mo->m_ObjectID)), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, f_obj, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mo->m_Title)), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, f_obj, "ParentID", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mo->m_ParentID)), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, f_obj, "Directory", BOOLEAN_TO_JSVAL( mo->IsContainer() ? JS_TRUE : JS_FALSE), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- if (!mo->IsContainer()) {
- JS_DefineProperty(c, f_obj, "ResourceCount", INT_TO_JSVAL(mo->m_Resources.GetItemCount()), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineFunction(c, f_obj, "GetResourceURI", upnp_server_get_resource_uri, 1, 0);
- }
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(f_obj));
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_server_get_file_uri)
-{
- GPAC_MediaServerItem *server;
- u32 id;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || (argc!=1) || !JSVAL_IS_INT(argv[0]) ) return JS_FALSE;
-
- server = upnp_server_get_device(upnp, c, obj);
- if (!server) return JS_TRUE;
- if (server->m_BrowseResults.IsNull()) return JS_TRUE;
-
- id = JSVAL_TO_INT(argv[0]);
- PLT_MediaObject *mo;
- server->m_BrowseResults->Get(id, mo);
- if (!mo) return JS_TRUE;
-
- if (mo->m_Resources.GetItemCount()) {
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, mo->m_Resources[0].m_Uri) ) );
- }
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_get_server)
-{
- JSObject *s_obj;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || !upnp->m_pAVCtrlPoint || (argc!=1)) return JS_FALSE;
-
-
- GPAC_MediaServerItem *ms = NULL;
- if (JSVAL_IS_INT(argv[0])) {
- u32 id = JSVAL_TO_INT(argv[0]);
- ms = (GPAC_MediaServerItem *) gf_list_get(upnp->m_pAVCtrlPoint->m_MediaServers, id);
- }
- else if (JSVAL_IS_STRING(argv[0])) {
- u32 i=0;
- char *uuid = SMJS_CHARS(c, argv[0]);
- while ((ms = (GPAC_MediaServerItem *) gf_list_enum(upnp->m_pAVCtrlPoint->m_MediaServers, &i))) {
- if (ms->m_UUID==(const char *)uuid) break;
- }
- SMJS_FREE(c, uuid);
- }
- if (!ms) return JS_FALSE;
- s_obj = JS_NewObject(c, &upnp->upnpDeviceClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, s_obj, upnp);
-
- JS_DefineProperty(c, s_obj, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, ms->m_device->GetFriendlyName()) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, s_obj, "UUID", STRING_TO_JSVAL( JS_NewStringCopyZ(c, ms->m_UUID ) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, s_obj, "FilesCount", INT_TO_JSVAL(10), 0, 0, 0 | JSPROP_PERMANENT);
- JS_DefineFunction(c, s_obj, "Browse", upnp_server_browse, 2, 0);
- JS_DefineFunction(c, s_obj, "GetFile", upnp_server_get_file, 1, 0);
- JS_DefineFunction(c, s_obj, "GetFileURI", upnp_server_get_file_uri, 1, 0);
- JS_DefineFunction(c, s_obj, "HasParentDirectory", upnp_server_has_parent_dir, 0, 0);
-
-
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(s_obj) );
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_bind_renderer)
-{
- SMJS_OBJ
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp) return JS_TRUE;
- upnp->m_renderer_bound = GF_TRUE;
-
- /*remove ourselves from the event filters since we will only be called through JS*/
- gf_term_remove_event_filter(upnp->m_pTerm, &upnp->evt_filter);
-
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_share_resource)
-{
- char *url, *host;
- NPT_String resourceURI;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || !upnp->m_pMediaServer || !argc || !JSVAL_IS_STRING(argv[0]) ) return JS_TRUE;
- url = SMJS_CHARS(c, argv[0]);
- if (!url) return JS_TRUE;
-
- host = NULL;
- if (argc && JSVAL_IS_STRING(argv[1]) ) {
- host = SMJS_CHARS(c, argv[1]);
- }
-
- resourceURI = upnp->m_pMediaServer->GetResourceURI(url, host);
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(upnp->m_pJSCtx, resourceURI ) ));
-
- SMJS_FREE(c, url);
- SMJS_FREE(c, host);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_share_virtual_resource)
-{
- Bool temp = GF_FALSE;
- char *res_url, *res_val, *mime;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || !upnp->m_pMediaServer || (argc<2) || !JSVAL_IS_STRING(argv[0]) || !JSVAL_IS_STRING(argv[1]) ) return JS_TRUE;
- res_url = SMJS_CHARS(c, argv[0]);
- if (!res_url) return JS_TRUE;
- res_val = SMJS_CHARS(c, argv[1]);
- if (!res_val) {
- SMJS_FREE(c, res_url);
- return JS_TRUE;
- }
- mime = NULL;
- if (argc==3) mime = SMJS_CHARS(c, argv[2]);
- if ((argc==4) && JSVAL_IS_BOOLEAN(argv[3]) && (JSVAL_TO_BOOLEAN(argv[3])==JS_TRUE) ) temp = GF_TRUE;
-
- upnp->m_pMediaServer->ShareVirtualResource(res_url, res_val, mime ? mime : "application/octet-stream", temp);
- SMJS_FREE(c, res_url);
- SMJS_FREE(c, res_val);
- SMJS_FREE(c, mime);
- return JS_TRUE;
-}
-
-
-static NPT_UInt8 GENERIC_SCPDXML[] = "<scpd xmlns=\"urn:schemas-upnp-org:service-1-0\"><specVersion> <major>1</major> <minor>0</minor> </specVersion> <actionList> <action> <name>GetStatus</name> <argumentList> <argument> <name>ResultStatus</name> <direction>out</direction> <relatedStateVariable>Status</relatedStateVariable> </argument> </argumentList> </action> </actionList> <serviceStateTable> <stateVariable sendEvents=\"yes\"> <name>Status</name> <dataType>boolean</dataType> </stateVariable></serviceStateTable> </scpd>";
-
-
-static JSBool SMJS_FUNCTION(upnp_device_setup_service)
-{
- char *name, *type, *id, *scpd_xml;
- NPT_Result res;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
- if (!device) return JS_FALSE;
- if (argc<3) return JS_FALSE;
-
- name = SMJS_CHARS(c, argv[0]);
- type = SMJS_CHARS(c, argv[1]);
- id = SMJS_CHARS(c, argv[2]);
-
- if (!name || !type || !id) {
- SMJS_FREE(c, name);
- SMJS_FREE(c, type);
- SMJS_FREE(c, id);
- return JS_FALSE;
- }
-
- scpd_xml = NULL;
- if ((argc>3) && JSVAL_IS_STRING(argv[3])) scpd_xml = SMJS_CHARS(c, argv[3]);
-
- GPAC_Service* service = new GPAC_Service(device, type, id, name);
- res = service->SetSCPDXML((const char*) scpd_xml ? scpd_xml : (char *)GENERIC_SCPDXML);
-
- SMJS_FREE(c, name);
- SMJS_FREE(c, type);
- SMJS_FREE(c, id);
-
- if (res != NPT_SUCCESS) {
- delete service;
- return JS_FALSE;
- }
-
- gf_list_add(device->m_pServices, service);
-
- service->SetupJS(c, device->m_pUPnP, device->obj);
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(service->m_pObj) );
- return JS_TRUE;
-}
-
-
-static JSBool SMJS_FUNCTION(upnp_device_start)
-{
- jsval sval;
- char *str;
- SMJS_OBJ
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
- if (!device) return JS_FALSE;
-
- if (JS_LookupProperty(device->m_pUPnP->m_pJSCtx, obj, "PresentationURL", &sval) && JSVAL_IS_STRING(sval)) {
- str = SMJS_CHARS(c, sval);
- char *url = gf_url_concatenate(device->js_source, str);
- SMJS_FREE(c, str);
-
- /*we will use our media server to exchange the URL if file based
- !!! THIS IS BROKEN IF MULTIPLE INTERFACES EXIST ON THE DEVICE !!!
- */
- if (device->m_pUPnP->m_pMediaServer) {
- device->m_PresentationURL = device->m_pUPnP->m_pMediaServer->GetResourceURI(url, NULL);
- }
- /*otherwise we can only use absolute URLs */
- else if (strstr(url, "://") && !strstr(url, "file://")) {
- device->m_PresentationURL = url;
- }
- gf_free(url);
- }
-
- str = NULL;
- if (JS_LookupProperty(device->m_pUPnP->m_pJSCtx, obj, "ModelDescription", &sval) && JSVAL_IS_STRING(sval))
- str = SMJS_CHARS(c, sval);
-
- device->m_ModelDescription = str ? str : "GPAC Generic Device";
- SMJS_FREE(c, str);
-
- str = NULL;
- if (JS_LookupProperty(device->m_pUPnP->m_pJSCtx, obj, "ModelURL", &sval) && JSVAL_IS_STRING(sval))
- str = SMJS_CHARS(c, sval);
- device->m_ModelURL = str ? str : "http://gpac.io";
- SMJS_FREE(c, str);
-
- str = NULL;
- if (JS_LookupProperty(device->m_pUPnP->m_pJSCtx, obj, "ModelNumber", &sval) && JSVAL_IS_STRING(sval))
- str = SMJS_CHARS(c, sval);
- device->m_ModelNumber = str ? str : gf_gpac_version();
- SMJS_FREE(c, str);
-
- str = NULL;
- if (JS_LookupProperty(device->m_pUPnP->m_pJSCtx, obj, "ModelName", &sval) && JSVAL_IS_STRING(sval))
- str = SMJS_CHARS(c, sval);
- device->m_ModelName = str ? str : "GPAC Generic Device";
- SMJS_FREE(c, str);
-
- device->m_Manufacturer = "Telecom ParisTech";
- device->m_ManufacturerURL = "http://www.telecom-paristech.fr/";
-
- if (device->m_pUPnP->m_pGenericController) {
- const char *opt = gf_opts_get_key("UPnP", "IgnoreCreatedDevices");
- if (!opt || !strcmp(opt, "yes")) {
- device->m_pUPnP->m_pGenericController->m_CtrlPoint->IgnoreUUID(device->GetUUID());
- }
- }
- if (JS_LookupProperty(device->m_pUPnP->m_pJSCtx, obj, "Run", &sval) && JSVAL_IS_OBJECT(sval)) {
- device->obj = obj;
- device->run_proc = sval;
- gf_js_add_root(device->m_pUPnP->m_pJSCtx, &device->run_proc, GF_JSGC_VAL);
- }
- if (JS_LookupProperty(device->m_pUPnP->m_pJSCtx, obj, "OnAction", &sval) && JSVAL_IS_OBJECT(sval)) {
- device->obj = obj;
- device->act_proc = sval;
- gf_js_add_root(device->m_pUPnP->m_pJSCtx, &device->act_proc, GF_JSGC_VAL);
- }
- PLT_DeviceHostReference devRef(device);
- device->m_pUPnP->m_pPlatinum->AddDevice(devRef);
-
- return JS_TRUE;
-}
-
-#ifdef GPAC_UNUSED_FUNC
-static JSBool SMJS_FUNCTION(upnp_device_stop)
-{
- SMJS_OBJ
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
- if (!device) return JS_FALSE;
-
- PLT_DeviceHostReference devRef(device);
- device->m_pUPnP->m_pPlatinum->RemoveDevice(devRef);
-
- return JS_TRUE;
-}
-#endif
-
-static GPAC_GenericDevice *upnp_create_generic_device(GF_UPnP *upnp, JSObject*global, const char *id, const char *name)
-{
- GPAC_GenericDevice *device;
- device = new GPAC_GenericDevice(name, id);
- device->m_pUPnP = upnp;
- device->js_source = "";
-
- device->obj = JS_NewObject(upnp->m_pJSCtx, &upnp->upnpDeviceClass._class, 0, global);
- gf_js_add_root(upnp->m_pJSCtx, &device->obj, GF_JSGC_OBJECT);
-
- JS_DefineProperty(upnp->m_pJSCtx, device->obj, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(upnp->m_pJSCtx, name) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(upnp->m_pJSCtx, device->obj, "ID", STRING_TO_JSVAL( JS_NewStringCopyZ(upnp->m_pJSCtx, id) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(upnp->m_pJSCtx, device->obj, "UUID", STRING_TO_JSVAL( JS_NewStringCopyZ(upnp->m_pJSCtx, device->GetUUID()) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineFunction(upnp->m_pJSCtx, device->obj, "SetupService", upnp_device_setup_service, 0, 0);
- JS_DefineFunction(upnp->m_pJSCtx, device->obj, "Start", upnp_device_start, 0, 0);
-// JS_DefineFunction(upnp->m_pJSCtx, device->obj, "Stop", upnp_device_stop, 0, 0);
- SMJS_SET_PRIVATE(upnp->m_pJSCtx, device->obj, device);
- if (!upnp->m_Devices) upnp->m_Devices = gf_list_new();
- gf_list_add(upnp->m_Devices, device);
-
- return device;
-}
-
-static JSBool SMJS_FUNCTION(upnp_create_device)
-{
- GPAC_GenericDevice *device;
- char *id, *name;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || (argc != 2)) return JS_FALSE;
-
- id = SMJS_CHARS(c, argv[0]);
- name = SMJS_CHARS(c, argv[1]);
- if (!id || !name) {
- SMJS_FREE(c, name);
- SMJS_FREE(c, id);
- return JS_FALSE;
- }
-
- device = upnp_create_generic_device(upnp, NULL, id, name);
- if (device)
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(device->obj) );
-
- SMJS_FREE(c, name);
- SMJS_FREE(c, id);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_delete_device)
-{
- GPAC_GenericDevice *device;
- SMJS_OBJ
- SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
- if (!upnp || (argc != 1)) return JS_FALSE;
-
- device = (GPAC_GenericDevice *) SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- if (!device) return JS_FALSE;
-
- gf_list_del_item(upnp->m_Devices, device);
- device->DetachJS(c);
- PLT_DeviceHostReference devRef = PLT_DeviceHostReference(device);
- upnp->m_pPlatinum->RemoveDevice(devRef);
- devRef.Detach();
- return JS_TRUE;
-}
-
-Bool GF_UPnP::LoadJS(GF_TermExtJS *param)
-{
- u32 i, count;
- JSPropertySpec upnpClassProps[] = {
- SMJS_PROPERTY_SPEC(0, 0, 0, 0, 0)
- };
- JSFunctionSpec upnpClassFuncs[] = {
- SMJS_FUNCTION_SPEC("BindRenderer", upnp_bind_renderer, 0),
- SMJS_FUNCTION_SPEC("GetMediaServer", upnp_get_server, 1),
- SMJS_FUNCTION_SPEC("GetMediaRenderer", upnp_get_renderer, 1),
- SMJS_FUNCTION_SPEC("ShareResource", upnp_share_resource, 1),
- SMJS_FUNCTION_SPEC("ShareVirtualResource", upnp_share_virtual_resource, 2),
- SMJS_FUNCTION_SPEC("GetDevice", upnp_get_device, 1),
- SMJS_FUNCTION_SPEC("FindService", upnp_find_service, 1),
- SMJS_FUNCTION_SPEC("CreateDevice", upnp_create_device, 2),
- SMJS_FUNCTION_SPEC("DeleteDevice", upnp_delete_device, 1),
- SMJS_FUNCTION_SPEC(0, 0, 0)
- };
-
- if (param->unload) {
- if (m_nbJSInstances) {
- m_nbJSInstances--;
- if (m_pJSCtx==param->ctx) m_nbJSInstances = 0;
-
- if (!m_nbJSInstances) {
- if (m_pGenericController) {
- u32 i, count;
- count = gf_list_count(m_pGenericController->m_Devices);
- for (i=0; i<count; i++) {
- GPAC_DeviceItem *item = (GPAC_DeviceItem *)gf_list_get(m_pGenericController->m_Devices, i);
- item->DetachJS();
- item->js_ctx = NULL;
- }
- }
- if (m_Devices) {
- while (gf_list_count(m_Devices)) {
- GPAC_GenericDevice *device = (GPAC_GenericDevice*)gf_list_get(m_Devices, 0);
- gf_list_rem(m_Devices, 0);
- device->DetachJS(m_pJSCtx);
- }
- gf_list_del(m_Devices);
- m_Devices = NULL;
- }
- m_pJSCtx = NULL;
- }
- }
- return GF_FALSE;
- }
- if (m_nbJSInstances) {
- /*FIXME - this was possible in previous version of SpiderMonkey, don't know how to fix that for new ones*/
-#if (JS_VERSION>=185)
- m_nbJSInstances++;
- return GF_FALSE;
-#else
- JS_DefineProperty((JSContext*)param->ctx, (JSObject*)param->global, "UPnP", OBJECT_TO_JSVAL(m_pObj), 0, 0, 0);
- m_nbJSInstances++;
-#endif
- return GF_FALSE;
- }
-
- m_pJSCtx = (JSContext*)param->ctx;
- /*setup JS bindings*/
- JS_SETUP_CLASS(upnpClass, "UPNPMANAGER", JSCLASS_HAS_PRIVATE, upnp_getProperty, upnp_setProperty, JS_FinalizeStub);
-
- GF_JS_InitClass(m_pJSCtx, (JSObject*)param->global, 0, &upnpClass, 0, 0, upnpClassProps, upnpClassFuncs, 0, 0);
- m_pObj = JS_DefineObject(m_pJSCtx, (JSObject*)param->global, "UPnP", &upnpClass._class, 0, 0);
- SMJS_SET_PRIVATE(m_pJSCtx, m_pObj, this);
-
- JS_SETUP_CLASS(upnpDeviceClass, "UPNPAVDEVICE", JSCLASS_HAS_PRIVATE, JS_PropertyStub, JS_PropertyStub_forSetter, JS_FinalizeStub);
-
- /*setup JS bindings*/
- JSPropertySpec upnpDeviceClassProps[] = {
- SMJS_PROPERTY_SPEC(0, 0, 0, 0, 0)
- };
- JSFunctionSpec upnpDeviceClassFuncs[] = {
- SMJS_FUNCTION_SPEC("FindService", upnp_device_find_service, 0),
- SMJS_FUNCTION_SPEC("GetService", upnp_device_get_service, 0),
- SMJS_FUNCTION_SPEC(0, 0, 0)
- };
- JS_SETUP_CLASS(upnpGenericDeviceClass, "UPNPDEVICE", JSCLASS_HAS_PRIVATE, upnpdevice_getProperty, JS_PropertyStub_forSetter, JS_FinalizeStub);
- GF_JS_InitClass(m_pJSCtx, (JSObject*)param->global, 0, &upnpGenericDeviceClass, 0, 0, upnpDeviceClassProps, upnpDeviceClassFuncs, 0, 0);
-
- JS_SETUP_CLASS(upnpServiceClass, "UPNPSERVICEDEVICE", JSCLASS_HAS_PRIVATE, upnpservice_getProperty, JS_PropertyStub_forSetter, JS_FinalizeStub);
- GF_JS_InitClass(m_pJSCtx, (JSObject*)param->global, 0, &upnpServiceClass, 0, 0, 0, 0, 0, 0);
-
- m_nbJSInstances=1;
-
- upnp_init_time = gf_sys_clock();
-
- count = gf_opts_get_key_count("UPnPDevices");
- for (i=0; i<count; i++) {
- char szFriendlyName[1024], szFile[1024], *sep;
- const char *device_id = gf_opts_get_key_name("UPnPDevices", i);
- const char *dev = gf_opts_get_key("UPnPDevices", device_id);
-
- if (!strncmp(dev, "off;", 4)) continue;
-
- if (!strncmp(dev, "on;", 3)) dev += 3;
-
- sep = (char*)strchr(dev, ';');
- if (!sep) continue;
- sep[0] = 0;
- strcpy(szFile, dev);
- sep[0] = ';';
-
- if (!sep[1]) continue;
- strcpy(szFriendlyName, sep+1);
-
- FILE *f = gf_fopen(szFile, "rt");
- if (!f) continue;
-
-
- GPAC_GenericDevice *device = upnp_create_generic_device(this, (JSObject*)param->global, device_id, szFriendlyName);
- device->js_source = szFile;
-
- jsval aval;
- gf_fseek(f, 0, SEEK_END);
- u32 size = (u32) gf_ftell(f);
- gf_fseek(f, 0, SEEK_SET);
- char *buf = (char*)gf_malloc(sizeof(char)*(size+1));
- size = (u32) fread(buf, 1, size, f);
- buf[size]=0;
- /*evaluate the script on the object only*/
- if (JS_EvaluateScript(m_pJSCtx, device->obj, buf, size, 0, 0, &aval) != JS_TRUE) {
- gf_js_remove_root(m_pJSCtx, &device->obj, GF_JSGC_OBJECT);
- GF_LOG(GF_LOG_ERROR, GF_LOG_NETWORK, ("[UPnP] Unable to load device %s: script error in %s\n", szFriendlyName, szFile));
- gf_list_del_item(m_Devices, device);
- delete device;
- }
- gf_fclose(f);
- gf_free(buf);
- }
- return GF_TRUE;
-}
-
-#endif
-
-static Bool upnp_process(GF_TermExt *termext, u32 action, void *param)
-{
- const char *opt;
- GF_UPnP *upnp = (GF_UPnP *) termext->udta;
-
- switch (action) {
- case GF_TERM_EXT_START:
- opt = gf_opts_get_key("UPnP", "Enabled");
- if (!opt) {
- //UPnP is disabled by default on all platforms until we have a more stable state on load and exit
- opt = "no";
- GF_LOG(GF_LOG_WARNING, GF_LOG_NETWORK, ("[UPnP] Disabling UPnP - to enable it, modify section [UPnP] key \"Enabled\" in GPAC config file\n"));
- gf_opts_set_key("UPnP", "Enabled", opt);
- }
- if (!strcmp(opt, "yes")) {
- upnp->Load((GF_Terminal *)param);
- return GF_TRUE;
- }
- return GF_FALSE;
-
- case GF_TERM_EXT_STOP:
- upnp->Unload();
- break;
-
- case GF_TERM_EXT_PROCESS:
-#ifdef GPAC_HAS_SPIDERMONKEY
- if (upnp->m_Devices) {
- u32 now;
- now = gf_sys_clock() - upnp->upnp_init_time;
- if (now - upnp->last_time > 200) {
- u32 i, count, arg_set;
- jsval argv[1], rval;
- upnp->LockJavascript(GF_TRUE);
- arg_set = 0;
- count = gf_list_count(upnp->m_Devices);
- for (i=0; i<count; i++) {
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)gf_list_get(upnp->m_Devices, i);
- if (!JSVAL_IS_NULL(device->run_proc)) {
- if (!arg_set) {
- argv[0] = DOUBLE_TO_JSVAL( JS_NewDouble(upnp->m_pJSCtx, (Double)now / 1000.0) );
- arg_set = 1;
- }
- JS_CallFunctionValue(upnp->m_pJSCtx, device->obj, device->run_proc, 1, argv, &rval);
- }
- }
- upnp->LockJavascript(GF_FALSE);
- upnp->last_time = now;
- }
- }
-#endif
- break;
-
-#ifdef GPAC_HAS_SPIDERMONKEY
- case GF_TERM_EXT_JSBIND:
- return upnp->LoadJS((GF_TermExtJS*)param);
-#endif
- }
- return GF_FALSE;
-}
-
-
-GF_TermExt *upnp_new()
-{
- GF_TermExt *dr;
- GF_UPnP *ext;
- dr = (GF_TermExt *) gf_malloc(sizeof(GF_TermExt));
- memset(dr, 0, sizeof(GF_TermExt));
- GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC UPnP Platinum", "gpac distribution");
-
- dr->process = upnp_process;
- ext = new GF_UPnP();
- dr->udta = ext;
- ext->term_ext = dr;
- ext->evt_filter.on_event = upnp_on_term_event;
- ext->evt_filter.udta = ext;
-
- dr->caps = GF_TERM_EXTENSION_NOT_THREADED;
-#ifdef GPAC_HAS_SPIDERMONKEY
- dr->caps |= GF_TERM_EXTENSION_JS;
-#endif
- return dr;
-}
-
-
-void upnp_delete(GF_BaseInterface *ifce)
-{
- GF_TermExt *dr = (GF_TermExt *) ifce;
- GF_UPnP *ext = (GF_UPnP *) dr->udta;
- delete ext;
- gf_free(dr);
-}
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-
-#ifndef _GPAC_PLATINUM_H_
-#define _GPAC_PLATINUM_H_
-
-#include "Platinum.h"
-#include "PltUPnP.h"
-#include "GPACFileMediaServer.h"
-#include "GPACMediaRenderer.h"
-#include "GPACMediaController.h"
-#include "GenericDevice.h"
-
-#include <gpac/modules/term_ext.h>
-#include <gpac/term_info.h>
-#include <gpac/thread.h>
-#include <gpac/network.h>
-#include <gpac/options.h>
-#include <gpac/internal/terminal_dev.h>
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-
-#include <gpac/internal/scenegraph_dev.h>
-#include <gpac/internal/smjs_api.h>
-
-#endif
-
-class GPAC_DeviceItem;
-
-
-class GF_UPnP
-{
-public:
- GF_UPnP();
- ~GF_UPnP();
-
- /*load UPnP services*/
- void Load(GF_Terminal *term);
- /*unload UPnP services*/
- void Unload();
-
- /*GPAC event filter*/
- Bool ProcessEvent(GF_Event *evt);
-
- GF_TermExt *term_ext;
- /*GPAC's terminal*/
- GF_Terminal *m_pTerm;
-
- /*Platinum's UPnP stack*/
- PLT_UPnP *m_pPlatinum;
-
- /*GPAC UPnP/DLNA media renderer if loaded*/
- GPAC_MediaRenderer *m_pMediaRenderer;
- /*is renderer bound to the script ? If so, events are dispatched to the script's "UPnP" object*/
- Bool m_renderer_bound;
- NPT_String m_IPFilter;
-
- /*regular media file server from platinum*/
- GPAC_FileMediaServer *m_pMediaServer;
-
- /*GPAC's AVControlPoint*/
- GPAC_MediaController *m_pAVCtrlPoint;
-
- void LockJavascript(Bool do_lock);
-
- /*callback from GPAC MediaRenderer*/
- void OnConnect(const char *url, const char *src_url);
- void OnPause(Bool do_resume, const char *src_url);
- void OnStop(const char *src_url);
- void OnSeek(Double time);
- void OnSetPlayMode(const char *src_url);
- void onDurationChanged(s32 renderer_idx, Double dur);
- void onTimeChanged(s32 renderer_idx, Double time);
- void ContainerChanged(PLT_DeviceDataReference& device, const char *item_id, const char *update_id);
- NPT_String OnMigrate();
-
- GPAC_GenericController *m_pGenericController;
-
- PLT_CtrlPoint *m_pCtrlPoint;
- PLT_CtrlPointReference m_ctrlPtRef;
-
- GF_TermEventFilter evt_filter;
- /*JS bindings*/
-#ifdef GPAC_HAS_SPIDERMONKEY
- Bool LoadJS(GF_TermExtJS *param);
- u32 m_nbJSInstances;
- JSContext *m_pJSCtx;
- JSObject *m_pObj;
- GF_JSClass upnpClass;
- GF_JSClass upnpDeviceClass;
- GF_JSClass upnpGenericDeviceClass;
- GF_JSClass upnpServiceClass;
-
- GF_List *m_Devices;
- u32 last_time, upnp_init_time;
-
- /*callback from AVControlPoint device discovery*/
- void OnMediaServerAdd(PLT_DeviceDataReference& device, int added);
- void OnMediaRendererAdd(PLT_DeviceDataReference& device, int added);
-
- void OnDeviceAdd(GPAC_DeviceItem *item, int added);
-
-
- jsval GetUPnPDevice(const char *src_url);
-
-#else
- void OnMediaServerAdd(PLT_DeviceDataReference& device, int added) {}
- void OnMediaRendererAdd(PLT_DeviceDataReference& device, int added) {}
- void OnDeviceAdd(GPAC_DeviceItem *item, int added) {}
-#endif
-
-};
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-SMJS_DECL_FUNC_PROP_GET( upnpservice_getProperty);
-
-#ifdef USE_FFDEV_17
-#define VPASSIGN(__b) __vp.set( __b )
-#define VPGET() (jsval) __vp
-#else
-#define VPASSIGN(__b) *vp = __b
-#define VPGET() *vp
-#endif
-
-#endif
-
-void format_time_string(char *str, Double dur);
-
-
-#endif /*_GPAC_PLATINUM_H_*/
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-
-#include "GenericDevice.h"
-#include "GPACPlatinum.h"
-//#include "PltXmlHelper.h"
-
-NPT_SET_LOCAL_LOGGER("gpac.genericdevice")
-
-GPAC_ServiceItem::GPAC_ServiceItem(GPAC_DeviceItem *device, PLT_Service *service) : m_device(device), m_service(service)
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- obj = NULL;
- on_event = JSVAL_NULL;
- m_StateListeners = gf_list_new();
- m_ArgListeners = gf_list_new();
- subscribed = GF_FALSE;
- vars=NULL;
-#endif
-}
-
-GPAC_ServiceItem::~GPAC_ServiceItem()
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- DetachJS();
- gf_list_del(m_StateListeners);
- gf_list_del(m_ArgListeners);
-#endif
-}
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-void GPAC_ServiceItem::DetachJS()
-{
- if (obj) {
- gf_js_remove_root(js_ctx, &obj, GF_JSGC_OBJECT);
- SMJS_SET_PRIVATE(js_ctx, obj, NULL);
- obj = NULL;
- }
- if (!JSVAL_IS_NULL(on_event)) {
- gf_js_remove_root(js_ctx, &on_event, GF_JSGC_VAL);
- on_event = JSVAL_NULL;
- }
- while (gf_list_count(m_StateListeners)) {
- GPAC_StateVariableListener *svl = (GPAC_StateVariableListener *)gf_list_get(m_StateListeners, 0);
- gf_list_rem(m_StateListeners, 0);
- gf_js_remove_root(js_ctx, &svl->on_event, GF_JSGC_VAL);
- delete svl;
- }
- while (gf_list_count(m_ArgListeners)) {
- GPAC_ActionArgListener *argl = (GPAC_ActionArgListener *)gf_list_get(m_ArgListeners, 0);
- gf_list_rem(m_ArgListeners, 0);
- gf_js_remove_root(js_ctx, &argl->on_event, GF_JSGC_VAL);
- delete argl;
- }
-}
-#endif
-
-
-GPAC_DeviceItem::GPAC_DeviceItem(PLT_DeviceDataReference device, NPT_String uuid)
- : m_device(device), m_UUID(uuid)
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- obj = NULL;
- js_ctx = NULL;
- m_Services = gf_list_new();
-#endif
-}
-
-GPAC_DeviceItem::~GPAC_DeviceItem()
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- DetachJS();
-#endif
- gf_list_del(m_Services);
-}
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-void GPAC_DeviceItem::DetachJS() {
- if (obj) {
- gf_js_remove_root(js_ctx, &obj, GF_JSGC_OBJECT);
- SMJS_SET_PRIVATE(js_ctx, obj, NULL);
- obj = NULL;
- }
- while (gf_list_count(m_Services)) {
- GPAC_ServiceItem *item = (GPAC_ServiceItem*)gf_list_get(m_Services, 0);
- gf_list_rem(m_Services, 0);
- delete item;
- }
-}
-#endif
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-static JSBool SMJS_FUNCTION(upnp_service_set_listener)
-{
- GPAC_StateVariableListener *svl = NULL;
- char *name=NULL;
- u32 i;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!service || !argc || !JSVAL_IS_OBJECT(argv[0])) return JS_FALSE;
-
- if (argc<1) {
- if (!JSVAL_IS_NULL(service->on_event))
- gf_js_remove_root(c, &service->on_event, GF_JSGC_VAL);
- service->on_event = JSVAL_NULL;
- if (!JSVAL_IS_NULL(argv[0])) {
- service->on_event = argv[0];
- gf_js_add_root(c, &service->on_event, GF_JSGC_VAL);
- if (!service->subscribed) {
- service->m_device->m_pUPnP->m_pGenericController->m_CtrlPoint->Subscribe(service->m_service);
- service->subscribed = GF_TRUE;
- }
- }
- return JS_TRUE;
- }
- if (!JSVAL_IS_STRING(argv[1])) return JS_FALSE;
- name = SMJS_CHARS(c, argv[1]);
- if (!name) return JS_FALSE;
-
- /*variable state listener*/
- i=0;
- while ((svl = (GPAC_StateVariableListener *)gf_list_enum(service->m_StateListeners, &i))) {
- if (svl->name == (const char *) name) break;
- }
- if (!svl) {
- svl = new GPAC_StateVariableListener();
- svl->name = name;
- svl->var = service->m_service->FindStateVariable(name);
- gf_list_add(service->m_StateListeners, svl);
- }
- if (!JSVAL_IS_NULL(svl->on_event))
- gf_js_remove_root(c, &svl->on_event, GF_JSGC_VAL);
- if (JSVAL_IS_NULL(argv[0])) {
- gf_list_del_item(service->m_StateListeners, svl);
- delete svl;
- }
- svl->on_event = argv[0];
- gf_js_add_root(c, &svl->on_event, GF_JSGC_VAL);
- if (!service->subscribed) {
- service->m_device->m_pUPnP->m_pGenericController->m_CtrlPoint->Subscribe(service->m_service);
- service->subscribed = GF_TRUE;
- }
- SMJS_FREE(c, name);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_service_set_action_listener)
-{
- PLT_ActionDesc *action;
- PLT_ArgumentDesc *desc;
- GPAC_ActionArgListener *argl = NULL;
- char *name;
- Bool script_callback = GF_FALSE;
- u32 i;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!service || (argc<2) || !JSVAL_IS_STRING(argv[0]) || !JSVAL_IS_OBJECT(argv[1])) return JS_FALSE;
-
- name = SMJS_CHARS(c, argv[0]);
- if (!name) return JS_FALSE;
-
- action = service->m_service->FindActionDesc(name);
- SMJS_FREE(c, name);
-
- if (!action) return JS_FALSE;
-
- desc = NULL;
- if (argc==3) {
- if (JSVAL_IS_BOOLEAN(argv[2])) {
- script_callback = GF_TRUE;
- } else {
- if (!JSVAL_IS_STRING(argv[2]) ) return JS_FALSE;
- name = SMJS_CHARS(c, argv[2]);
- if (!name) return JS_FALSE;
- desc = action->GetArgumentDesc(name);
- SMJS_FREE(c, name);
- if (!desc) return JS_FALSE;
- }
- }
-
-
- /*action listener*/
- i=0;
- while ((argl = (GPAC_ActionArgListener *)gf_list_enum(service->m_ArgListeners, &i))) {
- if (argl->arg == desc) break;
- argl = NULL;
- }
- if (!argl) {
- argl = new GPAC_ActionArgListener();
- argl->arg = desc;
- gf_list_add(service->m_ArgListeners, argl);
- }
- argl->action = action;
- if (!JSVAL_IS_NULL(argl->on_event))
- gf_js_remove_root(c, &argl->on_event, GF_JSGC_VAL);
- if (JSVAL_IS_NULL(argv[1])) {
- gf_list_del_item(service->m_ArgListeners, argl);
- delete argl;
- }
- argl->on_event = argv[1];
- argl->is_script = script_callback;
- gf_js_add_root(c, &argl->on_event, GF_JSGC_VAL);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_service_get_scpd)
-{
- NPT_String name;
- SMJS_OBJ
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!service )
- return JS_FALSE;
-
- service->m_service->GetSCPDXML(name);
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, name) ) );
- return JS_TRUE;
-}
-
-SMJS_DECL_FUNC_PROP_GET( upnpservice_getProperty)
-{
-#ifdef USE_FFDEV_15
- JSObject *obj = (JSObject *) __hobj;
- jsid id = (jsid) __hid;
-#endif
- char *prop_name;
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!service) return JS_FALSE;
-
- if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
- prop_name = SMJS_CHARS_FROM_STRING(c, SMJS_ID_TO_STRING(id));
- if (!prop_name) return JS_FALSE;
-
- if (!strcmp(prop_name, "Device")) {
- VPASSIGN( OBJECT_TO_JSVAL(service->m_device->obj) );
- }
- else if (!strcmp(prop_name, "ModifiedStateVariablesCount")) {
- VPASSIGN( INT_TO_JSVAL(service->vars ? service->vars->GetItemCount() : 0) );
- }
-
- SMJS_FREE(c, prop_name);
- return JS_TRUE;
-}
-
-
-static JSBool SMJS_FUNCTION(upnp_service_has_var)
-{
- char *name = NULL;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!service || !argc || !JSVAL_IS_STRING(argv[0]) )
- return JS_FALSE;
-
- name = SMJS_CHARS(c, argv[0]);
- SMJS_SET_RVAL( BOOLEAN_TO_JSVAL( (service->m_service->FindStateVariable(name)==NULL) ? JS_FALSE : JS_TRUE ) );
- SMJS_FREE(c, name);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_service_has_action)
-{
- PLT_ActionDesc *action;
- char *name = NULL;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!service || !argc || !JSVAL_IS_STRING(argv[0]) )
- return JS_FALSE;
-
- name = SMJS_CHARS(c, argv[0]);
- action = service->m_service->FindActionDesc(name);
- SMJS_FREE(c, name);
-
- SMJS_SET_RVAL( BOOLEAN_TO_JSVAL(action ? JS_TRUE : JS_FALSE) );
- if (!action) return JS_TRUE;
-
- if ((argc==2) && JSVAL_IS_STRING(argv[1])) {
- name = SMJS_CHARS(c, argv[1]);
- if (action->GetArgumentDesc(name) == NULL) SMJS_SET_RVAL( BOOLEAN_TO_JSVAL(JS_FALSE) );
- SMJS_FREE(c, name);
- }
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_service_call_action)
-{
- GPAC_ActionUDTA *act_udta = NULL;
- char *action_name = NULL;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
- if (!service || !argc || !JSVAL_IS_STRING(argv[0]) ) return JS_FALSE;
-
- action_name = SMJS_CHARS(c, argv[0]);
- PLT_ActionDesc* action_desc = service->m_service->FindActionDesc(action_name);
- SMJS_FREE(c, action_name);
-
- if (action_desc == NULL) return JS_FALSE;
- PLT_ActionReference action;
-
- NPT_CHECK_SEVERE(
- service->m_device->m_pUPnP->m_pGenericController->m_CtrlPoint->CreateAction(
- service->m_device->m_device,
- service->m_service->GetServiceType(),
- action_name,
- action)
- );
-
-
- if ((argc>=2) && JSVAL_IS_OBJECT(argv[1])) {
- JSObject *list = JSVAL_TO_OBJECT(argv[1]);
- u32 i, count;
- JS_GetArrayLength(c, list, (jsuint*) &count);
-
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Calling %s(", action_name));
- i=0;
- while (i+2<=count) {
- NPT_Result res;
- jsval an_arg;
- char *param_val, *_param_val = NULL;
- char szParamVal[1024];
- JS_GetElement(c, list, (jsint) i, &an_arg);
- char *param_name = SMJS_CHARS(c, an_arg);
-
- JS_GetElement(c, list, (jsint) i+1, &an_arg);
-
- param_val = (char*)"";
- if (JSVAL_IS_STRING(an_arg)) {
- param_val = _param_val = SMJS_CHARS(c, an_arg);
- } else if (JSVAL_IS_BOOLEAN(an_arg)) {
- param_val = (char *) ((JSVAL_TO_BOOLEAN(an_arg) == JS_TRUE) ? "true" : "false");
- }
- else if (JSVAL_IS_INT(argv[1])) {
- sprintf(szParamVal, "%d", JSVAL_TO_INT(an_arg));
- param_val = szParamVal;
- }
- else if (JSVAL_IS_NUMBER(an_arg)) {
- jsdouble v;
- JS_ValueToNumber(c, an_arg, &v);
- sprintf(szParamVal, "%g", v);
- param_val = szParamVal;
- }
-
- if (!param_name || !param_val) res = NPT_FAILURE;
- else {
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, (" %s(%s)", param_name, param_val));
- res = action->SetArgumentValue(param_name, param_val);
- }
- SMJS_FREE(c, param_name);
- SMJS_FREE(c, _param_val);
-
- if (res != NPT_SUCCESS) return JS_FALSE;
-
- i+=2;
- }
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, (" )\n"));
- }
-
- if ((argc==3) && JSVAL_IS_OBJECT(argv[2])) {
- act_udta = new GPAC_ActionUDTA();
- act_udta->udta = argv[2];
- gf_js_add_root(c, &act_udta->udta, GF_JSGC_VAL);
- }
- service->m_device->m_pUPnP->m_pGenericController->m_CtrlPoint->InvokeAction(action, act_udta);
- return JS_TRUE;
-}
-
-#endif
-
-void GPAC_DeviceItem::RefreshServiceList()
-{
- u32 i;
- NPT_Array<PLT_Service*> services = m_device->GetServices();
-
- for (i=0; i<services.GetItemCount(); i++) {
- PLT_Service *serv = services[i];
- FindService(serv->GetServiceType());
- }
-}
-
-GPAC_ServiceItem *GPAC_DeviceItem::FindService(const char *type)
-{
- u32 i, count;
- GPAC_ServiceItem *serv;
-
- count = gf_list_count(m_Services);
- for (i=0; i<count; i++) {
- serv = (GPAC_ServiceItem*)gf_list_get(m_Services, i);
- if (serv->m_service->GetServiceType() == type)
- return serv;
- }
-
- PLT_Service *service;
- if (m_device->FindServiceByType(type, service) != NPT_SUCCESS) return NULL;
-
- serv = new GPAC_ServiceItem(this, service);
-
-#ifdef GPAC_HAS_SPIDERMONKEY
- serv->js_ctx = js_ctx;
- serv->obj = JS_NewObject(serv->js_ctx, &m_pUPnP->upnpServiceClass._class, 0, obj);
- gf_js_add_root(serv->js_ctx, &serv->obj, GF_JSGC_OBJECT);
- SMJS_SET_PRIVATE(serv->js_ctx, serv->obj, serv);
- JS_DefineProperty(serv->js_ctx, serv->obj, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(serv->js_ctx, service->GetServiceID()) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(serv->js_ctx, serv->obj, "Type", STRING_TO_JSVAL( JS_NewStringCopyZ(serv->js_ctx, service->GetServiceType()) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(serv->js_ctx, serv->obj, "Hostname", STRING_TO_JSVAL( JS_NewStringCopyZ(serv->js_ctx, m_device->GetURLBase().GetHost() ) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineFunction(serv->js_ctx, serv->obj, "SetStateVariableListener", upnp_service_set_listener, 1, 0);
- JS_DefineFunction(serv->js_ctx, serv->obj, "HasStateVariable", upnp_service_has_var, 1, 0);
- JS_DefineFunction(serv->js_ctx, serv->obj, "HasAction", upnp_service_has_action, 2, 0);
- JS_DefineFunction(serv->js_ctx, serv->obj, "CallAction", upnp_service_call_action, 2, 0);
- JS_DefineFunction(serv->js_ctx, serv->obj, "SetActionListener", upnp_service_set_action_listener, 2, 0);
- JS_DefineFunction(serv->js_ctx, serv->obj, "GetSCPD", upnp_service_get_scpd, 1, 0);
-
-#endif
-
- gf_list_add(m_Services, serv);
- return serv;
-}
-
-
-GPAC_GenericController::GPAC_GenericController(PLT_CtrlPointReference& ctrlPoint, GF_UPnP *upnp)
-{
- m_pUPnP = upnp;
- m_CtrlPoint = ctrlPoint;
- m_CtrlPoint->AddListener(this);
- m_ControlPointLock = gf_mx_new("GenericController");
- m_Devices = gf_list_new();
-}
-
-GPAC_GenericController::~GPAC_GenericController()
-{
- m_CtrlPoint->RemoveListener(this);
- gf_mx_del(m_ControlPointLock);
- while (gf_list_count(m_Devices)) {
- GPAC_DeviceItem*ms = (GPAC_DeviceItem*)gf_list_get(m_Devices, 0);
- gf_list_rem(m_Devices, 0);
- delete ms;
- }
- gf_list_del(m_Devices);
-}
-
-
-
-NPT_Result GPAC_GenericController::OnDeviceAdded(PLT_DeviceDataReference& device)
-{
- GPAC_DeviceItem *item;
- NPT_String uuid = device->GetUUID();
- gf_mx_p(m_ControlPointLock);
-
- u32 i, count = gf_list_count(m_Devices);
- for (i=0; i<count; i++) {
- item = (GPAC_DeviceItem *) gf_list_get(m_Devices, i);
- if (item->m_UUID == uuid ) {
- gf_mx_v(m_ControlPointLock);
- return NPT_SUCCESS;
- }
- }
- item = new GPAC_DeviceItem(device, device->GetUUID() );
- gf_list_add(m_Devices, item );
- m_pUPnP->OnDeviceAdd(item, 1);
- gf_mx_v(m_ControlPointLock);
- return NPT_SUCCESS;
-}
-NPT_Result GPAC_GenericController::OnDeviceRemoved(PLT_DeviceDataReference& device)
-{
- u32 i, count;
- GPAC_DeviceItem *item = NULL;
- NPT_String uuid = device->GetUUID();
- gf_mx_p(m_ControlPointLock);
- count = gf_list_count(m_Devices);
- for (i=0; i<count; i++) {
- item = (GPAC_DeviceItem *) gf_list_get(m_Devices, i);
- if (item->m_UUID == uuid ) {
- gf_list_rem(m_Devices, i);
- break;
- }
- item = NULL;
- }
- if (item) {
- m_pUPnP->OnDeviceAdd(item, 0);
- delete item;
- }
- gf_mx_v(m_ControlPointLock);
- return NPT_SUCCESS;
-}
-
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-
-static JSBool SMJS_FUNCTION(upnp_action_get_argument_value)
-{
- NPT_String res;
- char *arg_name = NULL;
- SMJS_OBJ
- SMJS_ARGS
- PLT_Action *action = (PLT_Action *) SMJS_GET_PRIVATE(c, obj);
- if (!action || !argc || !JSVAL_IS_STRING(argv[0])) return JS_FALSE;
-
- arg_name = SMJS_CHARS(c, argv[0]);
- if (!arg_name) return JS_FALSE;
-
- action->GetArgumentValue(arg_name, res);
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, res) ));
- SMJS_FREE(c, arg_name);
- return JS_TRUE;
-}
-static JSBool SMJS_FUNCTION(upnp_action_get_error_code)
-{
- NPT_String res;
- SMJS_OBJ
- PLT_Action *action = (PLT_Action *) SMJS_GET_PRIVATE(c, obj);
- if (!action ) return JS_FALSE;
- SMJS_SET_RVAL( INT_TO_JSVAL( action->GetErrorCode() ));
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_action_get_error)
-{
- NPT_String res;
- unsigned int code;
- SMJS_OBJ
- PLT_Action *action = (PLT_Action *) SMJS_GET_PRIVATE(c, obj);
- if (!action ) return JS_FALSE;
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, action->GetError( &code ) ) ) );
- return JS_TRUE;
-}
-
-#endif
-
-
-NPT_Result GPAC_GenericController::OnActionResponse(NPT_Result res, PLT_ActionReference& action, void* userdata)
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- u32 i, count;
- GPAC_DeviceItem *item = NULL;
- GPAC_ServiceItem *serv = NULL;
- GPAC_ActionArgListener *argl, *act_l;
- PLT_Service* service = action->GetActionDesc().GetService();
- NPT_String uuid;
- GPAC_ActionUDTA *act_udta = (GPAC_ActionUDTA *)userdata;
-
- /*this is NOT an actionResponse to an action triggered on a generic device*/
- if (act_udta && act_udta->m_Reserved) act_udta = NULL;
-
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Receive %s Response - error code %d\n", (char *) action->GetActionDesc().GetName(), res));
-
- gf_mx_p(m_ControlPointLock);
-
- /*get our device*/
- uuid = service->GetDevice()->GetUUID();
- count = gf_list_count(m_Devices);
- for (i=0; i<count; i++) {
- item = (GPAC_DeviceItem *) gf_list_get(m_Devices, i);
- if (item->m_UUID == uuid ) {
- break;
- }
- item = NULL;
- }
- gf_mx_v(m_ControlPointLock);
-
- if (!item) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_NETWORK, ("[UPnP] Receive %s Response on unknown device (uuid %s)\n", (char *) action->GetActionDesc().GetName(), (char *) uuid));
- goto exit;
- }
- /*get our service*/
- count = gf_list_count(item->m_Services);
- for (i=0; i<count; i++) {
- serv = (GPAC_ServiceItem *)gf_list_get(item->m_Services, i);
- if (serv->m_service == service) break;
- }
- if (!serv) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_NETWORK, ("[UPnP] Receive %s Response on unknown service %s\n", (char *) action->GetActionDesc().GetName(), (char *) service->GetServiceType()));
- goto exit;
- }
-
- /*locate our listeners*/
- act_l = NULL;
- i=0;
- while ((argl = (GPAC_ActionArgListener *)gf_list_enum(serv->m_ArgListeners, &i))) {
- NPT_String value;
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] checking argument %s\n", (char *) argl->action->GetName() ));
- if (argl->action->GetName() != action->GetActionDesc().GetName() ) continue;
-
- /*global action listener*/
- if (argl->arg==NULL) {
- act_l = argl;
- continue;
- }
- /*if error don't trigger listeners*/
- if (res != NPT_SUCCESS) {
- GF_LOG(GF_LOG_WARNING, GF_LOG_NETWORK, ("[UPnP] Receive %s Response: error on remote device %d\n", (char *) action->GetActionDesc().GetName(), res));
- continue;
- }
- /*action arg listener*/
- if (action->GetArgumentValue(argl->arg->GetName(), value) == NPT_SUCCESS) {
- jsval argv[1], rval;
-
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Calling handler for response %s argument %s\n", (char *) action->GetActionDesc().GetName(), (char *) argl->arg->GetName() ));
- m_pUPnP->LockJavascript(GF_TRUE);
- argv[0] = STRING_TO_JSVAL( JS_NewStringCopyZ(serv->js_ctx, value) );
- JS_CallFunctionValue(serv->js_ctx, serv->obj, argl->on_event, 1, argv, &rval);
- m_pUPnP->LockJavascript(GF_FALSE);
- } else {
- GF_LOG(GF_LOG_ERROR, GF_LOG_NETWORK, ("[UPnP] %s Response: couldn't get argument %s value\n", (char *) action->GetActionDesc().GetName(), (char *) argl->arg->GetName() ));
- }
- }
-
- if (act_l) {
- jsval rval;
- m_pUPnP->LockJavascript(GF_TRUE);
- if (act_l->is_script) {
- JSObject *act_obj;
- jsval argv[2];
-
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Calling handler for response %s\n", (char *) action->GetActionDesc().GetName()));
-
- act_obj = JS_NewObject(serv->js_ctx, &item->m_pUPnP->upnpDeviceClass._class, 0, item->obj);
- SMJS_SET_PRIVATE(serv->js_ctx, act_obj, (void *)action.AsPointer() );
- JS_DefineFunction(serv->js_ctx, act_obj, "GetArgumentValue", upnp_action_get_argument_value, 1, 0);
- JS_DefineFunction(serv->js_ctx, act_obj, "GetErrorCode", upnp_action_get_error_code, 1, 0);
- JS_DefineFunction(serv->js_ctx, act_obj, "GetError", upnp_action_get_error, 1, 0);
-
- gf_js_add_root(serv->js_ctx, &act_obj, GF_JSGC_OBJECT);
- argv[0] = OBJECT_TO_JSVAL(act_obj);
- if (act_udta) {
- argv[1] = act_udta->udta;
- JS_CallFunctionValue(serv->js_ctx, serv->obj, act_l->on_event, 2, argv, &rval);
- } else {
- JS_CallFunctionValue(serv->js_ctx, serv->obj, act_l->on_event, 1, argv, &rval);
- }
- gf_js_remove_root(serv->js_ctx, &act_obj, GF_JSGC_OBJECT);
- }
- /*if error don't trigger listeners*/
- else if (res == NPT_SUCCESS) {
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Calling handler for response %s\n", (char *) action->GetActionDesc().GetName()));
- JS_CallFunctionValue(serv->js_ctx, serv->obj, act_l->on_event, 0, 0, &rval);
- }
- else {
- GF_LOG(GF_LOG_ERROR, GF_LOG_NETWORK, ("[UPnP] response %s has error %d\n", (char *) action->GetActionDesc().GetName(), res ));
- }
- m_pUPnP->LockJavascript(GF_FALSE);
- }
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Done processing response %s\n", (char *) action->GetActionDesc().GetName()));
-
-exit:
- if (act_udta) {
- gf_js_remove_root(serv->js_ctx, &act_udta->udta, GF_JSGC_VAL);
- delete act_udta;
- }
-
- return NPT_SUCCESS;
-#else
- return NPT_SUCCESS;
-#endif
-}
-
-NPT_Result GPAC_GenericController::OnEventNotify(PLT_Service* service, NPT_List<PLT_StateVariable*>* vars)
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- u32 i, count;
- GPAC_DeviceItem *item = NULL;
- GPAC_ServiceItem *serv = NULL;
- GPAC_StateVariableListener *svl;
-
- gf_mx_p(m_ControlPointLock);
-
- NPT_String uuid = service->GetDevice()->GetUUID();
- count = gf_list_count(m_Devices);
- for (i=0; i<count; i++) {
- item = (GPAC_DeviceItem *) gf_list_get(m_Devices, i);
- if (item->m_UUID == uuid ) {
- break;
- }
- item = NULL;
- }
- gf_mx_v(m_ControlPointLock);
-
- if (!item) return NPT_SUCCESS;
-
- count = gf_list_count(item->m_Services);
- for (i=0; i<count; i++) {
- serv = (GPAC_ServiceItem *)gf_list_get(item->m_Services, i);
- if (serv->m_service == service) break;
- }
- if (!serv) return NPT_SUCCESS;
-
- if (!JSVAL_IS_NULL(serv->on_event)) {
- jsval rval;
- m_pUPnP->LockJavascript(GF_TRUE);
- serv->vars = vars;
- JS_CallFunctionValue(serv->js_ctx, serv->obj, serv->on_event, 0, 0, &rval);
- m_pUPnP->LockJavascript(GF_FALSE);
- serv->vars = NULL;
- }
-
- i=0;
- while ((svl = (GPAC_StateVariableListener *)gf_list_enum(serv->m_StateListeners, &i))) {
- /*check if we can find our var in this list*/
- if (vars->Contains(svl->var)) {
- jsval argv[1], rval;
- m_pUPnP->LockJavascript(GF_TRUE);
- argv[0] = STRING_TO_JSVAL( JS_NewStringCopyZ(serv->js_ctx, svl->var->GetValue() ) );
- JS_CallFunctionValue(serv->js_ctx, serv->obj, svl->on_event, 1, argv, &rval);
- m_pUPnP->LockJavascript(GF_FALSE);
- }
-
- }
-
-#endif
- return NPT_SUCCESS;
-}
-
-
-GPAC_Service::GPAC_Service(PLT_DeviceData* device, const char *type, const char *id, const char *name, const char *last_change_namespace)
- : PLT_Service(device, type, id, name, last_change_namespace)
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- m_pObj = NULL;
- m_pCtx = NULL;
-#endif
-}
-
-GPAC_Service::~GPAC_Service()
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- if (m_pObj) gf_js_remove_root(m_pCtx, &m_pObj, GF_JSGC_OBJECT);
-#endif
-}
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-
-
-static JSBool SMJS_FUNCTION(upnp_service_set_state_variable)
-{
- char *name, *val;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_Service* service = (GPAC_Service*) SMJS_GET_PRIVATE(c, obj);
- if (!service) return JS_FALSE;
-
- name = SMJS_CHARS(c, argv[0]);
- if (!name) return JS_FALSE;
-
- val = SMJS_CHARS(c, argv[1]);
- if (!val) {
- SMJS_FREE(c, name);
- return JS_FALSE;
- }
-
- service->SetStateVariable(name, val);
- SMJS_FREE(c, name);
- SMJS_FREE(c, val);
- return JS_TRUE;
-}
-
-void GPAC_Service::SetupJS(JSContext *c, GF_UPnP *upnp, JSObject *parent)
-{
- m_pCtx = c;
- m_pObj = JS_NewObject(c, &upnp->upnpDeviceClass._class, 0, parent);
- gf_js_add_root(m_pCtx, &m_pObj, GF_JSGC_OBJECT);
- SMJS_SET_PRIVATE(c, m_pObj, this);
- JS_DefineFunction(c, m_pObj, "SetStateVariable", upnp_service_set_state_variable, 2, 0);
-
-}
-#endif
-
-
-GPAC_GenericDevice::GPAC_GenericDevice(const char* FriendlyName, const char *device_id)
- : PLT_DeviceHost("/", "", device_id ? device_id : "urn:schemas-upnp-org:device:GenericDevice:1", FriendlyName)
-{
- m_pServices = gf_list_new();
-
-#ifdef GPAC_HAS_SPIDERMONKEY
- run_proc = JSVAL_NULL;
- act_proc = JSVAL_NULL;
- obj = NULL;
- js_source = "";
- act_ref = NULL;
- m_pSema = NULL;
- m_pMutex = gf_mx_new("UPnP Generic Device");
-#endif
-}
-
-GPAC_GenericDevice::~GPAC_GenericDevice()
-{
- gf_list_del(m_pServices);
-#ifdef GPAC_HAS_SPIDERMONKEY
- if (m_pSema) gf_sema_del(m_pSema);
- m_pSema = NULL;
- gf_mx_del(m_pMutex);
-#endif
-}
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-void GPAC_GenericDevice::DetachJS(JSContext *c)
-{
- u32 i, count;
- if (obj)
- gf_js_remove_root(c, &obj, GF_JSGC_OBJECT);
- obj = NULL;
- if (!JSVAL_IS_NULL(run_proc))
- gf_js_remove_root(c, &run_proc, GF_JSGC_VAL);
- run_proc = JSVAL_NULL;
- if (!JSVAL_IS_NULL(act_proc))
- gf_js_remove_root(c, &act_proc, GF_JSGC_VAL);
- act_proc = JSVAL_NULL;
-
- count = gf_list_count(m_pServices);
- for (i=0; i<count; i++) {
- GPAC_Service *service = (GPAC_Service*)gf_list_get(m_pServices, i);
- if (service->m_pObj) {
- gf_js_remove_root(c, &service->m_pObj, GF_JSGC_OBJECT);
- service->m_pObj = NULL;
- }
- }
-}
-#endif
-
-NPT_Result
-GPAC_GenericDevice::SetupServices()
-{
- u32 i, count;
- count = gf_list_count(m_pServices);
- for (i=0; i<count; i++) {
- GPAC_Service *service = (GPAC_Service *)gf_list_get(m_pServices, i);
- AddService(service);
- }
- return NPT_SUCCESS;
-}
-
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-static JSBool SMJS_FUNCTION(upnp_action_get_argument)
-{
- char *act_name;
- SMJS_OBJ
- SMJS_ARGS
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
- if (!device || !argc || !JSVAL_IS_STRING(argv[0]) ) return JS_FALSE;
-
- act_name = SMJS_CHARS(c, argv[0]);
- NPT_String value;
-
- if (device->act_ref->GetArgumentValue(act_name, value) != NPT_SUCCESS) return JS_FALSE;
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, value) ));
- SMJS_FREE(c, act_name);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(upnp_action_send_reply)
-{
- SMJS_OBJ
- SMJS_ARGS
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
- if (!device) return JS_FALSE;
-
- if (argc && JSVAL_IS_OBJECT(argv[0]) ) {
- JSObject *list = JSVAL_TO_OBJECT(argv[0]);
- u32 i, count;
- JS_GetArrayLength(c, list, (jsuint*) &count);
-
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Calling response %s(", (char *) device->act_ref->GetActionDesc().GetName()));
- i=0;
- while (i+2<=count) {
- jsval an_arg;
- NPT_Result res;
- char *param_val, *_param_val = NULL;
- char szParamVal[1024];
- JS_GetElement(c, list, (jsint) i, &an_arg);
- char *param_name = SMJS_CHARS(c, an_arg);
-
- JS_GetElement(c, list, (jsint) i+1, &an_arg);
-
- param_val = (char*)"";
- if (JSVAL_IS_STRING(an_arg)) {
- param_val = _param_val = SMJS_CHARS(c, an_arg);
- } else if (JSVAL_IS_BOOLEAN(an_arg)) {
- param_val = (char *) ((JSVAL_TO_BOOLEAN(an_arg) == JS_TRUE) ? "true" : "false");
- }
- else if (JSVAL_IS_INT(argv[1])) {
- sprintf(szParamVal, "%d", JSVAL_TO_INT(an_arg));
- param_val = szParamVal;
- }
- else if (JSVAL_IS_NUMBER(an_arg)) {
- jsdouble v;
- JS_ValueToNumber(c, an_arg, &v);
- sprintf(szParamVal, "%g", v);
- param_val = szParamVal;
- }
-
- if (!param_name || !param_val) res = NPT_FAILURE;
- else {
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, (" %s(%s)", param_name, param_val));
-
- res = device->act_ref->SetArgumentValue(param_name, param_val);
- }
- SMJS_FREE(c, param_name);
- SMJS_FREE(c, _param_val);
- if (res != NPT_SUCCESS) return JS_FALSE;
- i+=2;
- }
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, (" )\n"));
- }
-
- //notify we are ready
- if (device->m_pSema) {
- gf_sema_notify(device->m_pSema, 1);
- }
- return JS_TRUE;
-}
-#endif
-
-
-NPT_Result
-GPAC_GenericDevice::OnAction(PLT_ActionReference& action,
- const PLT_HttpRequestContext& context)
-{
- NPT_COMPILER_UNUSED(context);
-
-#ifdef GPAC_HAS_SPIDERMONKEY
- gf_mx_p(m_pMutex);
-#endif
- PLT_ActionDesc &act_desc = action->GetActionDesc();
- NPT_String name = act_desc.GetName();
-#ifdef GPAC_HAS_SPIDERMONKEY
- assert(!m_pSema);
-#endif
- GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Action %s called (thread %d)\n", (char *) name, gf_th_id() ));
-
-#ifdef GPAC_HAS_SPIDERMONKEY
- if (JSVAL_IS_NULL(act_proc)) {
- gf_mx_v(m_pMutex);
- return NPT_SUCCESS;
- }
-
- jsval argv[2];
-
- m_pUPnP->LockJavascript(GF_TRUE);
-
- JSObject *js_action = JS_NewObject(m_pUPnP->m_pJSCtx, &m_pUPnP->upnpDeviceClass._class, 0, 0);
- argv[0] = OBJECT_TO_JSVAL(js_action);
- SMJS_SET_PRIVATE(m_pUPnP->m_pJSCtx, js_action, this);
-
- act_ref = action;
-
- JS_DefineProperty(m_pUPnP->m_pJSCtx, js_action, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(m_pUPnP->m_pJSCtx, name) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- GPAC_Service *service = (GPAC_Service *) act_desc.GetService();
- JS_DefineProperty(m_pUPnP->m_pJSCtx, js_action, "Service", service->m_pObj ? OBJECT_TO_JSVAL( service->m_pObj) : JSVAL_NULL, 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineFunction(m_pUPnP->m_pJSCtx, js_action, "GetArgument", upnp_action_get_argument, 1, 0);
- JS_DefineFunction(m_pUPnP->m_pJSCtx, js_action, "SendReply", upnp_action_send_reply, 1, 0);
-
- /*create a semaphore*/
- m_pSema = gf_sema_new(1, 0);
-
- jsval rval;
- JS_CallFunctionValue(m_pUPnP->m_pJSCtx, obj, act_proc, 1, argv, &rval);
- SMJS_SET_PRIVATE(m_pUPnP->m_pJSCtx, js_action, NULL);
- m_pUPnP->LockJavascript(GF_FALSE);
-
- if (JSVAL_IS_INT(rval) && (JSVAL_TO_INT(rval) != 0)) {
- action->SetError(JSVAL_TO_INT(rval), "Action Failed");
- }
- /*wait on the semaphore*/
- if (!gf_sema_wait_for(m_pSema, 10000)) {
- GF_LOG(GF_LOG_WARNING, GF_LOG_NETWORK, ("[UPnP] Reply processing to action %s timeout - sending incomplete reply)\n", (char *) name));
- }
- gf_sema_del(m_pSema);
- m_pSema = NULL;
-
- gf_mx_v(m_pMutex);
-#endif
- return NPT_SUCCESS;
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Platinum UPnP module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * ----------------------------------------------------------------------------------
- * PLATINUM IS LICENSED UNDER GPL or commercial agreement - cf platinum license
- * ----------------------------------------------------------------------------------
- *
- */
-
-
-#ifndef _GPAC_GENERIC_DEVICE_H_
-#define _GPAC_GENERIC_DEVICE_H_
-
-#include "Neptune.h"
-#include "PltCtrlPoint.h"
-#include "PltDeviceHost.h"
-#include "PltService.h"
-
-#include <gpac/thread.h>
-#include <gpac/list.h>
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-#include <gpac/internal/scenegraph_dev.h>
-#include <gpac/internal/smjs_api.h>
-#endif
-
-class GF_UPnP;
-class GPAC_ServiceItem;
-
-class GPAC_DeviceItem
-{
-public:
- GPAC_DeviceItem(PLT_DeviceDataReference device, NPT_String uuid);
- ~GPAC_DeviceItem();
-
- PLT_DeviceDataReference m_device;
- NPT_String m_UUID;
- GF_UPnP *m_pUPnP;
-
- GPAC_ServiceItem *FindService(const char *type);
- void RefreshServiceList();
-
- GF_List *m_Services;
-#ifdef GPAC_HAS_SPIDERMONKEY
- void DetachJS();
- JSObject *obj;
- JSContext *js_ctx;
-#endif
-};
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-class GPAC_StateVariableListener
-{
-public:
- GPAC_StateVariableListener() {
- on_event = JSVAL_NULL;
- name = "";
- var = NULL;
- }
- NPT_String name;
- jsval on_event;
- PLT_StateVariable *var;
-};
-
-
-class GPAC_ActionArgListener
-{
-public:
- GPAC_ActionArgListener() {
- on_event = JSVAL_NULL;
- arg = NULL;
- action = NULL;
- }
- jsval on_event;
- PLT_ActionDesc *action;
- PLT_ArgumentDesc *arg;
- Bool is_script;
-};
-
-class GPAC_ActionUDTA
-{
-public:
- GPAC_ActionUDTA() {
- m_Reserved = NULL;
- udta = JSVAL_NULL;
- }
- /*members*/
-
- /*this is used to differentiate browse request from JS (using BrowseDataReference)
- as used in GPAC_MediaController and actionResponse used by the generic controller*/
- void *m_Reserved;
- jsval udta;
-};
-
-#endif
-
-
-class GPAC_ServiceItem
-{
-public:
- GPAC_ServiceItem(GPAC_DeviceItem *device, PLT_Service *service);
- ~GPAC_ServiceItem();
-
-
- GPAC_DeviceItem *m_device;
- PLT_Service *m_service;
-
- NPT_List<PLT_StateVariable*>*vars;
-
-#ifdef GPAC_HAS_SPIDERMONKEY
- void DetachJS();
- JSObject *obj;
- jsval on_event;
- JSContext *js_ctx;
- GF_List *m_StateListeners;
- GF_List *m_ArgListeners;
- Bool subscribed;
-#endif
-
-};
-
-
-class GPAC_GenericController : public PLT_CtrlPointListener
-{
-public:
- GPAC_GenericController(PLT_CtrlPointReference& ctrlPoint, GF_UPnP *upnp);
- ~GPAC_GenericController();
-
- /*any device control point*/
- virtual NPT_Result OnDeviceAdded(PLT_DeviceDataReference& device);
- virtual NPT_Result OnDeviceRemoved(PLT_DeviceDataReference& device);
- virtual NPT_Result OnActionResponse(NPT_Result res, PLT_ActionReference& action, void* userdata);
- virtual NPT_Result OnEventNotify(PLT_Service* service, NPT_List<PLT_StateVariable*>* vars);
-
- GF_List *m_Devices;
- GF_UPnP *m_pUPnP;
- PLT_CtrlPointReference m_CtrlPoint;
- GF_Mutex *m_ControlPointLock;
-};
-
-
-class GPAC_GenericDevice : public PLT_DeviceHost
-{
-public:
- GPAC_GenericDevice(const char* FriendlyName, const char *device_id);
- virtual ~GPAC_GenericDevice();
-
-protected:
- // PLT_DeviceHost methods
- virtual NPT_Result SetupServices();
- virtual NPT_Result OnAction(PLT_ActionReference& action,
- const PLT_HttpRequestContext& context);
-public:
- GF_UPnP *m_pUPnP;
- GF_List *m_pServices;
-
-#ifdef GPAC_HAS_SPIDERMONKEY
- void DetachJS(JSContext *c);
- jsval run_proc;
- jsval act_proc;
- JSObject *obj;
- NPT_String js_source;
- PLT_ActionReference act_ref;
- GF_Semaphore *m_pSema;
- GF_Mutex *m_pMutex;
-#endif
-};
-
-class GPAC_Service : public PLT_Service
-{
-public:
- GPAC_Service(PLT_DeviceData* device, const char* type = NULL, const char* id = NULL, const char* name = NULL, const char* last_change_namespace = NULL);
- ~GPAC_Service();
-
-#ifdef GPAC_HAS_SPIDERMONKEY
- void SetupJS(JSContext *c, GF_UPnP *upnp, JSObject *parent);
- JSObject *m_pObj;
- JSContext *m_pCtx;
- jsval on_action;
-#endif
-
-};
-
-
-
-#endif //_GPAC_GENERIC_DEVICE_H_
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/platinum
-
-CFLAGS= $(CXXFLAGS) -I"$(SRC_PATH)/include" -I$(SRC_PATH)/extra_lib/include/platinum/ -DGPAC_HAVE_CONFIG_H -I../..
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-LINKLIBS= -lgpac -lPlatinum -lPltMediaServer -lPltMediaConnect -lPltMediaRenderer -lNeptune -lZlib -lpthread -laxTLS
-LOCAL_LIB=../../bin/gcc -L../../extra_lib/lib/gcc
-
-#common objects
-OBJS=GPACFileMediaServer.o GPACMediaController.o GPACMediaRenderer.o GenericDevice.o GPACPlatinum.o
-
-ifeq ($(CONFIG_JS),no)
-else
-CFLAGS+= $(JS_FLAGS)
-ifeq ($(CONFIG_JS),local)
-NEED_LOCAL_LIB=yes
-LOCAL_LIB+=-L../../extra_lib/lib/gcc
-else
-LINKLIBS+= $(JS_LIBS)
-endif
-endif
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_platinum$(DYN_LIB_SUFFIX)
-ifeq ($(CONFIG_WIN32),yes)
-#LDFLAGS+=-export-symbols platinum.def
-LINKLIBS+= -lwsock32 -lws2_32 -static-libstdc++ -static-libgcc
-endif
-
-ifeq ($(CONFIG_DARWIN),yes)
-LDFLAGS+=-framework Foundation
-endif
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CXX) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L$(LOCAL_LIB) $(LINKLIBS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CXX) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/psvr
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-LINKLIBS= -lgpac -lhidapi-hidraw
-LOCAL_LIB=../../bin/gcc
-
-#common objects
-OBJS=psvr.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_psvr$(DYN_LIB_SUFFIX)
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L$(LOCAL_LIB) $(LINKLIBS) $(LDFLAGS)
-
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2011-2012
- * All rights reserved
- *
- * This file is part of GPAC / PSVR input sub-project
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <gpac/modules/term_ext.h>
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/compositor_dev.h>
-#include <gpac/nodes_mpeg4.h>
-
-#include <hidapi/hidapi.h>
-
-typedef struct
-{
- GF_ObjectManager *odm;
- GF_Terminal *term;
- GF_Thread *th;
- Bool do_run;
- void * device;
-
- Float yaw, pitch, roll;
- GF_TermEventFilter evt_filter;
- Bool reset_mx;
- Bool is_active;
-} GF_PSVR;
-
-#define PSVR_VENDOR_ID 0x054c
-#define PSVR_PRODUCT_ID 0x09af
-
-#define ACCELERATION_COEF 0.00003125f * GF_PI / 180
-
-static s16 read_s16(unsigned char *buffer, int offset)
-{
- int16_t v;
- v = buffer[offset];
- v |= buffer[offset+1] << 8;
- return v;
-}
-
-Bool psvr_on_event(void *udta, GF_Event *event, Bool consumed_by_compositor)
-{
- GF_PSVR *psvr = (GF_PSVR *)udta;
- if (event->type==GF_EVENT_KEYDOWN) {
- if (event->key.key_code==GF_KEY_HOME) {
- psvr->reset_mx = GF_TRUE;
- }
- }
- else if (event->type==GF_EVENT_SENSOR_REQUEST) {
- if (event->activate_sensor.sensor_type==GF_EVENT_SENSOR_ORIENTATION) {
- psvr->is_active = event->activate_sensor.activate;
- return GF_TRUE;
- }
- }
- return GF_FALSE;
-}
-
-static u32 psvr_run(void *__psvr)
-{
- GF_PSVR *psvr = (GF_PSVR *)__psvr;
-
- hid_init();
-
- psvr->device = hid_open(PSVR_VENDOR_ID, PSVR_PRODUCT_ID, 0);
- if(!psvr->device) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[PSVR] Failed to open PSVR HID device\n"));
- return 0;
- }
-
- psvr->evt_filter.udta = psvr;
- psvr->evt_filter.on_event = psvr_on_event;
- gf_term_add_event_filter(psvr->term, &psvr->evt_filter);
-
- psvr->is_active = GF_TRUE;
- psvr->do_run = GF_TRUE;
- while (psvr->do_run && psvr->device) {
- unsigned char buffer[64];
- //read device with 1 ms timeout
- int size = hid_read_timeout(psvr->device, buffer, 64, 1);
-
- if (size == 64) {
- GF_Event evt;
- s32 x_acc = read_s16(buffer, 20) + read_s16(buffer, 36);
- s32 y_acc = read_s16(buffer, 22) + read_s16(buffer, 38);
- s32 z_acc = read_s16(buffer, 24) + read_s16(buffer, 40);
-
- if (psvr->reset_mx) {
- psvr->reset_mx = 0;
- psvr->yaw = psvr->pitch = psvr->roll = 0;
- }
-
- psvr->roll += -y_acc * ACCELERATION_COEF;
- psvr->yaw += x_acc * ACCELERATION_COEF;
- psvr->pitch += z_acc * ACCELERATION_COEF;
-
- if (!psvr->is_active ) continue;
-
- //post our event
- memset(&evt, 0, sizeof(GF_Event));
- evt.type = GF_EVENT_SENSOR_ORIENTATION;
- evt.sensor.x = psvr->yaw - GF_PI;
- evt.sensor.y = psvr->pitch;
- evt.sensor.z = GF_PI2 - psvr->roll;
- evt.sensor.w = 0;
-
- gf_term_user_event(psvr->term, &evt);
- }
- }
- if (psvr->device) {
- hid_close(psvr->device);
- psvr->device = 0;
- }
- gf_term_remove_event_filter(psvr->term, &psvr->evt_filter);
- psvr->term = NULL;
- hid_exit();
- return 0;
-}
-
-static Bool psvr_process(GF_TermExt *termext, u32 action, void *param)
-{
- const char *opt;
- GF_PSVR *psvr = termext->udta;
-
- switch (action) {
- case GF_TERM_EXT_START:
- psvr->term = (GF_Terminal *) param;
- opt = gf_opts_get_key("PSVR", "Enabled");
- if (!opt || strcmp(opt, "yes")) return 0;
-
- gf_th_run(psvr->th, psvr_run, psvr);
- return 1;
-
- case GF_TERM_EXT_STOP:
- psvr->do_run = GF_FALSE;
- break;
- }
- return 0;
-}
-
-
-GF_TermExt *psvr_new()
-{
- GF_TermExt *dr;
- GF_PSVR *psvr;
- dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));
- memset(dr, 0, sizeof(GF_TermExt));
- GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "PSVR Input", "gpac distribution");
-
- GF_SAFEALLOC(psvr, GF_PSVR);
- dr->process = psvr_process;
- dr->udta = psvr;
- psvr->th = gf_th_new("PSVR");
-
- return dr;
-}
-
-
-void psvr_delete(GF_BaseInterface *ifce)
-{
- GF_TermExt *dr = (GF_TermExt *) ifce;
- GF_PSVR *psvr= dr->udta;
- gf_th_del(psvr->th);
- gf_free(psvr);
- gf_free(dr);
-}
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_TERM_EXT_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_TERM_EXT_INTERFACE) return (GF_BaseInterface *)psvr_new();
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- switch (ifce->InterfaceType) {
- case GF_TERM_EXT_INTERFACE:
- psvr_delete(ifce);
- break;
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( psvr )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/rvc_dec
-
-CFLAGS= $(OPTFLAGS) -I$(SRC_PATH)/include
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-EXTRALIBS+=-lRVCDecoder
-
-#common obj
-OBJS= rvc_dec.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_rvc_dec$(DYN_LIB_SUFFIX)
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac $(LDFLAGS)
-
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2010-2012
- * All rights reserved
- *
- * This file is part of GPAC / OpenSVC Decoder module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <gpac/modules/codec.h>
-#include <gpac/avparse.h>
-#include <gpac/constants.h>
-
-#ifdef WIN32
-#define DllImport __declspec( dllimport )
-
-
-#if !defined(__GNUC__)
-# pragma comment(lib, "RVCDecoder")
-#endif
-
-#else
-#define DllImport
-#endif
-
-
-
-typedef struct {
- int Width;
- int Height;
- unsigned char* pY[1];
- unsigned char* pU[1];
- unsigned char* pV[1];
-} RVCFRAME;
-
-
-DllImport int rvc_init(char* XDF, char* VTLFolder, int isAVCFile);
-DllImport int rvc_decode(unsigned char* nal, int nal_length, char *outBuffer, int newBuffer);
-DllImport void rvc_close();
-
-
-typedef struct
-{
- u16 ES_ID;
- u32 width, stride, height, out_size, pixel_ar, layer;
- Bool first_frame;
-
- u32 nalu_size_length;
-
- void *codec;
-} RVCDec;
-
-
-static GF_Err RVCD_AttachStream(GF_BaseDecoder *ifcg, GF_ESD *esd)
-{
- u32 i, count;
- s32 res;
- char Picture;
- RVCDec *ctx = (RVCDec*) ifcg->privateStack;
- char* VTLFolder;
- char *XDF_doc = NULL;
- int isNALUFile;
-
- /*not supported in this version*/
- if (esd->dependsOnESID) return GF_NOT_SUPPORTED;
-
- ctx->ES_ID = esd->ESID;
- ctx->width = ctx->height = ctx->out_size = 0;
-
- VTLFolder = (char *)gf_opts_get_key("RVCDecoder", "VTLPath");
- if (!VTLFolder) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[RVC Decoder] Cannot locate VTL: path is unknown. Please indicate path in GPAC config file:\n[RVCDecoder]\nVTLPath=PATH\n"));
- return GF_SERVICE_ERROR;
- } else {
- GF_LOG(GF_LOG_INFO, GF_LOG_CODEC, ("[RVC Decoder] Using VTL in %s\n", VTLFolder));
- }
-
- /*initialize RVC*/
- if (esd->decoderConfig->predefined_rvc_config) {
- char opt[100], *path;
- FILE *f;
- u32 size;
- sprintf(opt, "Predefined_%d", esd->decoderConfig->predefined_rvc_config);
- path = (char *) gf_opts_get_key("RVCDecoder", (const char *)opt);
- if (!opt) return GF_NOT_SUPPORTED;
- f = gf_fopen(path, "rt");
- if (!f) return GF_NOT_SUPPORTED;
- fseek(f, 0, SEEK_END);
- size = ftell(f);
- fseek(f, 0, SEEK_SET);
- XDF_doc = gf_malloc(sizeof(char)*(size+1));
- if (!XDF_doc) {
- gf_fclose(f);
- return GF_OUT_OF_MEM;
- }
- fread(XDF_doc, 1, size, f);
- gf_fclose(f);
- XDF_doc[size]=0;
- } else {
- if (!esd->decoderConfig->rvc_config)
- return GF_NOT_SUPPORTED;
- XDF_doc = esd->decoderConfig->rvc_config->data;
- }
-
-
- switch (esd->decoderConfig->objectTypeIndication) {
- case GPAC_OTI_VIDEO_AVC:
- case GPAC_OTI_VIDEO_SVC:
- case GPAC_OTI_VIDEO_HEVC:
- case GPAC_OTI_VIDEO_SHVC:
- isNALUFile = 1;
- break;
- default:
- isNALUFile = 0;
- break;
- }
-
- rvc_init(XDF_doc, VTLFolder, isNALUFile); //->data contains the uncompressed XDF
-
- /*free data*/
- gf_free(XDF_doc);
- if (esd->decoderConfig->rvc_config) {
- esd->decoderConfig->rvc_config->data = NULL;
- esd->decoderConfig->rvc_config->dataLength = 0;
- }
-
- /*decoder config not known, output buffers will be reconfigured at run-time*/
- if (!esd->decoderConfig->decoderSpecificInfo || !esd->decoderConfig->decoderSpecificInfo->data)
- return GF_OK;
-
- /*initialize the decoder */
- if ( (esd->decoderConfig->objectTypeIndication==GPAC_OTI_VIDEO_AVC) || (esd->decoderConfig->objectTypeIndication==GPAC_OTI_VIDEO_SVC)) {
- GF_AVCConfig *cfg = gf_odf_avc_cfg_read(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength);
- if (!cfg) return GF_NON_COMPLIANT_BITSTREAM;
- ctx->nalu_size_length = cfg->nal_unit_size;
-
- /*decode all NALUs*/
- count = gf_list_count(cfg->sequenceParameterSets);
- for (i=0; i<count; i++) {
- u32 w, h, par_n, par_d;
- GF_AVCConfigSlot *slc = gf_list_get(cfg->sequenceParameterSets, i);
-
- gf_avc_get_sps_info(slc->data, slc->size, &slc->id, &w, &h, &par_n, &par_d);
- /*by default use the base layer*/
- if (!i) {
- if ((ctx->width<w) || (ctx->height<h)) {
- ctx->width = w;
- ctx->height = h;
- if ( ((s32)par_n>0) && ((s32)par_d>0) )
- ctx->pixel_ar = (par_n<<16) || par_d;
- }
- }
-
- /* call decode*/
- res = rvc_decode(slc->data, slc->size, &Picture, 1);
- if (res<0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[RVC Decoder] Error decoding SPS %d\n", res));
- }
- }
-
- count = gf_list_count(cfg->pictureParameterSets);
- for (i=0; i<count; i++) {
- GF_AVCConfigSlot *slc = gf_list_get(cfg->pictureParameterSets, i);
- res = rvc_decode(slc->data, slc->size, &Picture, 1);
- if (res<0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[RVC Decoder] Error decoding PPS %d\n", res));
- }
-
- }
-
- gf_odf_avc_cfg_del(cfg);
- /*initialize the decoder */
- } else if ( (esd->decoderConfig->objectTypeIndication==GPAC_OTI_VIDEO_HEVC) || (esd->decoderConfig->objectTypeIndication==GPAC_OTI_VIDEO_SHVC)) {
- GF_HEVCConfig *cfg = gf_odf_hevc_cfg_read(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, 0);
- if (!cfg) return GF_NON_COMPLIANT_BITSTREAM;
- ctx->nalu_size_length = cfg->nal_unit_size;
-
- /*decode all NALUs*/
- count = gf_list_count(cfg->param_array);
- for (i=0; i<count; i++) {
- u32 j, count2;
- GF_HEVCParamArray *ar = gf_list_get(cfg->param_array, i);
- count2 = gf_list_count(ar->nalus);
- for (j=0; j<count2; j++) {
- u32 w, h, par_n, par_d;
- GF_AVCConfigSlot *slc = gf_list_get(ar->nalus, j);
-
- if (ar->type==GF_HEVC_NALU_SEQ_PARAM) {
- gf_hevc_get_sps_info(slc->data, slc->size, &slc->id, &w, &h, &par_n, &par_d);
- /*by default use the base layer*/
- if (!j) {
- if ((ctx->width<w) || (ctx->height<h)) {
- ctx->width = w;
- ctx->height = h;
- if ( ((s32)par_n>0) && ((s32)par_d>0) )
- ctx->pixel_ar = (par_n<<16) || par_d;
- }
- }
- }
-
- /* call decode*/
- res = rvc_decode(slc->data, slc->size, &Picture, 1);
- if (res<0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[RVC Decoder] Error decoding parameter set: %d\n", res));
- }
- }
- }
-
- gf_odf_hevc_cfg_del(cfg);
- } else if (esd->decoderConfig->objectTypeIndication==GPAC_OTI_VIDEO_MPEG4_PART2) {
- GF_M4VDecSpecInfo dsi;
- GF_Err e;
- /*decode DSI*/
- e = gf_m4v_get_config(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, &dsi);
- if (e) return e;
- if (!dsi.width || !dsi.height) return GF_NON_COMPLIANT_BITSTREAM;
- ctx->width = dsi.width;
- ctx->height = dsi.height;
- ctx->pixel_ar = (dsi.par_num<<16) | dsi.par_den;
-
-
- res = rvc_decode(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, &Picture, 1);
- if (res<0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[RVC Decoder] Error decoding PPS %d\n", res));
- }
-
-
- } else {
- /*unknown type, do what you want*/
-
- res = rvc_decode(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, &Picture, 1);
- if (res<0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[RVC Decoder] Error decoding PPS %d\n", res));
- }
-
- }
- /*adjust stride to what you decoder uses*/
- ctx->stride = ctx->width;
- /*precompute output buffer size*/
- ctx->out_size = ctx->stride * ctx->height * 3 / 2;
- return GF_OK;
-}
-static GF_Err RVCD_DetachStream(GF_BaseDecoder *ifcg, u16 ES_ID)
-{
- RVCDec *ctx = (RVCDec*) ifcg->privateStack;
-
- //close RVC decoder
- rvc_close();
- ctx->codec = NULL;
- ctx->width = ctx->height = ctx->out_size = 0;
- return GF_OK;
-}
-static GF_Err RVCD_GetCapabilities(GF_BaseDecoder *ifcg, GF_CodecCapability *capability)
-{
- RVCDec *ctx = (RVCDec*) ifcg->privateStack;
-
- switch (capability->CapCode) {
- case GF_CODEC_RESILIENT:
- capability->cap.valueInt = 1;
- break;
- case GF_CODEC_WIDTH:
- capability->cap.valueInt = ctx->width;
- break;
- case GF_CODEC_HEIGHT:
- capability->cap.valueInt = ctx->height;
- break;
- case GF_CODEC_STRIDE:
- capability->cap.valueInt = ctx->stride;
- break;
- case GF_CODEC_PAR:
- capability->cap.valueInt = ctx->pixel_ar;
- break;
- case GF_CODEC_OUTPUT_SIZE:
- capability->cap.valueInt = ctx->out_size;
- break;
- case GF_CODEC_PIXEL_FORMAT:
- capability->cap.valueInt = GF_PIXEL_YV12;
- break;
- case GF_CODEC_BUFFER_MIN:
- capability->cap.valueInt = 1;
- break;
- case GF_CODEC_BUFFER_MAX:
- capability->cap.valueInt = 2;
- break;
- case GF_CODEC_PADDING_BYTES:
- capability->cap.valueInt = 32;
- break;
- case GF_CODEC_REORDER:
- capability->cap.valueInt = 1;
- break;
- /*not known at our level...*/
- case GF_CODEC_CU_DURATION:
- default:
- capability->cap.valueInt = 0;
- break;
- }
- return GF_OK;
-}
-static GF_Err RVCD_SetCapabilities(GF_BaseDecoder *ifcg, GF_CodecCapability capability)
-{
- return GF_NOT_SUPPORTED;
-}
-
-
-int bookmark = 0;
-
-static GF_Err RVCD_ProcessData(GF_MediaDecoder *ifcg,
- char *inBuffer, u32 inBufferLength,
- u16 ES_ID, u32 *CTS,
- char *outBuffer, u32 *outBufferLength,
- u8 PaddingBits, u32 mmlevel)
-{
- s32 got_pic;
- RVCDec *ctx = (RVCDec*) ifcg->privateStack;
-
- if (!ES_ID || (ES_ID!=ctx->ES_ID) /*|| !ctx->codec*/) {
- *outBufferLength = 0;
- return GF_OK;
- }
- if (*outBufferLength < ctx->out_size) {
- *outBufferLength = ctx->out_size;
- return GF_BUFFER_TOO_SMALL;
- }
-
- //if your decoder outputs directly in the memory passed, setup pointers for your decoder output picture
-
- got_pic = 0;
-
- if (ctx->nalu_size_length) {
- u32 i, nalu_size = 0;
- u8 *ptr = inBuffer;
- int nalNumber = 1;
-
- while (inBufferLength) {
- for (i=0; i<ctx->nalu_size_length; i++) {
- nalu_size = (nalu_size<<8) + ptr[i];
- }
- ptr += ctx->nalu_size_length;
-
- //same remark as above regardin start codes
-
- if(nalNumber > bookmark) {
- got_pic = rvc_decode(ptr, nalu_size, outBuffer, !got_pic);
- bookmark ++;
- if(got_pic>1) {
- return GF_PACKED_FRAMES;
- }
- } else if(nalNumber == bookmark) {
- got_pic = rvc_decode(NULL, 0, outBuffer, !got_pic);
- if(got_pic>1) {
- return GF_PACKED_FRAMES;
- }
- }
- nalNumber ++;
-
- ptr += nalu_size;
- if (inBufferLength < nalu_size + ctx->nalu_size_length)
- break;
-
- inBufferLength -= nalu_size + ctx->nalu_size_length;
- }
- bookmark = 0;
-
- } else {
- u32 nalu_size = 0;
- u8 *ptr = inBuffer;
-
-
- got_pic = rvc_decode(ptr, inBufferLength, outBuffer, 1);
- }
-
- //if (got_pic!=1) return GF_OK;
-
- /*if size changed during the decoding, resize the composition buffer*/
- /*if ((pic.Width != ctx->width) || (pic.Height!=ctx->height))
- {
- ctx->width = pic.Width;
- ctx->stride = pic.Width;
- ctx->height = pic.Height;
- ctx->out_size = ctx->stride * ctx->height * 3 / 2;
- *outBufferLength = ctx->out_size;
- return GF_BUFFER_TOO_SMALL;
- }
-
- *outBufferLength = ctx->out_size;*/
-
- /*if your decoder does not output directly in the memory passed, copy over the data*/
-
- /*memcpy(outBuffer, pic.pY[0], ctx->stride*ctx->height);
- memcpy(outBuffer + ctx->stride * ctx->height, pic.pU[0], ctx->stride*ctx->height/4);
- memcpy(outBuffer + 5*ctx->stride * ctx->height/4, pic.pV[0], ctx->stride*ctx->height/4);*/
-
- if(got_pic>1) return GF_PACKED_FRAMES;
- return GF_OK;
-}
-
-static u32 RVCD_CanHandleStream(GF_BaseDecoder *dec, u32 StreamType, GF_ESD *esd, u8 PL)
-{
- if (StreamType != GF_STREAM_VISUAL) return GF_CODEC_NOT_SUPPORTED;
- /*media type query*/
- if (!esd) return GF_CODEC_STREAM_TYPE_SUPPORTED;
- switch (esd->decoderConfig->objectTypeIndication) {
- case GPAC_OTI_VIDEO_AVC:
- case GPAC_OTI_VIDEO_SVC:
- case GPAC_OTI_VIDEO_MPEG4_PART2:
- case GPAC_OTI_VIDEO_HEVC:
- case GPAC_OTI_VIDEO_SHVC:
- if (!esd->decoderConfig->rvc_config && !esd->decoderConfig->predefined_rvc_config) return GF_CODEC_NOT_SUPPORTED;
- return GF_CODEC_SUPPORTED+1;
- }
- return GF_CODEC_NOT_SUPPORTED;
-}
-
-static const char *RVCD_GetCodecName(GF_BaseDecoder *dec)
-{
- return "Reconfigurable Video Decoder";
-}
-
-GF_BaseDecoder *NewRVCDec()
-{
- GF_MediaDecoder *ifcd;
- RVCDec *dec;
-
- GF_SAFEALLOC(ifcd, GF_MediaDecoder);
- GF_SAFEALLOC(dec, RVCDec);
- GF_REGISTER_MODULE_INTERFACE(ifcd, GF_MEDIA_DECODER_INTERFACE, "RVC Decoder", "gpac distribution")
-
- ifcd->privateStack = dec;
-
- /*setup our own interface*/
- ifcd->AttachStream = RVCD_AttachStream;
- ifcd->DetachStream = RVCD_DetachStream;
- ifcd->GetCapabilities = RVCD_GetCapabilities;
- ifcd->SetCapabilities = RVCD_SetCapabilities;
- ifcd->GetName = RVCD_GetCodecName;
- ifcd->CanHandleStream = RVCD_CanHandleStream;
- ifcd->ProcessData = RVCD_ProcessData;
- return (GF_BaseDecoder *) ifcd;
-}
-
-void DeleteRVCDec(GF_BaseDecoder *ifcg)
-{
- RVCDec *ctx = (RVCDec*) ifcg->privateStack;
- gf_free(ctx);
- gf_free(ifcg);
-}
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
-#ifndef GPAC_DISABLE_AV_PARSERS
- GF_MEDIA_DECODER_INTERFACE,
-#endif
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
-#ifndef GPAC_DISABLE_AV_PARSERS
- if (InterfaceType == GF_MEDIA_DECODER_INTERFACE) return (GF_BaseInterface *)NewRVCDec();
-#endif
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- switch (ifce->InterfaceType) {
-#ifndef GPAC_DISABLE_AV_PARSERS
- case GF_MEDIA_DECODER_INTERFACE:
- DeleteRVCDec((GF_BaseDecoder*)ifce);
- break;
-#endif
- }
-}
-
-
-GPAC_MODULE_STATIC_DECLARATION( rev_dec )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/ui_rec
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-LINKLIBS= -lgpac
-LOCAL_LIB=../../bin/gcc
-
-#common objects
-OBJS=ui_rec.o
-
-
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_ui_rec$(DYN_LIB_SUFFIX)
-ifeq ($(CONFIG_WIN32),yes)
-#LDFLAGS+=-export-symbols ui_rec.def
-endif
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L$(LOCAL_LIB) $(LINKLIBS) $(LDFLAGS)
-
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-This is a UI recorder module for the GPAC framework. This module allows recording and playback of user events (mouse and keyboard).
-
-To use this module:
-- The variable "Mode" in the section [UIRecord] has to be set to one of the following values
- * "Disable": module is disabled
- * "Record": module will record user interaction
- * "Play": module will play user interaction
-
-The module is designed to work with one scene, events are recorded according to the scene time of the event dispatch.
-The events are recorded/read from a file, which is indicated by the variable "File" of the [UIRecord] section.
-Note that the module will automatically set the mode to "Disabled" when closing the player.
-
-This module has been successfully tested under Win32 and Linux
-
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2007-2012
- * All rights reserved
- *
- * This file is part of GPAC / User Event Recorder sub-project
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*base SVG type*/
-#include <gpac/modules/term_ext.h>
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/compositor_dev.h>
-
-
-typedef struct __ui_rec
-{
- FILE *uif;
- GF_BitStream *bs;
- GF_Terminal *term;
- GF_Clock *ck;
-
- GF_Event next_event;
- u32 next_time;
- Bool evt_loaded;
-
- GF_TermEventFilter evt_filter;
-} GF_UIRecord;
-
-Bool uir_on_event_play(GF_UIRecord *uir , GF_Event *event, Bool consumed_by_compositor)
-{
- switch (event->type) {
- case GF_EVENT_CONNECT:
- if (event->connect.is_connected) {
- uir->ck = uir->term->root_scene->scene_codec ? uir->term->root_scene->scene_codec->ck : uir->term->root_scene->dyn_ck;
- }
- break;
- }
- return GF_FALSE;
-}
-
-Bool uir_on_event_record(GF_UIRecord *uir , GF_Event *event, Bool consumed_by_compositor)
-{
- switch (event->type) {
- case GF_EVENT_CONNECT:
- if (event->connect.is_connected) {
- uir->ck = uir->term->root_scene->scene_codec ? uir->term->root_scene->scene_codec->ck : uir->term->root_scene->dyn_ck;
- }
- break;
- case GF_EVENT_CLICK:
- case GF_EVENT_MOUSEUP:
- case GF_EVENT_MOUSEDOWN:
- case GF_EVENT_MOUSEOVER:
- case GF_EVENT_MOUSEOUT:
- /*!! ALL MOUSE EVENTS SHALL BE DECLARED BEFORE MOUSEMOVE !! */
- case GF_EVENT_MOUSEMOVE:
- /*mouse wheel event*/
- case GF_EVENT_MOUSEWHEEL:
- gf_bs_write_u32(uir->bs, gf_clock_time(uir->ck) );
- gf_bs_write_u8(uir->bs, event->type);
- gf_bs_write_u8(uir->bs, event->mouse.button);
- gf_bs_write_u32(uir->bs, event->mouse.x);
- gf_bs_write_u32(uir->bs, event->mouse.y);
- gf_bs_write_float(uir->bs, FIX2FLT(event->mouse.wheel_pos) );
- gf_bs_write_u8(uir->bs, event->mouse.key_states);
- break;
- /*Key Events*/
- case GF_EVENT_KEYUP:
- case GF_EVENT_KEYDOWN:
- case GF_EVENT_LONGKEYPRESS:
- gf_bs_write_u32(uir->bs, gf_clock_time(uir->ck) );
- gf_bs_write_u8(uir->bs, event->type);
- gf_bs_write_u32(uir->bs, event->key.key_code);
- gf_bs_write_u32(uir->bs, event->key.hw_code);
- gf_bs_write_u32(uir->bs, event->key.flags);
- break;
- /*character input*/
- case GF_EVENT_TEXTINPUT:
- gf_bs_write_u32(uir->bs, gf_clock_time(uir->ck) );
- gf_bs_write_u8(uir->bs, event->type);
- gf_bs_write_u32(uir->bs, event->character.unicode_char);
- break;
- }
- return GF_FALSE;
-}
-
-void uir_load_event(GF_UIRecord *uir)
-{
- memset(&uir->next_event, 0, sizeof(GF_Event));
- uir->evt_loaded = GF_FALSE;
- if (!gf_bs_available(uir->bs)) return;
-
-
- uir->next_time = gf_bs_read_u32(uir->bs);
- uir->next_event.type = gf_bs_read_u8(uir->bs);
- switch (uir->next_event.type) {
- case GF_EVENT_CLICK:
- case GF_EVENT_MOUSEUP:
- case GF_EVENT_MOUSEDOWN:
- case GF_EVENT_MOUSEOVER:
- case GF_EVENT_MOUSEOUT:
- /*!! ALL MOUSE EVENTS SHALL BE DECLARED BEFORE MOUSEMOVE !! */
- case GF_EVENT_MOUSEMOVE:
- /*mouse wheel event*/
- case GF_EVENT_MOUSEWHEEL:
- uir->next_event.mouse.button = gf_bs_read_u8(uir->bs);
- uir->next_event.mouse.x = gf_bs_read_u32(uir->bs);
- uir->next_event.mouse.y = gf_bs_read_u32(uir->bs);
- uir->next_event.mouse.wheel_pos = FLT2FIX( gf_bs_read_float(uir->bs) );
- uir->next_event.mouse.key_states = gf_bs_read_u8(uir->bs);
- break;
- /*Key Events*/
- case GF_EVENT_KEYUP:
- case GF_EVENT_KEYDOWN:
- case GF_EVENT_LONGKEYPRESS:
- uir->next_event.key.key_code = gf_bs_read_u32(uir->bs);
- uir->next_event.key.hw_code = gf_bs_read_u32(uir->bs);
- uir->next_event.key.flags = gf_bs_read_u32(uir->bs);
- break;
- /*character input*/
- case GF_EVENT_TEXTINPUT:
- uir->next_event.character.unicode_char = gf_bs_read_u32(uir->bs);
- break;
- }
- uir->evt_loaded = GF_TRUE;
-}
-
-static Bool uir_process(GF_TermExt *termext, u32 action, void *param)
-{
- const char *opt, *uifile;
- GF_UIRecord *uir = (GF_UIRecord*)termext->udta;
-
- switch (action) {
- case GF_TERM_EXT_START:
- uir->term = (GF_Terminal *) param;
- opt = gf_opts_get_key("UIRecord", "Mode");
- if (!opt) return GF_FALSE;
- uifile = gf_opts_get_key("UIRecord", "File");
- if (!uifile) return GF_FALSE;
-
- if (!strcmp(opt, "Play")) {
- uir->uif = gf_fopen(uifile, "rb");
- if (!uir->uif) return GF_FALSE;
- uir->bs = gf_bs_from_file(uir->uif, GF_BITSTREAM_READ);
- termext->caps |= GF_TERM_EXTENSION_NOT_THREADED;
-
- uir->evt_filter.on_event = uir_on_event_play;
- uir->evt_filter.udta = uir;
- gf_term_add_event_filter(uir->term, &uir->evt_filter);
-
- uir_load_event(uir);
- } else if (!strcmp(opt, "Record")) {
- uir->uif = gf_fopen(uifile, "wb");
- if (!uir->uif) return GF_FALSE;
- uir->bs = gf_bs_from_file(uir->uif, GF_BITSTREAM_WRITE);
-
- uir->evt_filter.on_event = uir_on_event_record;
- uir->evt_filter.udta = uir;
- gf_term_add_event_filter(uir->term, &uir->evt_filter);
- } else {
- return GF_FALSE;
- }
- return GF_TRUE;
-
- case GF_TERM_EXT_STOP:
- if (uir->uif) gf_fclose(uir->uif);
- if (uir->bs) gf_bs_del(uir->bs);
- gf_term_remove_event_filter(uir->term, &uir->evt_filter);
- uir->term = NULL;
- /*auto-disable the plugin by default*/
- gf_opts_set_key("UIRecord", "Mode", "Disable");
- break;
-
- case GF_TERM_EXT_PROCESS:
- /*flush all events until current time if reached*/
- while (uir->evt_loaded && uir->ck && (uir->next_time <= gf_clock_time(uir->ck) )) {
- uir->term->compositor->video_out->on_event(uir->term->compositor->video_out->evt_cbk_hdl, &uir->next_event);
- uir_load_event(uir);
- }
- break;
- }
- return GF_FALSE;
-}
-
-
-GF_TermExt *uir_new()
-{
- GF_TermExt *dr;
- GF_UIRecord *uir;
- dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));
- memset(dr, 0, sizeof(GF_TermExt));
- GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC UI Recorder", "gpac distribution");
-
- GF_SAFEALLOC(uir, GF_UIRecord);
- dr->process = uir_process;
- dr->udta = uir;
- return dr;
-}
-
-
-void uir_delete(GF_BaseInterface *ifce)
-{
- GF_TermExt *dr = (GF_TermExt *) ifce;
- GF_UIRecord *uir = (GF_UIRecord*)dr->udta;
- gf_free(uir);
- gf_free(dr);
-}
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_TERM_EXT_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_TERM_EXT_INTERFACE) return (GF_BaseInterface *)uir_new();
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- switch (ifce->InterfaceType) {
- case GF_TERM_EXT_INTERFACE:
- uir_delete(ifce);
- break;
- }
-}
-
-GPAC_MODULE_STATIC_DECLARATION( ui_rec )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/widgetman
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-LINKLIBS= -lgpac -lz
-LOCAL_LIB=-L../../bin/gcc
-
-#common objects
-OBJS=widgetman.o unzip.o widget.o wgt_load.o
-
-ifeq ($(CONFIG_ZLIB),local)
-CFLAGS+=-I"$(LOCAL_INC_PATH)/zlib"
-LOCAL_LIB+= -L../../extra_lib/lib/gcc
-endif
-
-ifeq ($(CONFIG_JS),no)
-else
-CFLAGS+=$(JS_FLAGS)
-ifeq ($(CONFIG_JS),local)
-# if local it is staticly linked with libgpac
-NEED_LOCAL_LIB=yes
-LOCAL_LIB+= -L../../extra_lib/lib/gcc
-else
-LINKLIBS+= $(JS_LIBS)
-endif
-endif
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_widgetman$(DYN_LIB_SUFFIX)
-ifeq ($(CONFIG_WIN32),yes)
-#LDFLAGS+=-export-symbols widgetman.def
-endif
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) $(LOCAL_LIB) $(LINKLIBS) $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- miniunz.c
- Version 1.01e, February 12th, 2005
-
- Copyright (C) 1998-2005 Gilles Vollant
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#ifndef _WIN32_WCE
-#include <errno.h>
-#include <fcntl.h>
-
-#ifdef WIN32
-# include <direct.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <utime.h>
-# include <sys/stat.h>
-#endif
-
-#endif
-
-//hack: prevent mozilla to redifine z functions
-#define MOZZCONF_H
-
-#include "unzip.h"
-#include <gpac/tools.h>
-
-
-
-/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
-
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END 2
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
-voidpf ZCALLBACK fopen_file_func OF((
- voidpf opaque,
- const char* filename,
- int mode));
-
-uLong ZCALLBACK fread_file_func OF((
- voidpf opaque,
- voidpf stream,
- void* buf,
- uLong size));
-
-uLong ZCALLBACK fwrite_file_func OF((
- voidpf opaque,
- voidpf stream,
- const void* buf,
- uLong size));
-
-long ZCALLBACK ftell_file_func OF((
- voidpf opaque,
- voidpf stream));
-
-long ZCALLBACK fseek_file_func OF((
- voidpf opaque,
- voidpf stream,
- uLong offset,
- int origin));
-
-int ZCALLBACK fclose_file_func OF((
- voidpf opaque,
- voidpf stream));
-
-int ZCALLBACK ferror_file_func OF((
- voidpf opaque,
- voidpf stream));
-
-
-voidpf ZCALLBACK fopen_file_func (opaque, filename, mode)
-voidpf opaque;
-const char* filename;
-int mode;
-{
- FILE* file = NULL;
- const char* mode_fopen = NULL;
- if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
- mode_fopen = "rb";
- else if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
- mode_fopen = "r+b";
- else if (mode & ZLIB_FILEFUNC_MODE_CREATE)
- mode_fopen = "wb";
-
- if ((filename!=NULL) && (mode_fopen != NULL))
- file = gf_fopen(filename, mode_fopen);
- return file;
-}
-
-
-uLong ZCALLBACK fread_file_func (opaque, stream, buf, size)
-voidpf opaque;
-voidpf stream;
-void* buf;
-uLong size;
-{
- uLong ret;
- ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
- return ret;
-}
-
-
-uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size)
-voidpf opaque;
-voidpf stream;
-const void* buf;
-uLong size;
-{
- uLong ret;
- ret = (uLong)gf_fwrite(buf, 1, (size_t)size, (FILE *)stream);
- return ret;
-}
-
-long ZCALLBACK ftell_file_func (opaque, stream)
-voidpf opaque;
-voidpf stream;
-{
- long ret;
- ret = ftell((FILE *)stream);
- return ret;
-}
-
-long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
-voidpf opaque;
-voidpf stream;
-uLong offset;
-int origin;
-{
- int fseek_origin=0;
- long ret;
- switch (origin)
- {
- case ZLIB_FILEFUNC_SEEK_CUR :
- fseek_origin = SEEK_CUR;
- break;
- case ZLIB_FILEFUNC_SEEK_END :
- fseek_origin = SEEK_END;
- break;
- case ZLIB_FILEFUNC_SEEK_SET :
- fseek_origin = SEEK_SET;
- break;
- default:
- return -1;
- }
- ret = 0;
- fseek((FILE *)stream, offset, fseek_origin);
- return ret;
-}
-
-int ZCALLBACK fclose_file_func (opaque, stream)
-voidpf opaque;
-voidpf stream;
-{
- int ret;
- ret = gf_fclose((FILE *)stream);
- return ret;
-}
-
-int ZCALLBACK ferror_file_func (opaque, stream)
-voidpf opaque;
-voidpf stream;
-{
- int ret;
- ret = ferror((FILE *)stream);
- return ret;
-}
-
-void fill_fopen_filefunc (pzlib_filefunc_def)
-zlib_filefunc_def* pzlib_filefunc_def;
-{
- pzlib_filefunc_def->zopen_file = fopen_file_func;
- pzlib_filefunc_def->zread_file = fread_file_func;
- pzlib_filefunc_def->zwrite_file = fwrite_file_func;
- pzlib_filefunc_def->ztell_file = ftell_file_func;
- pzlib_filefunc_def->zseek_file = fseek_file_func;
- pzlib_filefunc_def->zclose_file = fclose_file_func;
- pzlib_filefunc_def->zerror_file = ferror_file_func;
- pzlib_filefunc_def->opaque = NULL;
-}
-
-static int unzlocal_getByte(pzlib_filefunc_def,filestream,pi)
-const zlib_filefunc_def* pzlib_filefunc_def;
-voidpf filestream;
-int *pi;
-{
- unsigned char c;
- int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1);
- if (err==1)
- {
- *pi = (int)c;
- return UNZ_OK;
- }
- else
- {
- if (ZERROR(*pzlib_filefunc_def,filestream))
- return UNZ_ERRNO;
- else
- return UNZ_EOF;
- }
-}
-
-static int unzlocal_getShort (pzlib_filefunc_def,filestream,pX)
-const zlib_filefunc_def* pzlib_filefunc_def;
-voidpf filestream;
-uLong *pX;
-{
- uLong x ;
- int err;
- int i = 0;
-
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x = (uLong)i;
-
- if (err==UNZ_OK)
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x += ((uLong)i)<<8;
-
- if (err==UNZ_OK)
- *pX = x;
- else
- *pX = 0;
- return err;
-}
-
-static int unzlocal_getLong (pzlib_filefunc_def,filestream,pX)
-const zlib_filefunc_def* pzlib_filefunc_def;
-voidpf filestream;
-uLong *pX;
-{
- uLong x ;
- int err;
- int i = 0;
-
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x = (uLong)i;
-
- if (err==UNZ_OK)
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x += ((uLong)i)<<8;
-
- if (err==UNZ_OK)
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x += ((uLong)i)<<16;
-
- if (err==UNZ_OK)
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x += ((uLong)i)<<24;
-
- if (err==UNZ_OK)
- *pX = x;
- else
- *pX = 0;
- return err;
-}
-
-static uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream)
-const zlib_filefunc_def* pzlib_filefunc_def;
-voidpf filestream;
-{
- unsigned char* buf;
- uLong uSizeFile;
- uLong uBackRead;
- uLong uMaxBack=0xffff; /* maximum size of global comment */
- uLong uPosFound=0;
-
- if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
- return 0;
-
-
- uSizeFile = ZTELL(*pzlib_filefunc_def,filestream);
-
- if (uMaxBack>uSizeFile)
- uMaxBack = uSizeFile;
-
- buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
- if (buf==NULL)
- return 0;
-
- uBackRead = 4;
- while (uBackRead<uMaxBack)
- {
- uLong uReadSize,uReadPos ;
- int i;
- if (uBackRead+BUFREADCOMMENT>uMaxBack)
- uBackRead = uMaxBack;
- else
- uBackRead+=BUFREADCOMMENT;
- uReadPos = uSizeFile-uBackRead ;
-
- uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
- (BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
- if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
- break;
-
- if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
- break;
-
- for (i=(int)uReadSize-3; (i--)>0;)
- if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
- ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
- {
- uPosFound = uReadPos+i;
- break;
- }
-
- if (uPosFound!=0)
- break;
- }
- TRYFREE(buf);
- return uPosFound;
-}
-
-
-/*
- Translate date/time from Dos format to tm_unz (readable more easilty)
-*/
-void unzlocal_DosDateToTmuDate (ulDosDate, ptm)
-uLong ulDosDate;
-tm_unz* ptm;
-{
- uLong uDate;
- uDate = (uLong)(ulDosDate>>16);
- ptm->tm_mday = (uInt)(uDate&0x1f) ;
- ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;
- ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
-
- ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
- ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ;
- ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ;
-}
-
-static int unzlocal_GetCurrentFileInfoInternal (file,
- pfile_info,
- pfile_info_internal,
- szFileName, fileNameBufferSize,
- extraField, extraFieldBufferSize,
- szComment, commentBufferSize)
-unzFile file;
-unz_file_info *pfile_info;
-unz_file_info_internal *pfile_info_internal;
-char *szFileName;
-uLong fileNameBufferSize;
-void *extraField;
-uLong extraFieldBufferSize;
-char *szComment;
-uLong commentBufferSize;
-{
- unz_s* s;
- unz_file_info file_info;
- unz_file_info_internal file_info_internal;
- int err=UNZ_OK;
- uLong uMagic;
- long lSeek=0;
-
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- if (ZSEEK(s->z_filefunc, s->filestream,
- s->pos_in_central_dir+s->byte_before_the_zipfile,
- ZLIB_FILEFUNC_SEEK_SET)!=0)
- err=UNZ_ERRNO;
-
-
- /* we check the magic */
- if (err==UNZ_OK) {
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
- err=UNZ_ERRNO;
- else if (uMagic!=0x02014b50)
- err=UNZ_BADZIPFILE;
- }
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK)
- err=UNZ_ERRNO;
-
- unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK)
- err=UNZ_ERRNO;
-
- lSeek+=file_info.size_filename;
- if ((err==UNZ_OK) && (szFileName!=NULL))
- {
- uLong uSizeRead ;
- if (file_info.size_filename<fileNameBufferSize)
- {
- *(szFileName+file_info.size_filename)='\0';
- uSizeRead = file_info.size_filename;
- }
- else
- uSizeRead = fileNameBufferSize;
-
- if ((file_info.size_filename>0) && (fileNameBufferSize>0))
- if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead)
- err=UNZ_ERRNO;
- lSeek -= uSizeRead;
- }
-
-
- if ((err==UNZ_OK) && (extraField!=NULL))
- {
- uLong uSizeRead ;
- if (file_info.size_file_extra<extraFieldBufferSize)
- uSizeRead = file_info.size_file_extra;
- else
- uSizeRead = extraFieldBufferSize;
-
- if (lSeek!=0) {
- if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
- lSeek=0;
- else
- err=UNZ_ERRNO;
- }
- if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
- if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead)
- err=UNZ_ERRNO;
- lSeek += file_info.size_file_extra - uSizeRead;
- }
- else
- lSeek+=file_info.size_file_extra;
-
-
- if ((err==UNZ_OK) && (szComment!=NULL))
- {
- uLong uSizeRead ;
- if (file_info.size_file_comment<commentBufferSize)
- {
- *(szComment+file_info.size_file_comment)='\0';
- uSizeRead = file_info.size_file_comment;
- }
- else
- uSizeRead = commentBufferSize;
-
- if (lSeek!=0) {
- if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) {
- //lSeek=0;
- } else {
- err=UNZ_ERRNO;
- }
- }
- if ((file_info.size_file_comment>0) && (commentBufferSize>0))
- if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
- err=UNZ_ERRNO;
- //lSeek+=file_info.size_file_comment - uSizeRead;
- } else {
- //lSeek+=file_info.size_file_comment;
- }
-
- if ((err==UNZ_OK) && (pfile_info!=NULL))
- *pfile_info=file_info;
-
- if ((err==UNZ_OK) && (pfile_info_internal!=NULL))
- *pfile_info_internal=file_info_internal;
-
- return err;
-}
-
-int unzGetCurrentFileInfo(unzFile file,
- unz_file_info *pfile_info,
- char *szFileName,
- uLong fileNameBufferSize,
- void *extraField,
- uLong extraFieldBufferSize,
- char *szComment,
- uLong commentBufferSize)
-{
- return unzlocal_GetCurrentFileInfoInternal(file, pfile_info, NULL, szFileName, fileNameBufferSize, extraField, extraFieldBufferSize, szComment, commentBufferSize);
-}
-
-/*
- Set the current file of the zipfile to the next file.
- return UNZ_OK if there is no problem
- return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-int unzGoToNextFile (file)
-unzFile file;
-{
- unz_s* s;
- int err;
-
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- if (!s->current_file_ok)
- return UNZ_END_OF_LIST_OF_FILE;
- if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */
- if (s->num_file+1==s->gi.number_entry)
- return UNZ_END_OF_LIST_OF_FILE;
-
- s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
- s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
- s->num_file++;
- err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
- &s->cur_file_info_internal,
- NULL,0,NULL,0,NULL,0);
- s->current_file_ok = (err == UNZ_OK);
- return err;
-}
-
-/*
- Set the current file of the zipfile to the first file.
- return UNZ_OK if there is no problem
-*/
-int unzGoToFirstFile (file)
-unzFile file;
-{
- int err=UNZ_OK;
- unz_s* s;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- s->pos_in_central_dir=s->offset_central_dir;
- s->num_file=0;
- err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
- &s->cur_file_info_internal,
- NULL,0,NULL,0,NULL,0);
- s->current_file_ok = (err == UNZ_OK);
- return err;
-}
-
-int unzGetGlobalInfo (file,pglobal_info)
-unzFile file;
-unz_global_info *pglobal_info;
-{
- unz_s* s;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- *pglobal_info=s->gi;
- return UNZ_OK;
-}
-
-/*
- Close the file in zip opened with unzipOpenCurrentFile
- Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-int unzCloseCurrentFile (file)
-unzFile file;
-{
- int err=UNZ_OK;
-
- unz_s* s;
- file_in_zip_read_info_s* pfile_in_zip_read_info;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- pfile_in_zip_read_info=s->pfile_in_zip_read;
-
- if (pfile_in_zip_read_info==NULL)
- return UNZ_PARAMERROR;
-
-
- if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) &&
- (!pfile_in_zip_read_info->raw))
- {
- if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
- err=UNZ_CRCERROR;
- }
-
-
- TRYFREE(pfile_in_zip_read_info->read_buffer);
- pfile_in_zip_read_info->read_buffer = NULL;
- if (pfile_in_zip_read_info->stream_initialised)
- inflateEnd(&pfile_in_zip_read_info->stream);
-
- pfile_in_zip_read_info->stream_initialised = 0;
- TRYFREE(pfile_in_zip_read_info);
-
- s->pfile_in_zip_read=NULL;
-
- return err;
-}
-
-
-/*
- Open a Zip file. path contain the full pathname (by example,
- on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer
- "zlib/zlib114.zip".
- If the zipfile cannot be opened (file doesn't exist or in not valid), the
- return value is NULL.
- Else, the return value is a unzFile Handle, usable with other function
- of this unzip package.
-*/
-extern unzFile ZEXPORT unzOpen2 (path, pzlib_filefunc_def)
-const char *path;
-zlib_filefunc_def* pzlib_filefunc_def;
-{
- unz_s us;
- unz_s *s;
- uLong central_pos,uL;
-
- uLong number_disk; /* number of the current dist, used for
- spaning ZIP, unsupported, always 0*/
- uLong number_disk_with_CD; /* number the the disk with central dir, used
- for spaning ZIP, unsupported, always 0*/
- uLong number_entry_CD; /* total number of entries in
- the central dir
- (same than number_entry on nospan) */
-
- int err=UNZ_OK;
-
- if (pzlib_filefunc_def==NULL)
- fill_fopen_filefunc(&us.z_filefunc);
- else
- us.z_filefunc = *pzlib_filefunc_def;
-
- us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque,
- path,
- ZLIB_FILEFUNC_MODE_READ |
- ZLIB_FILEFUNC_MODE_EXISTING);
- if (us.filestream==NULL)
- return NULL;
-
- central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream);
- if (central_pos==0)
- err=UNZ_ERRNO;
-
- if (ZSEEK(us.z_filefunc, us.filestream,
- central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
- err=UNZ_ERRNO;
-
- /* the signature, already checked */
- if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* number of this disk */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* number of the disk with the start of the central directory */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* total number of entries in the central dir on this disk */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* total number of entries in the central dir */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- if ((number_entry_CD!=us.gi.number_entry) ||
- (number_disk_with_CD!=0) ||
- (number_disk!=0))
- err=UNZ_BADZIPFILE;
-
- /* size of the central directory */
- if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* offset of start of central directory with respect to the
- starting disk number */
- if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* zipfile comment length */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- if ((central_pos<us.offset_central_dir+us.size_central_dir) &&
- (err==UNZ_OK))
- err=UNZ_BADZIPFILE;
-
- if (err!=UNZ_OK)
- {
- ZCLOSE(us.z_filefunc, us.filestream);
- return NULL;
- }
-
- us.byte_before_the_zipfile = central_pos -
- (us.offset_central_dir+us.size_central_dir);
- us.central_pos = central_pos;
- us.pfile_in_zip_read = NULL;
- us.encrypted = 0;
-
-
- s=(unz_s*)ALLOC(sizeof(unz_s));
- *s=us;
- unzGoToFirstFile((unzFile)s);
- return (unzFile)s;
-}
-
-
-/*
- Read bytes from the current file.
- buf contain buffer where data must be copied
- len the size of buf.
-
- return the number of byte copied if somes bytes are copied
- return 0 if the end of file was reached
- return <0 with error code if there is an error
- (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-int unzReadCurrentFile (file, buf, len)
-unzFile file;
-voidp buf;
-unsigned len;
-{
- int err=UNZ_OK;
- uInt iRead = 0;
- unz_s* s;
- file_in_zip_read_info_s* pfile_in_zip_read_info;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- pfile_in_zip_read_info=s->pfile_in_zip_read;
-
- if (pfile_in_zip_read_info==NULL)
- return UNZ_PARAMERROR;
-
-
- if (pfile_in_zip_read_info->read_buffer == NULL)
- return UNZ_END_OF_LIST_OF_FILE;
- if (len==0)
- return 0;
-
- pfile_in_zip_read_info->stream.next_out = (Bytef*)buf;
-
- pfile_in_zip_read_info->stream.avail_out = (uInt)len;
-
- if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&
- (!(pfile_in_zip_read_info->raw)))
- pfile_in_zip_read_info->stream.avail_out =
- (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
-
- if ((len>pfile_in_zip_read_info->rest_read_compressed+
- pfile_in_zip_read_info->stream.avail_in) &&
- (pfile_in_zip_read_info->raw))
- pfile_in_zip_read_info->stream.avail_out =
- (uInt)pfile_in_zip_read_info->rest_read_compressed+
- pfile_in_zip_read_info->stream.avail_in;
-
- while (pfile_in_zip_read_info->stream.avail_out>0)
- {
- if ((pfile_in_zip_read_info->stream.avail_in==0) &&
- (pfile_in_zip_read_info->rest_read_compressed>0))
- {
- uInt uReadThis = UNZ_BUFSIZE;
- if (pfile_in_zip_read_info->rest_read_compressed<uReadThis)
- uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed;
- if (uReadThis == 0)
- return UNZ_EOF;
- if (ZSEEK(pfile_in_zip_read_info->z_filefunc,
- pfile_in_zip_read_info->filestream,
- pfile_in_zip_read_info->pos_in_zipfile +
- pfile_in_zip_read_info->byte_before_the_zipfile,
- ZLIB_FILEFUNC_SEEK_SET)!=0)
- return UNZ_ERRNO;
- if (ZREAD(pfile_in_zip_read_info->z_filefunc,
- pfile_in_zip_read_info->filestream,
- pfile_in_zip_read_info->read_buffer,
- uReadThis)!=uReadThis)
- return UNZ_ERRNO;
-
- pfile_in_zip_read_info->pos_in_zipfile += uReadThis;
-
- pfile_in_zip_read_info->rest_read_compressed-=uReadThis;
-
- pfile_in_zip_read_info->stream.next_in =
- (Bytef*)pfile_in_zip_read_info->read_buffer;
- pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis;
- }
-
- if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw))
- {
- uInt uDoCopy,i ;
-
- if ((pfile_in_zip_read_info->stream.avail_in == 0) &&
- (pfile_in_zip_read_info->rest_read_compressed == 0))
- return (iRead==0) ? UNZ_EOF : iRead;
-
- if (pfile_in_zip_read_info->stream.avail_out <
- pfile_in_zip_read_info->stream.avail_in)
- uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
- else
- uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
-
- for (i=0; i<uDoCopy; i++)
- *(pfile_in_zip_read_info->stream.next_out+i) =
- *(pfile_in_zip_read_info->stream.next_in+i);
-
- pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,
- pfile_in_zip_read_info->stream.next_out,
- uDoCopy);
- pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;
- pfile_in_zip_read_info->stream.avail_in -= uDoCopy;
- pfile_in_zip_read_info->stream.avail_out -= uDoCopy;
- pfile_in_zip_read_info->stream.next_out += uDoCopy;
- pfile_in_zip_read_info->stream.next_in += uDoCopy;
- pfile_in_zip_read_info->stream.total_out += uDoCopy;
- iRead += uDoCopy;
- }
- else
- {
- uLong uTotalOutBefore,uTotalOutAfter;
- const Bytef *bufBefore;
- uLong uOutThis;
- int flush=Z_SYNC_FLUSH;
-
- uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;
- bufBefore = pfile_in_zip_read_info->stream.next_out;
-
- /*
- if ((pfile_in_zip_read_info->rest_read_uncompressed ==
- pfile_in_zip_read_info->stream.avail_out) &&
- (pfile_in_zip_read_info->rest_read_compressed == 0))
- flush = Z_FINISH;
- */
- err=inflate(&pfile_in_zip_read_info->stream,flush);
-
- if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))
- err = Z_DATA_ERROR;
-
- uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
- uOutThis = uTotalOutAfter-uTotalOutBefore;
-
- pfile_in_zip_read_info->crc32 =
- crc32(pfile_in_zip_read_info->crc32,bufBefore,
- (uInt)(uOutThis));
-
- pfile_in_zip_read_info->rest_read_uncompressed -=
- uOutThis;
-
- iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
-
- if (err==Z_STREAM_END)
- return (iRead==0) ? UNZ_EOF : iRead;
- if (err!=Z_OK)
- break;
- }
- }
-
- if (err==Z_OK)
- return iRead;
- return err;
-}
-
-/*
- Read the local header of the current zipfile
- Check the coherency of the local header and info in the end of central
- directory about this file
- store in *piSizeVar the size of extra info in local header
- (filename and size of extra field data)
-*/
-int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
- poffset_local_extrafield,
- psize_local_extrafield)
-unz_s* s;
-uInt* piSizeVar;
-uLong *poffset_local_extrafield;
-uInt *psize_local_extrafield;
-{
- uLong uMagic,uData,uFlags;
- uLong size_filename;
- uLong size_extra_field;
- int err=UNZ_OK;
-
- *piSizeVar = 0;
- *poffset_local_extrafield = 0;
- *psize_local_extrafield = 0;
-
- if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile +
- s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0)
- return UNZ_ERRNO;
-
-
- if (err==UNZ_OK) {
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
- err=UNZ_ERRNO;
- else if (uMagic!=0x04034b50)
- err=UNZ_BADZIPFILE;
- }
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
- err=UNZ_ERRNO;
- /*
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))
- err=UNZ_BADZIPFILE;
- */
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))
- err=UNZ_BADZIPFILE;
-
- if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
- (s->cur_file_info.compression_method!=Z_DEFLATED))
- err=UNZ_BADZIPFILE;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) &&
- ((uFlags & 8)==0))
- err=UNZ_BADZIPFILE;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) &&
- ((uFlags & 8)==0))
- err=UNZ_BADZIPFILE;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) &&
- ((uFlags & 8)==0))
- err=UNZ_BADZIPFILE;
-
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK)
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))
- err=UNZ_BADZIPFILE;
-
- *piSizeVar += (uInt)size_filename;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK)
- err=UNZ_ERRNO;
- *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +
- SIZEZIPLOCALHEADER + size_filename;
- *psize_local_extrafield = (uInt)size_extra_field;
-
- *piSizeVar += (uInt)size_extra_field;
-
- return err;
-}
-
-/*
- Open for reading data the current file in the zipfile.
- If there is no error and the file is opened, the return value is UNZ_OK.
-*/
-int unzOpenCurrentFile3 (file, method, level, raw, password)
-unzFile file;
-int* method;
-int* level;
-int raw;
-const char* password;
-{
- int err=UNZ_OK;
- uInt iSizeVar;
- unz_s* s;
- file_in_zip_read_info_s* pfile_in_zip_read_info;
- uLong offset_local_extrafield; /* offset of the local extra field */
- uInt size_local_extrafield; /* size of the local extra field */
-
- if (password != NULL)
- return UNZ_PARAMERROR;
-
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- if (!s->current_file_ok)
- return UNZ_PARAMERROR;
-
- if (s->pfile_in_zip_read != NULL)
- unzCloseCurrentFile(file);
-
- if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar,
- &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)
- return UNZ_BADZIPFILE;
-
- pfile_in_zip_read_info = (file_in_zip_read_info_s*)
- ALLOC(sizeof(file_in_zip_read_info_s));
- if (pfile_in_zip_read_info==NULL)
- return UNZ_INTERNALERROR;
-
- pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE);
- pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
- pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
- pfile_in_zip_read_info->pos_local_extrafield=0;
- pfile_in_zip_read_info->raw=raw;
-
- if (pfile_in_zip_read_info->read_buffer==NULL)
- {
- TRYFREE(pfile_in_zip_read_info);
- return UNZ_INTERNALERROR;
- }
-
- pfile_in_zip_read_info->stream_initialised=0;
-
- if (method!=NULL)
- *method = (int)s->cur_file_info.compression_method;
-
- if (level!=NULL)
- {
- *level = 6;
- switch (s->cur_file_info.flag & 0x06)
- {
- case 6 :
- *level = 1;
- break;
- case 4 :
- *level = 2;
- break;
- case 2 :
- *level = 9;
- break;
- }
- }
-
- if ((s->cur_file_info.compression_method!=0) && (s->cur_file_info.compression_method!=Z_DEFLATED)) {
- TRYFREE(pfile_in_zip_read_info);
- return UNZ_BADZIPFILE;
- }
-
- pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;
- pfile_in_zip_read_info->crc32=0;
- pfile_in_zip_read_info->compression_method =
- s->cur_file_info.compression_method;
- pfile_in_zip_read_info->filestream=s->filestream;
- pfile_in_zip_read_info->z_filefunc=s->z_filefunc;
- pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;
-
- pfile_in_zip_read_info->stream.total_out = 0;
-
- if ((s->cur_file_info.compression_method==Z_DEFLATED) &&
- (!raw))
- {
- pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
- pfile_in_zip_read_info->stream.zfree = (free_func)0;
- pfile_in_zip_read_info->stream.opaque = (voidpf)0;
- pfile_in_zip_read_info->stream.next_in = (voidpf)0;
- pfile_in_zip_read_info->stream.avail_in = 0;
-
- err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
- if (err == Z_OK)
- pfile_in_zip_read_info->stream_initialised=1;
- else
- {
- TRYFREE(pfile_in_zip_read_info);
- return err;
- }
- /* windowBits is passed < 0 to tell that there is no zlib header.
- * Note that in this case inflate *requires* an extra "dummy" byte
- * after the compressed stream in order to complete decompression and
- * return Z_STREAM_END.
- * In unzip, i don't wait absolutely Z_STREAM_END because I known the
- * size of both compressed and uncompressed data
- */
- }
- pfile_in_zip_read_info->rest_read_compressed =
- s->cur_file_info.compressed_size ;
- pfile_in_zip_read_info->rest_read_uncompressed =
- s->cur_file_info.uncompressed_size ;
-
-
- pfile_in_zip_read_info->pos_in_zipfile =
- s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER +
- iSizeVar;
-
- pfile_in_zip_read_info->stream.avail_in = (uInt)0;
-
- s->pfile_in_zip_read = pfile_in_zip_read_info;
-
- return UNZ_OK;
-}
-
-/*
- Close a ZipFile opened with unzipOpen.
- If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
- these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
- return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzClose (file)
-unzFile file;
-{
- unz_s* s;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
-
- if (s->pfile_in_zip_read!=NULL)
- unzCloseCurrentFile(file);
-
- ZCLOSE(s->z_filefunc, s->filestream);
- TRYFREE(s);
- return UNZ_OK;
-}
-
-#ifndef _WIN32_WCE
-
-/* mymkdir and change_file_date are not 100 % portable
- As I don't know well Unix, I wait feedback for the unix portion */
-
-int mymkdir(dirname)
-const char* dirname;
-{
- int ret=0;
-#if defined(WIN32) || defined(_WIN32_WCE)
- return mkdir(dirname);
-#else
- return mkdir (dirname, 700);
-#endif
- return ret;
-}
-
-int makedir (newdir)
-const char *newdir;
-{
- char *buffer ;
- char *p;
- int len = (int)strlen(newdir);
-
- if (len <= 0)
- return 0;
-
- buffer = (char*)gf_malloc(len+1);
- strcpy(buffer,newdir);
-
- if (buffer[len-1] == '/') {
- buffer[len-1] = '\0';
- }
- if (mymkdir(buffer) == 0)
- {
- gf_free(buffer);
- return 1;
- }
-
- p = buffer+1;
- while (1)
- {
- char hold;
-
- while(*p && *p != '\\' && *p != '/')
- p++;
- hold = *p;
- *p = 0;
- if ((mymkdir(buffer) == -1) && (errno == ENOENT))
- {
- fprintf(stderr, "couldn't create directory %s\n",buffer);
- gf_free(buffer);
- return 0;
- }
- if (hold == 0)
- break;
- *p++ = hold;
- }
- gf_free(buffer);
- return 1;
-}
-#else
-int makedir (newdir)
-{
- return 0;
-}
-#endif
-
-
-int do_extract_currentfile(uf)
-unzFile uf;
-{
- char filename_inzip[256];
- char* filename_withoutpath;
- char* p;
- int err=UNZ_OK;
- FILE *fout=NULL;
- void* buf;
- uInt size_buf;
-
- unz_file_info file_info;
- err = unzlocal_GetCurrentFileInfoInternal(uf,&file_info,NULL,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
-
- if (err!=UNZ_OK)
- {
- fprintf(stderr, "error %d with zipfile in unzGetCurrentFileInfo\n",err);
- return err;
- }
-
- size_buf = WRITEBUFFERSIZE;
- buf = (void*)gf_malloc(size_buf);
- if (buf==NULL)
- {
- fprintf(stderr, "Error allocating memory\n");
- return UNZ_INTERNALERROR;
- }
-
- p = filename_withoutpath = filename_inzip;
- while ((*p) != '\0')
- {
- if (((*p)=='/') || ((*p)=='\\'))
- filename_withoutpath = p+1;
- p++;
- }
-
- if ((*filename_withoutpath)=='\0')
- {
-#ifndef _WIN32_WCE
- fprintf(stderr, "creating directory: %s\n",filename_inzip);
- mymkdir(filename_inzip);
-#endif
- }
- else
- {
- const char* write_filename;
- int skip=0;
-
- write_filename = filename_inzip;
-
- err = unzOpenCurrentFile3(uf, NULL, NULL, 0, NULL/*password*/);
- if (err!=UNZ_OK)
- {
- fprintf(stderr, "error %d with zipfile in unzOpenCurrentFilePassword\n",err);
- }
-
- if ((skip==0) && (err==UNZ_OK))
- {
- fout = gf_fopen(write_filename,"wb");
-
- /* some zipfile don't contain directory alone before file */
- if ((fout==NULL) && (filename_withoutpath!=(char*)filename_inzip))
- {
- char c=*(filename_withoutpath-1);
- *(filename_withoutpath-1)='\0';
- makedir(write_filename);
- *(filename_withoutpath-1)=c;
- fout = gf_fopen(write_filename,"wb");
- }
-
- if (fout==NULL)
- {
- fprintf(stderr, "error opening %s\n",write_filename);
- }
- }
-
- if (fout!=NULL)
- {
- fprintf(stderr, " extracting: %s\n",write_filename);
-
- do
- {
- err = unzReadCurrentFile(uf,buf,size_buf);
- if (err<0)
- {
- fprintf(stderr, "error %d with zipfile in unzReadCurrentFile\n",err);
- break;
- }
- if (err>0)
- if (gf_fwrite(buf,err,1,fout)!=1)
- {
- fprintf(stderr, "error in writing extracted file\n");
- err=UNZ_ERRNO;
- break;
- }
- }
- while (err>0);
- if (fout)
- gf_fclose(fout);
- }
-
- if (err==UNZ_OK)
- {
- err = unzCloseCurrentFile (uf);
- if (err!=UNZ_OK)
- {
- fprintf(stderr, "error %d with zipfile in unzCloseCurrentFile\n",err);
- }
- }
- else
- unzCloseCurrentFile(uf); /* don't lose the error */
- }
-
- gf_free(buf);
- return err;
-}
-
-
-int gf_unzip_archive(const char *zipfilename, const char *dirname)
-{
- uLong i;
- unz_global_info gi;
- int err;
-
- unzFile uf=NULL;
-
- uf = unzOpen2(zipfilename, NULL);
- if (uf==NULL)
- {
- fprintf(stderr, "Cannot open %s\n", zipfilename);
- return 1;
- }
-#ifndef _WIN32_WCE
- if (chdir(dirname))
- {
- fprintf(stderr, "Error changing into %s, aborting\n", dirname);
- exit(-1);
- }
-#endif
-
- err = unzGetGlobalInfo (uf,&gi);
- if (err!=UNZ_OK)
- fprintf(stderr, "error %d with zipfile in unzGetGlobalInfo \n",err);
-
- for (i=0; i<gi.number_entry; i++)
- {
- if (do_extract_currentfile(uf) != UNZ_OK)
- break;
-
- if ((i+1)<gi.number_entry)
- {
- err = unzGoToNextFile(uf);
- if (err!=UNZ_OK)
- {
- fprintf(stderr, "error %d with zipfile in unzGoToNextFile\n",err);
- break;
- }
- }
- }
- unzClose(uf);
-
- return 0;
-}
-
-int gf_unzip_probe(const char *zipfilename)
-{
- int ret = 0;
- FILE *f = gf_fopen(zipfilename, "r");
- if (!f) return 0;
- if (fgetc(f)=='P')
- if (fgetc(f)=='K')
- if (fgetc(f)==3)
- if (fgetc(f)==4)
- ret = 1;
- gf_fclose(f);
- return ret;
-}
+++ /dev/null
-/* unzip.h -- IO for uncompress .zip files using zlib
- Version 1.01e, February 12th, 2005
-
- Copyright (C) 1998-2005 Gilles Vollant
-
- This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
- WinZip, InfoZip tools and compatible.
-
- Multi volume ZipFile (span) are not supported.
- Encryption compatible with pkzip 2.04g only supported
- Old compressions used by old PKZip 1.x are not supported
-
-
- I WAIT FEEDBACK at mail info@winimage.com
- Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
-
- Condition of use and distribution are the same than zlib :
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
-*/
-
-/* for more info about .ZIP format, see
- http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
- http://www.info-zip.org/pub/infozip/doc/
- PkWare has also a specification at :
- ftp://ftp.pkware.com/probdesc.zip
-*/
-
-#ifndef _unz_H
-#define _unz_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-# include <zlib.h>
-
-#ifndef OF
-#define OF(x) x
-#endif
-
-#define ZCALLBACK
-
-#define ZLIB_FILEFUNC_SEEK_CUR (1)
-#define ZLIB_FILEFUNC_SEEK_END (2)
-#define ZLIB_FILEFUNC_SEEK_SET (0)
-
-#define ZLIB_FILEFUNC_MODE_READ (1)
-#define ZLIB_FILEFUNC_MODE_WRITE (2)
-#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
-
-#define ZLIB_FILEFUNC_MODE_EXISTING (4)
-#define ZLIB_FILEFUNC_MODE_CREATE (8)
-
-typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
-typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
-typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
-typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
-typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
-typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
-typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
-
-typedef struct zlib_filefunc_def_s
-{
- open_file_func zopen_file;
- read_file_func zread_file;
- write_file_func zwrite_file;
- tell_file_func ztell_file;
- seek_file_func zseek_file;
- close_file_func zclose_file;
- testerror_file_func zerror_file;
- voidpf opaque;
-} zlib_filefunc_def;
-
-
-
-void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
-
-#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
-#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
-#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
-#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
-#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
-#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
-
-#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
- from (void*) without cast */
-typedef struct TagunzFile__ {
- int unused;
-} unzFile__;
-typedef unzFile__ *unzFile;
-#else
-typedef voidp unzFile;
-#endif
-
-
-#ifndef UNZ_BUFSIZE
-#define UNZ_BUFSIZE (16384)
-#endif
-
-#ifndef UNZ_MAXFILENAMEINZIP
-#define UNZ_MAXFILENAMEINZIP (256)
-#endif
-
-#ifndef ALLOC
-# define ALLOC(size) (gf_malloc(size))
-#endif
-#ifndef TRYFREE
-# define TRYFREE(p) {if (p) gf_free(p);}
-#endif
-
-#define SIZECENTRALDIRITEM (0x2e)
-#define SIZEZIPLOCALHEADER (0x1e)
-
-#ifndef BUFREADCOMMENT
-#define BUFREADCOMMENT (0x400)
-#endif
-
-#define WRITEBUFFERSIZE (8192)
-
-
-
-
-#define UNZ_OK (0)
-#define UNZ_END_OF_LIST_OF_FILE (-100)
-#define UNZ_ERRNO (Z_ERRNO)
-#define UNZ_EOF (0)
-#define UNZ_PARAMERROR (-102)
-#define UNZ_BADZIPFILE (-103)
-#define UNZ_INTERNALERROR (-104)
-#define UNZ_CRCERROR (-105)
-
-/* tm_unz contain date/time info */
-typedef struct tm_unz_s
-{
- uInt tm_sec; /* seconds after the minute - [0,59] */
- uInt tm_min; /* minutes after the hour - [0,59] */
- uInt tm_hour; /* hours since midnight - [0,23] */
- uInt tm_mday; /* day of the month - [1,31] */
- uInt tm_mon; /* months since January - [0,11] */
- uInt tm_year; /* years - [1980..2044] */
-} tm_unz;
-
-/* unz_global_info structure contain global data about the ZIPfile
- These data comes from the end of central dir */
-typedef struct unz_global_info_s
-{
- uLong number_entry; /* total number of entries in
- the central dir on this disk */
- uLong size_comment; /* size of the global comment of the zipfile */
-} unz_global_info;
-
-
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_info_s
-{
- uLong version; /* version made by 2 bytes */
- uLong version_needed; /* version needed to extract 2 bytes */
- uLong flag; /* general purpose bit flag 2 bytes */
- uLong compression_method; /* compression method 2 bytes */
- uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
- uLong crc; /* crc-32 4 bytes */
- uLong compressed_size; /* compressed size 4 bytes */
- uLong uncompressed_size; /* uncompressed size 4 bytes */
- uLong size_filename; /* filename length 2 bytes */
- uLong size_file_extra; /* extra field length 2 bytes */
- uLong size_file_comment; /* file comment length 2 bytes */
-
- uLong disk_num_start; /* disk number start 2 bytes */
- uLong internal_fa; /* internal file attributes 2 bytes */
- uLong external_fa; /* external file attributes 4 bytes */
-
- tm_unz tmu_date;
-} unz_file_info;
-
-
-
-/* unz_file_info_interntal contain internal info about a file in zipfile*/
-typedef struct unz_file_info_internal_s
-{
- uLong offset_curfile;/* relative offset of local header 4 bytes */
-} unz_file_info_internal;
-
-
-/* file_in_zip_read_info_s contain internal information about a file in zipfile,
- when reading and decompress it */
-typedef struct
-{
- char *read_buffer; /* internal buffer for compressed data */
- z_stream stream; /* zLib stream structure for inflate */
-
- uLong pos_in_zipfile; /* position in byte on the zipfile, for gf_fseek*/
- uLong stream_initialised; /* flag set if stream structure is initialised*/
-
- uLong offset_local_extrafield;/* offset of the local extra field */
- uInt size_local_extrafield;/* size of the local extra field */
- uLong pos_local_extrafield; /* position in the local extra field in read*/
-
- uLong crc32; /* crc32 of all data uncompressed */
- uLong crc32_wait; /* crc32 we must obtain after decompress all */
- uLong rest_read_compressed; /* number of byte to be decompressed */
- uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/
- zlib_filefunc_def z_filefunc;
- voidpf filestream; /* io structore of the zipfile */
- uLong compression_method; /* compression method (0==store) */
- uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
- int raw;
-} file_in_zip_read_info_s;
-
-
-/* unz_s contain internal information about the zipfile
-*/
-typedef struct
-{
- zlib_filefunc_def z_filefunc;
- voidpf filestream; /* io structore of the zipfile */
- unz_global_info gi; /* public global information */
- uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
- uLong num_file; /* number of the current file in the zipfile*/
- uLong pos_in_central_dir; /* pos of the current file in the central dir*/
- uLong current_file_ok; /* flag about the usability of the current file*/
- uLong central_pos; /* position of the beginning of the central dir*/
-
- uLong size_central_dir; /* size of the central directory */
- uLong offset_central_dir; /* offset of start of central directory with
- respect to the starting disk number */
-
- unz_file_info cur_file_info; /* public info about the current file in zip*/
- unz_file_info_internal cur_file_info_internal; /* private info about it*/
- file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current
- file if we are decompressing it */
- int encrypted;
-# ifndef NOUNCRYPT
- unsigned long keys[3]; /* keys defining the pseudo-random sequence */
- const unsigned long* pcrc_32_tab;
-# endif
-} unz_s;
-
-
-
-extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
- const char* fileName2,
- int iCaseSensitivity));
-/*
- Compare two filename (fileName1,fileName2).
- If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
- If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
- or strcasecmp)
- If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
- (like 1 on Unix, 2 on Windows)
-*/
-
-
-extern unzFile ZEXPORT unzOpen OF((const char *path));
-/*
- Open a Zip file. path contain the full pathname (by example,
- on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
- "zlib/zlib113.zip".
- If the zipfile cannot be opened (file don't exist or in not valid), the
- return value is NULL.
- Else, the return value is a unzFile Handle, usable with other function
- of this unzip package.
-*/
-
-extern unzFile ZEXPORT unzOpen2 OF((const char *path,
- zlib_filefunc_def* pzlib_filefunc_def));
-/*
- Open a Zip file, like unzOpen, but provide a set of file low level API
- for read/write the zip file (see ioapi.h)
-*/
-
-extern int ZEXPORT unzClose OF((unzFile file));
-/*
- Close a ZipFile opened with unzipOpen.
- If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
- these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
- return UNZ_OK if there is no problem. */
-
-extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
- unz_global_info *pglobal_info));
-/*
- Write info about the ZipFile in the *pglobal_info structure.
- No preparation of the structure is needed
- return UNZ_OK if there is no problem. */
-
-
-extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
- char *szComment,
- uLong uSizeBuf));
-/*
- Get the global comment string of the ZipFile, in the szComment buffer.
- uSizeBuf is the size of the szComment buffer.
- return the number of byte copied or an error code <0
-*/
-
-
-/***************************************************************************/
-/* Unzip package allow you browse the directory of the zipfile */
-
-extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
-/*
- Set the current file of the zipfile to the first file.
- return UNZ_OK if there is no problem
-*/
-
-extern int ZEXPORT unzGoToNextFile OF((unzFile file));
-/*
- Set the current file of the zipfile to the next file.
- return UNZ_OK if there is no problem
- return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-
-extern int ZEXPORT unzLocateFile OF((unzFile file,
- const char *szFileName,
- int iCaseSensitivity));
-/*
- Try locate the file szFileName in the zipfile.
- For the iCaseSensitivity signification, see unzStringFileNameCompare
-
- return value :
- UNZ_OK if the file is found. It becomes the current file.
- UNZ_END_OF_LIST_OF_FILE if the file is not found
-*/
-
-
-/* ****************************************** */
-/* Ryan supplied functions */
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_pos_s
-{
- uLong pos_in_zip_directory; /* offset in zip file directory */
- uLong num_of_file; /* # of file */
-} unz_file_pos;
-
-extern int ZEXPORT unzGetFilePos(
- unzFile file,
- unz_file_pos* file_pos);
-
-extern int ZEXPORT unzGoToFilePos(
- unzFile file,
- unz_file_pos* file_pos);
-
-/* ****************************************** */
-
-extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
- unz_file_info *pfile_info,
- char *szFileName,
- uLong fileNameBufferSize,
- void *extraField,
- uLong extraFieldBufferSize,
- char *szComment,
- uLong commentBufferSize));
-/*
- Get Info about the current file
- if pfile_info!=NULL, the *pfile_info structure will contain somes info about
- the current file
- if szFileName!=NULL, the filemane string will be copied in szFileName
- (fileNameBufferSize is the size of the buffer)
- if extraField!=NULL, the extra field information will be copied in extraField
- (extraFieldBufferSize is the size of the buffer).
- This is the Central-header version of the extra field
- if szComment!=NULL, the comment string of the file will be copied in szComment
- (commentBufferSize is the size of the buffer)
-*/
-
-/***************************************************************************/
-/* for reading the content of the current zipfile, you can open it, read data
- from it, and close it (you can close it before reading all the file)
- */
-
-extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
-/*
- Open for reading data the current file in the zipfile.
- If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
- const char* password));
-/*
- Open for reading data the current file in the zipfile.
- password is a crypting password
- If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
- int* method,
- int* level,
- int raw));
-/*
- Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
- if raw==1
- *method will receive method of compression, *level will receive level of
- compression
- note : you can set level parameter as NULL (if you did not want known level,
- but you CANNOT set method parameter as NULL
-*/
-
-extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
- int* method,
- int* level,
- int raw,
- const char* password));
-/*
- Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
- if raw==1
- *method will receive method of compression, *level will receive level of
- compression
- note : you can set level parameter as NULL (if you did not want known level,
- but you CANNOT set method parameter as NULL
-*/
-
-
-extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
-/*
- Close the file in zip opened with unzOpenCurrentFile
- Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-
-extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
- voidp buf,
- unsigned len));
-/*
- Read bytes from the current file (opened by unzOpenCurrentFile)
- buf contain buffer where data must be copied
- len the size of buf.
-
- return the number of byte copied if somes bytes are copied
- return 0 if the end of file was reached
- return <0 with error code if there is an error
- (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-
-extern z_off_t ZEXPORT unztell OF((unzFile file));
-/*
- Give the current position in uncompressed data
-*/
-
-extern int ZEXPORT unzeof OF((unzFile file));
-/*
- return 1 if the end of file was reached, 0 elsewhere
-*/
-
-extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
- voidp buf,
- unsigned len));
-/*
- Read extra field from the current file (opened by unzOpenCurrentFile)
- This is the local-header version of the extra field (sometimes, there is
- more info in the local-header version than in the central-header)
-
- if buf==NULL, it return the size of the local extra field
-
- if buf!=NULL, len is the size of the buffer, the extra header is copied in
- buf.
- the return value is the number of bytes copied in buf, or (if <0)
- the error code
-*/
-
-/***************************************************************************/
-
-/* Get the current file offset */
-extern uLong ZEXPORT unzGetOffset (unzFile file);
-
-/* Set the current file offset */
-extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
-
-
-int gf_unzip_probe(const char *zipfilename);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _unz_H */
+++ /dev/null
-//This software module was originally developed by TelecomParisTech in the
-//course of the development of MPEG-U Widgets (ISO/IEC 23007-1) standard.
-//
-//This software module is an implementation of a part of one or
-//more MPEG-U Widgets (ISO/IEC 23007-1) tools as specified by the MPEG-U Widgets
-//(ISO/IEC 23007-1) standard. ISO/IEC gives users of the MPEG-U Widgets
-//(ISO/IEC 23007-1) free license to this software module or modifications
-//thereof for use in hardware or software products claiming conformance to
-//the MPEG-U Widgets (ISO/IEC 23007-1). Those intending to use this software
-//module in hardware or software products are advised that its use may
-//infringe existing patents.
-//The original developer of this software module and his/her company, the
-//subsequent editors and their companies, and ISO/IEC have no liability
-//for use of this software module or modifications thereof in an implementation.
-//Copyright is not released for non MPEG-U Widgets (ISO/IEC 23007-1) conforming
-//products.
-//Telecom ParisTech retains full right to use the code for his/her own purpose,
-//assign or donate the code to a third party and to inhibit third parties from
-//using the code for non MPEG-U Widgets (ISO/IEC 23007-1) conforming products.
-//
-//This copyright notice must be included in all copies or derivative works.
-//
-//Copyright (c) 2009 Telecom ParisTech.
-//
-// Alternatively, this software module may be redistributed and/or modified
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////
-//
-// Authors:
-// Cyril Concolato, Telecom ParisTech
-// Jean Le Feuvre, Telecom ParisTech
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/scenegraph_dev.h>
-#include <gpac/nodes_svg.h>
-#include <gpac/constants.h>
-
-#if defined(GPAC_HAS_SPIDERMONKEY) && !defined(GPAC_DISABLE_SVG)
-
-typedef struct
-{
- GF_Scene *scene;
- u8 oti;
- char *file_name;
- u32 file_size;
- Bool loaded;
-} WgtLoad;
-
-static GF_Err WGT_ProcessData(GF_SceneDecoder *plug, const char *inBuffer, u32 inBufferLength,
- u16 ES_ID, u32 stream_time, u32 mmlevel)
-{
- GF_Err e = GF_OK;
- WgtLoad *wgtload = (WgtLoad *)plug->privateStack;
-
- if (stream_time==(u32)-1) {
- gf_sg_reset(wgtload->scene->graph);
- return GF_OK;
- }
-
- switch (wgtload->oti) {
- case GPAC_OTI_PRIVATE_SCENE_WGT:
- if (wgtload->file_name && !wgtload->loaded) {
- const char *path, *wmpath;
- char *tmp;
- GF_Node *n, *root;
- GF_FieldInfo info;
- FILE *jsfile;
- GF_ChildNodeItem *last;
-
- wgtload->loaded = GF_TRUE;
-
- gf_sg_add_namespace(wgtload->scene->graph, "http://www.w3.org/2000/svg", NULL);
- gf_sg_add_namespace(wgtload->scene->graph, "http://www.w3.org/1999/xlink", "xlink");
- gf_sg_add_namespace(wgtload->scene->graph, "http://www.w3.org/2001/xml-events", "ev");
- gf_sg_set_scene_size_info(wgtload->scene->graph, 800, 600, GF_TRUE);
-
- /* modify the scene with an Inline/Animation pointing to the widget start file URL */
- n = root = gf_node_new(wgtload->scene->graph, TAG_SVG_svg);
- gf_node_register(root, NULL);
- gf_sg_set_root_node(wgtload->scene->graph, root);
- gf_node_get_attribute_by_tag(n, TAG_SVG_ATT_viewBox, GF_TRUE, GF_FALSE, &info);
- gf_svg_parse_attribute(n, &info, "0 0 320 240", 0);
- gf_node_get_attribute_by_name(n, "xmlns", 0, GF_TRUE, GF_FALSE, &info);
- gf_svg_parse_attribute(n, &info, "http://www.w3.org/2000/svg", 0);
- /*
- gf_sg_set_scene_size_info(wgtload->scene->graph, 800, 600, 1);
- gf_node_get_attribute_by_tag(n, TAG_SVG_ATT_width, 1, 0, &info);
- gf_svg_parse_attribute(n, &info, "800", 0);
- gf_node_get_attribute_by_tag(n, TAG_SVG_ATT_height, 1, 0, &info);
- gf_svg_parse_attribute(n, &info, "600", 0);
- */
- gf_node_init(n);
-
- n = gf_node_new(wgtload->scene->graph, TAG_SVG_animation);
- gf_node_set_id(n, 1, "w_anim");
- gf_node_register(n, root);
- gf_node_list_add_child_last(&((GF_ParentNode *)root)->children, n, &last);
- gf_node_get_attribute_by_tag(n, TAG_SVG_ATT_width, GF_TRUE, GF_FALSE, &info);
- gf_svg_parse_attribute(n, &info, "320", 0);
- gf_node_get_attribute_by_tag(n, TAG_SVG_ATT_height, GF_TRUE, GF_FALSE, &info);
- gf_svg_parse_attribute(n, &info, "240", 0);
- gf_node_init(n);
-
- tmp = wgtload->file_name;
- while ((tmp = strchr(tmp, '\\'))) {
- tmp[0] = '/';
- tmp++;
- }
-
- n = gf_node_new(wgtload->scene->graph, TAG_SVG_script);
- gf_node_register(n, root);
- gf_node_list_add_child_last(&((GF_ParentNode *)root)->children, n, &last);
- path = gf_opts_get_key("Widgets", "WidgetLoadScript");
- jsfile = path ? gf_fopen(path, "rt") : NULL;
- if (jsfile) {
- gf_fclose(jsfile);
- gf_node_get_attribute_by_tag(n, TAG_XLINK_ATT_href, GF_TRUE, GF_FALSE, &info);
- gf_svg_parse_attribute(n, &info, (char *) path, 0);
- } else {
- const char *load_fun = "function load_widget(wid_url) {\n"
- " var wid = WidgetManager.load(wid_url);\n"
- " var anim = document.getElementById('w_anim');\n"
- " if (wid != null) {\n"
- " wid.activate(anim);"
- " anim.setAttributeNS('http://www.w3.org/1999/xlink', 'href', wid.main);\n"
- " } else {\n"
- " alert('Widget ' + wid_url + ' is not valid');\n"
- " }\n"
- "}\n";
-
- gf_dom_add_text_node(n, gf_strdup(load_fun) );
- }
- gf_node_init(n);
-
-
- wmpath = gf_opts_get_key("Widgets", "WidgetManagerScript");
- jsfile = wmpath ? gf_fopen(wmpath, "rt") : NULL;
- if (jsfile) {
- gf_fclose(jsfile);
- n = gf_node_new(wgtload->scene->graph, TAG_SVG_script);
- gf_node_register(n, root);
- gf_node_list_add_child_last(&((GF_ParentNode *)root)->children, n, &last);
- gf_node_get_attribute_by_tag(n, TAG_XLINK_ATT_href, GF_TRUE, GF_FALSE, &info);
- gf_svg_parse_attribute(n, &info, (char *) wmpath, 0);
- gf_node_init(n);
-
- n = gf_node_new(wgtload->scene->graph, TAG_SVG_script);
- gf_node_register(n, root);
- gf_node_list_add_child_last(&((GF_ParentNode *)root)->children, n, &last);
- gf_dom_add_text_node(n, gf_strdup("widget_manager_init();") );
- gf_node_init(n);
- }
-
- tmp = (char*)gf_malloc(sizeof(char) * (strlen(wgtload->file_name)+50) );
- sprintf(tmp, "load_widget(\"%s\");\n", wgtload->file_name);
-
- n = gf_node_new(wgtload->scene->graph, TAG_SVG_script);
- gf_node_register(n, root);
- gf_node_list_add_child_last(&((GF_ParentNode *)root)->children, n, &last);
- gf_dom_add_text_node(n, gf_strdup(tmp) );
- gf_free(tmp);
-
- gf_node_init(n);
-
- if ((wgtload->scene->graph_attached!=1) && (gf_sg_get_root_node(wgtload->scene->graph)!=NULL) ) {
- gf_scene_attach_to_compositor(wgtload->scene);
- e = GF_EOS;
- }
- }
- break;
-
- default:
- return GF_BAD_PARAM;
- }
- return e;
-}
-
-static GF_Err WGT_AttachScene(GF_SceneDecoder *plug, GF_Scene *scene, Bool is_scene_decoder)
-{
- WgtLoad *wgtload = (WgtLoad *)plug->privateStack;
- wgtload->scene = scene;
- return GF_OK;
-}
-
-static GF_Err WGT_ReleaseScene(GF_SceneDecoder *plug)
-{
- WgtLoad *wgtload = (WgtLoad *)plug->privateStack;
- wgtload->scene = NULL;
- return GF_OK;
-}
-
-static GF_Err WGT_AttachStream(GF_BaseDecoder *plug, GF_ESD *esd)
-{
- GF_BitStream *bs;
- WgtLoad *wgtload = (WgtLoad *)plug->privateStack;
- if (esd->decoderConfig->upstream) return GF_NOT_SUPPORTED;
-
- /* decSpecInfo is not null only when reading from an WGT file (local or distant, cached or not) */
- switch (esd->decoderConfig->objectTypeIndication) {
- case GPAC_OTI_PRIVATE_SCENE_WGT:
- default:
- if (!esd->decoderConfig->decoderSpecificInfo) return GF_NON_COMPLIANT_BITSTREAM;
- bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ);
- wgtload->file_size = gf_bs_read_u32(bs);
- gf_bs_del(bs);
- wgtload->file_name = (char *) gf_malloc(sizeof(char)*(1 + esd->decoderConfig->decoderSpecificInfo->dataLength - sizeof(u32)) );
- memcpy(wgtload->file_name, esd->decoderConfig->decoderSpecificInfo->data + sizeof(u32), esd->decoderConfig->decoderSpecificInfo->dataLength - sizeof(u32) );
- wgtload->file_name[esd->decoderConfig->decoderSpecificInfo->dataLength - sizeof(u32) ] = 0;
- break;
- }
- wgtload->oti = esd->decoderConfig->objectTypeIndication;
- return GF_OK;
-}
-
-static GF_Err WGT_DetachStream(GF_BaseDecoder *plug, u16 ES_ID)
-{
- WgtLoad *wgtload = (WgtLoad *)plug->privateStack;
- if (wgtload->file_name) gf_free(wgtload->file_name);
- wgtload->file_name = NULL;
- return GF_OK;
-}
-
-const char *WGT_GetName(struct _basedecoder *plug)
-{
- return "GPAC W3C Widget Loader";
-}
-
-static u32 WGT_CanHandleStream(GF_BaseDecoder *ifce, u32 StreamType, GF_ESD *esd, u8 PL)
-{
- /*don't reply to media type query*/
- if (!esd) return GF_CODEC_NOT_SUPPORTED;
-
- if (StreamType==GF_STREAM_PRIVATE_SCENE) {
- if (esd->decoderConfig->objectTypeIndication==GPAC_OTI_PRIVATE_SCENE_WGT) return GF_CODEC_SUPPORTED;
- return GF_CODEC_NOT_SUPPORTED;
- }
- return GF_CODEC_NOT_SUPPORTED;
-}
-
-static GF_Err WGT_GetCapabilities(GF_BaseDecoder *plug, GF_CodecCapability *cap)
-{
- cap->cap.valueInt = 0;
- if (cap->CapCode==GF_CODEC_PADDING_BYTES) {
- /* Adding one byte of padding for \r\n problems*/
- cap->cap.valueInt = 1;
- return GF_OK;
- }
- return GF_NOT_SUPPORTED;
-}
-
-static GF_Err WGT_SetCapabilities(GF_BaseDecoder *plug, const GF_CodecCapability capability)
-{
- return GF_OK;
-}
-
-/*interface create*/
-GF_BaseInterface *LoadWidgetReader()
-{
- WgtLoad *wgtload;
- GF_SceneDecoder *sdec;
-
- GF_SAFEALLOC(sdec, GF_SceneDecoder)
- if (!sdec) return NULL;
- GF_REGISTER_MODULE_INTERFACE(sdec, GF_SCENE_DECODER_INTERFACE, "GPAC W3C Widget Loader", "gpac distribution");
-
- GF_SAFEALLOC(wgtload, WgtLoad);
- if (!wgtload) {
- gf_free(sdec);
- return NULL;
- }
-
- sdec->privateStack = wgtload;
- sdec->AttachStream = WGT_AttachStream;
- sdec->CanHandleStream = WGT_CanHandleStream;
- sdec->DetachStream = WGT_DetachStream;
- sdec->AttachScene = WGT_AttachScene;
- sdec->ReleaseScene = WGT_ReleaseScene;
- sdec->ProcessData = WGT_ProcessData;
- sdec->GetName = WGT_GetName;
- sdec->SetCapabilities = WGT_SetCapabilities;
- sdec->GetCapabilities = WGT_GetCapabilities;
- return (GF_BaseInterface *)sdec;
-}
-
-
-/*interface destroy*/
-void ShutdownWidgetReader(GF_BaseInterface *ifce)
-{
- GF_SceneDecoder *sdec = (GF_SceneDecoder *)ifce;
- WgtLoad *wgtload;
- if (!ifce)
- return;
- wgtload = (WgtLoad *) sdec->privateStack;
- if (wgtload)
- gf_free(wgtload);
- sdec->privateStack = NULL;
- gf_free(sdec);
-}
-
-#endif /* defined(GPAC_HAS_SPIDERMONKEY) && !defined(GPAC_DISABLE_SVG) */
+++ /dev/null
-var wid = null;
-var xmlns_xlink = 'http://www.w3.org/1999/xlink';
-
-function debug(s) {
- alert('[Widget Loader] '+s);
-}
-
-function add_text_span(parent, string) {
- var span = document.createElement('tspan');
- span.textContent = string;
- parent.appendChild(span);
- parent.appendChild(document.createElement('tbreak'));
-}
-
-function load_widget(wid_url) {
- debug('Loading Widget: '+wid_url);
- wid = WidgetManager.load(wid_url);
- var anim = document.getElementById('w_anim');
- width = 320;
- height = 240;
- anim.setAttribute('height', height/3);
-
- var info = document.createElement('textArea');
- document.documentElement.appendChild(info);
- info.setAttribute('y', height/3);
- info.setAttribute('width', width);
-
- info.setAttribute('font-size', '7');
- info.setAttribute('font-family', 'Arial Unicode MS');
- if (wid != null) {
- debug('Loading scene: '+wid.main);
- anim.setAttributeNS(xmlns_xlink, 'href', wid.main);
- add_text_span(info, 'Widget Metadata');
- add_text_span(info, 'UA Locale: \'' + gpac.get_option('Systems', 'Language2CC') + '\'');
- add_text_span(info, 'widget src (abs.): \'' + wid.url + '\'');
- add_text_span(info, 'config src (abs.): \'' + wid.manifest + '\'');
- add_text_span(info, 'content src (rel.&loc./abs.): \''+wid.main+'\' / \''+wid.localizedSrc+'\' ('+wid.mainMimeType+';'+wid.mainEncoding+')');
- add_text_span(info, 'id: \'' + wid.identifier + '\'');
- add_text_span(info, 'shortname/name: \''+wid.shortName+ '\' / \''+wid.name+'\'');
- add_text_span(info, 'version: \''+wid.version+'\'');
- add_text_span(info, 'license/href: \''+wid.license+'\' / \''+wid.licenseHref+'\'');
- add_text_span(info, 'description: \''+wid.description+'\'');
- add_text_span(info, 'author (name/email/href): \''+wid.authorName+ '\' / \''+wid.authorEmail +'\' / \''+wid.authorHref+'\'');
- var s = 'icons src (rel.&loc./abs.): ';
- for (var i=0; i<wid.icons.length; i++) {
- if (i) s += ' , ';
- s += '\'' + wid.icons[i].src + '\' / \'' + wid.icons[i].relocated_src + '\'' + ' ('+wid.icons[i].width+'x'+wid.icons[i].height+')';
- }
- add_text_span(info, s);
-
- s = 'preferences: ';
- for (var i=0; i<wid.preferences.length; i++) {
- var p = wid.preferences[i];
- if (i) s += ' , ';
- s += '' + p.name + '=\'' + p.value + '\' (ro:'+p.readonly+')';
- }
- add_text_span(info, s);
-
- s = 'features: ';
- add_text_span(info, s);
-
- for (var i=0; i<wid.features.length; i++) {
- var f = wid.features[i];
- s = 'feature: ';
- s += '' + f.name + '(' + f.required + ')';
- add_text_span(info, s);
- if (f.params.length) {
- s = '-params: ';
- for (var j=0; j<f.params.length; j++) {
- var p = f.params[j];
- if (j != 0) s += ' , ';
- s += '' + p.name + '=\'' + p.value + '\'';
- }
- add_text_span(info, s);
- }
- }
-
- add_text_span(info, 'size: '+wid.defaultWidth+'x'+wid.defaultHeight);
- add_text_span(info, 'viewmodes: \''+wid.viewmodes+'\'');
- } else {
- debug('Invalid Widget');
- info.textContent = 'Invalid widget - no info available';
- }
-}
+++ /dev/null
-//This software module was originally developed by TelecomParisTech in the
-//course of the development of MPEG-U Widgets (ISO/IEC 23007-1) standard.
-//
-//This software module is an implementation of a part of one or
-//more MPEG-U Widgets (ISO/IEC 23007-1) tools as specified by the MPEG-U Widgets
-//(ISO/IEC 23007-1) standard. ISO/IEC gives users of the MPEG-U Widgets
-//(ISO/IEC 23007-1) free license to this software module or modifications
-//thereof for use in hardware or software products claiming conformance to
-//the MPEG-U Widgets (ISO/IEC 23007-1). Those intending to use this software
-//module in hardware or software products are advised that its use may
-//infringe existing patents.
-//The original developer of this software module and his/her company, the
-//subsequent editors and their companies, and ISO/IEC have no liability
-//for use of this software module or modifications thereof in an implementation.
-//Copyright is not released for non MPEG-U Widgets (ISO/IEC 23007-1) conforming
-//products.
-//Telecom ParisTech retains full right to use the code for his/her own purpose,
-//assign or donate the code to a third party and to inhibit third parties from
-//using the code for non MPEG-U Widgets (ISO/IEC 23007-1) conforming products.
-//
-//This copyright notice must be included in all copies or derivative works.
-//
-//Copyright (c) 2009 Telecom ParisTech.
-//
-// Alternatively, this software module may be redistributed and/or modified
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////////
-//
-// Authors:
-// Jean Le Feuvre, Telecom ParisTech
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-
-#include "widgetman.h"
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-
-JSBool SMJS_FUNCTION(widget_has_feature)
-{
- char *feat_name;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid) return JS_FALSE;
-
- if (!argc || !JSVAL_IS_STRING(argv[0])) return JS_TRUE;
-
- feat_name = SMJS_CHARS(c, argv[0]);
- SMJS_SET_RVAL( BOOLEAN_TO_JSVAL( JS_FALSE ) );
-
- if (!strcmp(feat_name, "urn:mpeg:systems:mpeg-u:2009")) SMJS_SET_RVAL( BOOLEAN_TO_JSVAL( JS_TRUE ));
- SMJS_FREE(c, feat_name);
- return JS_TRUE;
-}
-
-JSBool SMJS_FUNCTION(widget_open_url)
-{
- GF_Event evt;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid || !argc || !JSVAL_IS_STRING(argv[0])) return JS_TRUE;
-
- memset(&evt, 0, sizeof(GF_Event));
- evt.type = GF_EVENT_NAVIGATE;
- evt.navigate.to_url = SMJS_CHARS(c, argv[0]);
- gf_term_send_event(wid->widget->wm->term, &evt);
- SMJS_FREE(c, (char *)evt.navigate.to_url);
-
- return JS_TRUE;
-}
-
-JSBool SMJS_FUNCTION(widget_get_attention)
-{
- jsval fval;
- SMJS_OBJ
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid) return JS_TRUE;
-
- if ((JS_LookupProperty(c, wid->widget->wm->obj, "getAttention", &fval)==JS_TRUE) && JSVAL_IS_OBJECT(fval)) {
- jsval args[1];
- args[0] = OBJECT_TO_JSVAL(wid->obj);
- JS_CallFunctionValue(c, wid->widget->wm->obj, fval, 1, args, SMJS_GET_RVAL);
- }
- return JS_TRUE;
-}
-
-JSBool SMJS_FUNCTION(widget_show_notification)
-{
- jsval fval;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid) return JS_TRUE;
-
- if ((JS_LookupProperty(c, wid->widget->wm->obj, "showNotification", &fval)==JS_TRUE) && JSVAL_IS_OBJECT(fval)) {
- jsval *vars;
- u32 i;
- vars = (jsval*)gf_malloc(sizeof(jsval)*(argc+1));
- vars[0] = OBJECT_TO_JSVAL(wid->obj);
- for (i=0; i<argc; i++)
- vars[i+1] = argv[i];
-
- JS_CallFunctionValue(c, wid->widget->wm->obj, fval, argc+1, vars, SMJS_GET_RVAL);
- }
- return JS_TRUE;
-}
-
-
-static JSBool SMJS_FUNCTION(widget_call_message_reply_callback)
-{
- JSObject *list;
- jsval *vals, fval;
- u32 i, count;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetMessage *msg = SMJS_GET_PRIVATE(c, obj);
- if (!msg || !argc || !JSVAL_IS_OBJECT(argv[0]) ) return JS_FALSE;
-
- if ((JS_LookupProperty(c, obj, "replyCallback", &fval)==JS_TRUE) && JSVAL_IS_OBJECT(fval)) {
- list = JSVAL_TO_OBJECT(argv[0]);
- JS_GetArrayLength(c, list, (jsuint*) &count);
- vals = (jsval*)gf_malloc(sizeof(jsval)*(count+1));
- vals[0] = OBJECT_TO_JSVAL(obj);
- for (i=0; i<count; i++) {
- JS_GetElement(c, list, (jsint) i, &vals[i+1]);
- }
- JS_CallFunctionValue(c, obj, fval, count, vals, SMJS_GET_RVAL);
- gf_free(vals);
- }
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(widget_message_handler_factory)
-{
- char *msg_name;
- u32 i, count;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInterfaceInstance *bifce = (GF_WidgetInterfaceInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!bifce) return JS_FALSE;
-
- if (!argc) return JS_FALSE;
- if (!JSVAL_IS_STRING(argv[0])) return JS_FALSE;
-
- msg_name = SMJS_CHARS(c, argv[0]);
- if (!msg_name ) return JS_FALSE;
-
- SMJS_SET_RVAL( JSVAL_NULL );
- count = gf_list_count(bifce->ifce->messages);
- for (i=0; i<count; i++) {
- GF_WidgetMessage *msg = (GF_WidgetMessage*)gf_list_get(bifce->ifce->messages, i);
- if (!strcmp(msg->name, msg_name)) {
- JSObject *an_obj = JS_NewObject(c, &bifce->wid->widget->wm->widgetAnyClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, an_obj, msg);
- JS_DefineProperty(c, an_obj, "msgName", STRING_TO_JSVAL( JS_NewStringCopyZ(c, msg->name) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, an_obj, "interfaceHandler", OBJECT_TO_JSVAL( obj ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineFunction(c, an_obj, "onInvokeReply", widget_call_message_reply_callback, 1, 0);
-
- if ((argc==2) && JSVAL_IS_OBJECT(argv[1]) && !JSVAL_IS_NULL(argv[1]))
- JS_DefineProperty(c, an_obj, "replyCallback", argv[1], 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
-
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(an_obj) );
- }
- }
- SMJS_FREE(c, msg_name);
- return JS_TRUE;
-}
-static JSBool SMJS_FUNCTION(widget_invoke_message)
-{
- jsval oval;
- GF_WidgetMessage *msg = NULL;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInterfaceInstance *bifce = (GF_WidgetInterfaceInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!bifce) return JS_FALSE;
-
- SMJS_SET_RVAL( JSVAL_NULL );
-
- if (!JSVAL_IS_OBJECT(argv[0])) return JS_FALSE;
- if (JSVAL_IS_NULL(argv[0])) return JS_FALSE;
- msg = (GF_WidgetMessage *)SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- if (!msg) return JS_FALSE;
-
- /*look for JS Callback "invoke" in the widget manager script*/
- if (JS_LookupProperty(c, bifce->ifce->obj, "invoke", &oval)==JS_TRUE) {
- if (JSVAL_IS_OBJECT(oval)) {
- JS_CallFunctionValue(bifce->wid->widget->wm->ctx, bifce->ifce->obj, oval, argc, argv, SMJS_GET_RVAL );
- }
- }
-
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(widget_invoke_message_reply)
-{
- jsval oval;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetMessage *msg = NULL;
- GF_WidgetInterfaceInstance *bifce = (GF_WidgetInterfaceInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!bifce) return JS_FALSE;
-
- SMJS_SET_RVAL( JSVAL_NULL );
-
- if (!JSVAL_IS_OBJECT(argv[0])) return JS_FALSE;
- if (JSVAL_IS_NULL(argv[0])) return JS_FALSE;
- msg = (GF_WidgetMessage *)SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- if (!msg) return JS_FALSE;
-
- /*look for JS Callback "invokeReply" in the widget manager script*/
- if (JS_LookupProperty(c, bifce->ifce->obj, "invokeReply", &oval)==JS_TRUE) {
- if (JSVAL_IS_OBJECT(oval)) {
- JS_CallFunctionValue(bifce->wid->widget->wm->ctx, bifce->ifce->obj, oval, argc, argv, SMJS_GET_RVAL);
- }
- }
- return JS_TRUE;
-}
-
-static void widget_interface_js_bind(JSContext *c, GF_WidgetInterfaceInstance *ifce)
-{
- if (!ifce->obj) {
- ifce->obj = JS_NewObject(c, &ifce->wid->widget->wm->widgetAnyClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, ifce->obj, ifce);
- gf_js_add_root(c, &ifce->obj, GF_JSGC_OBJECT);
- JS_DefineProperty(c, ifce->obj, "type", STRING_TO_JSVAL( JS_NewStringCopyZ(c, ifce->ifce->type) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, ifce->obj, "bound", STRING_TO_JSVAL( JS_NewStringCopyZ(c, ifce->hostname) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineFunction(c, ifce->obj, "invoke", widget_invoke_message, 1, 0);
- JS_DefineFunction(c, ifce->obj, "msgHandlerFactory", widget_message_handler_factory, 1, 0);
- JS_DefineFunction(c, ifce->obj, "invokeReply", widget_invoke_message_reply, 1, 0);
- }
-}
-
-static JSBool SMJS_FUNCTION(widget_get_interfaces)
-{
- u32 i, count;
- char *ifce_name;
- JSObject *list;
- jsuint idx;
- jsval v;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid) return JS_FALSE;
-
- if (!argc || !JSVAL_IS_STRING(argv[0])) return JS_TRUE;
- ifce_name = SMJS_CHARS(c, argv[0]);
-
- list = JS_NewArrayObject(c, 0, 0);
-
- count = gf_list_count(wid->bound_ifces);
- for (i=0; i<count; i++) {
- GF_WidgetInterfaceInstance *ifce = (GF_WidgetInterfaceInstance*)gf_list_get(wid->bound_ifces, i);
- if (strcmp(ifce->ifce->type, ifce_name)) continue;
-
- widget_interface_js_bind(c, ifce);
-
- JS_GetArrayLength(c, list, &idx);
- v = OBJECT_TO_JSVAL(ifce->obj);
- JS_SetElement(c, list, idx, &v);
- }
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(list) );
- SMJS_FREE(c, ifce_name);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION_EXT(widget_activate_component, Bool is_deactivate)
-{
- u32 i, count;
- char *comp_id;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid) return JS_FALSE;
-
- if (!argc || !JSVAL_IS_STRING(argv[0])) return JS_TRUE;
- comp_id = SMJS_CHARS(c, argv[0]);
-
- count = gf_list_count(wid->widget->main->components);
- for (i=0; i<count; i++) {
- GF_WidgetComponent *comp = (GF_WidgetComponent*)gf_list_get(wid->widget->main->components, i);
- if (!comp->id || strcmp(comp->id, comp_id)) continue;
-
- if (is_deactivate) {
- wm_deactivate_component(c, wid, comp, NULL);
- } else {
- wm_activate_component(c, wid, comp, GF_FALSE);
- }
- break;
- }
- SMJS_FREE(c, comp_id);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(widget_activate_widget)
-{
- return widget_activate_component(SMJS_CALL_ARGS, GF_FALSE);
-}
-
-static JSBool SMJS_FUNCTION(widget_deactivate_widget)
-{
- return widget_activate_component(SMJS_CALL_ARGS, GF_TRUE);
-}
-
-void widget_on_interface_bind(GF_WidgetInterfaceInstance *ifce, Bool unbind)
-{
- jsval funval, rval, argv[1];
-
- const char *fun_name = unbind ? "onInterfaceUnbind" : "onInterfaceBind";
- if (!ifce || !ifce->wid || !ifce->wid->scene_context) return;
-
- /*look for JS Callback "invoke" in the widget manager script*/
- if (JS_LookupProperty(ifce->wid->scene_context, ifce->wid->scene_obj, fun_name, &funval)!=JS_TRUE)
- return;
- if (!JSVAL_IS_OBJECT(funval)) return;
-
- widget_interface_js_bind(ifce->wid->widget->wm->ctx, ifce);
- argv[0] = OBJECT_TO_JSVAL(ifce->obj);
- JS_CallFunctionValue(ifce->wid->widget->wm->ctx, ifce->ifce->obj, funval, 1, argv, &rval);
-
-}
-
-SMJS_FUNC_PROP_GET(widget_getProperty)
-
-const char *opt;
-char *prop_name;
-GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
-if (!wid) return JS_FALSE;
-
-if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
-prop_name = SMJS_CHARS_FROM_STRING(c, SMJS_ID_TO_STRING(id));
-if (!prop_name) return JS_FALSE;
-
-if (!strcmp(prop_name, "viewMode")) {
- *vp = STRING_TO_JSVAL( JS_NewStringCopyZ(c, "floating") );
-}
-else if (!strcmp(prop_name, "locale")) {
- opt = gf_opts_get_key("core", "lang");
- if (!opt) opt = "und";
- *vp = STRING_TO_JSVAL( JS_NewStringCopyZ(c, opt) );
-}
-else if (!strcmp(prop_name, "identifier")) {
- if (wid->widget->identifier) *vp = STRING_TO_JSVAL( JS_NewStringCopyZ(c, wid->widget->identifier) );
-}
-else if (!strcmp(prop_name, "authorName")) {
- if (wid->widget->authorName) *vp = STRING_TO_JSVAL( JS_NewStringCopyZ(c, wid->widget->authorName) );
-}
-else if (!strcmp(prop_name, "authorEmail")) {
- if (wid->widget->authorEmail) *vp = STRING_TO_JSVAL( JS_NewStringCopyZ(c, wid->widget->authorEmail) );
-}
-else if (!strcmp(prop_name, "authorHref")) {
- if (wid->widget->authorHref) *vp = STRING_TO_JSVAL( JS_NewStringCopyZ(c, wid->widget->authorHref) );
-}
-else if (!strcmp(prop_name, "name")) {
- if (wid->widget->name) *vp = STRING_TO_JSVAL( JS_NewStringCopyZ(c, wid->widget->name) );
-}
-else if (!strcmp(prop_name, "version")) {
- if (wid->widget->version) *vp = STRING_TO_JSVAL( JS_NewStringCopyZ(c, wid->widget->version) );
-}
-else if (!strcmp(prop_name, "description")) {
- if (wid->widget->description) *vp = STRING_TO_JSVAL( JS_NewStringCopyZ(c, wid->widget->description) );
-}
-else if (!strcmp(prop_name, "width")) {
- opt = gf_opts_get_key((const char *) wid->secname, "width");
- *vp = INT_TO_JSVAL( (opt ? atoi(opt) : 0) );
-}
-else if (!strcmp(prop_name, "height")) {
- opt = gf_opts_get_key((const char *) wid->secname, "height");
- *vp = INT_TO_JSVAL( (opt ? atoi(opt) : 0) );
-}
-else if (!strcmp(prop_name, "preferences")) {
-}
-SMJS_FREE(c, prop_name);
-return JS_TRUE;
-}
-
-SMJS_FUNC_PROP_SET( widget_setProperty)
-
-/*avoids GCC warning*/
-if (!obj) obj = NULL;
-#ifndef GPAC_CONFIG_DARWIN
-if (!id) id=0;
-#endif
-if (!vp) vp=0;
-return JS_TRUE;
-}
-
-void widget_load(GF_WidgetManager *wm, GF_SceneGraph *scene, JSContext *c, JSObject *global, Bool unload)
-{
- u32 i, count;
- GF_WidgetInstance *wi;
-
- /*Is this scenegraph a widget or not ? To find out, browse all widget instances*/
- i=0;
- while ((wi = (GF_WidgetInstance*)gf_list_enum(wm->widget_instances, &i))) {
- if (!wi->scene || (wi->scene != scene)) continue;
- break;
- }
- if (!wi) return;
-
- /*OK we found our widget*/
-
- if (unload) {
- /*detach all bound interfaces from this script*/
- count = gf_list_count(wi->bound_ifces);
- for (i=0; i<count; i++) {
- GF_WidgetInterfaceInstance *ifce = (GF_WidgetInterfaceInstance*)gf_list_get(wi->bound_ifces, i);
- if (ifce->obj) {
- SMJS_SET_PRIVATE(c, ifce->obj, NULL);
- gf_js_remove_root(c, &ifce->obj, GF_JSGC_OBJECT);
- ifce->obj = NULL;
- }
- }
- return;
- } else {
-
- JSPropertySpec widgetClassProps[] = {
- SMJS_PROPERTY_SPEC(0, 0, 0, 0, 0)
- };
- JSFunctionSpec widgetClassFuncs[] = {
- /*W3C*/
- SMJS_FUNCTION_SPEC("has_feature", widget_has_feature, 1),
- SMJS_FUNCTION_SPEC("openURL", widget_open_url, 1),
- SMJS_FUNCTION_SPEC("getAttention", widget_get_attention, 0),
- SMJS_FUNCTION_SPEC("showNotification", widget_show_notification, 0),
- /*MPEG*/
- SMJS_FUNCTION_SPEC("getInterfaceHandlersByType", widget_get_interfaces, 1),
- SMJS_FUNCTION_SPEC("activateComponentWidget", widget_activate_widget, 1),
- SMJS_FUNCTION_SPEC("deactivateComponentWidget", widget_deactivate_widget, 1),
- SMJS_FUNCTION_SPEC(0, 0, 0)
- };
-
- GF_JS_InitClass(c, global, 0, &wm->widgetClass, 0, 0,widgetClassProps, widgetClassFuncs, 0, 0);
-
-
- wi->scene_obj = JS_DefineObject(c, global, "widget", &wm->widgetClass._class, 0, 0);
- //JS_AliasProperty(c, global, "widget", "MPEGWidget");
- SMJS_SET_PRIVATE(c, wi->scene_obj, wi);
- /*and remember the script*/
- wi->scene_context = c;
- wi->scene_global = global;
- }
-}
-
-#endif
+++ /dev/null
-//This software module was originally developed by TelecomParisTech in the
-//course of the development of MPEG-U Widgets (ISO/IEC 23007-1) standard.
-//
-//This software module is an implementation of a part of one or
-//more MPEG-U Widgets (ISO/IEC 23007-1) tools as specified by the MPEG-U Widgets
-//(ISO/IEC 23007-1) standard. ISO/IEC gives users of the MPEG-U Widgets
-//(ISO/IEC 23007-1) free license to this software module or modifications
-//thereof for use in hardware or software products claiming conformance to
-//the MPEG-U Widgets (ISO/IEC 23007-1). Those intending to use this software
-//module in hardware or software products are advised that its use may
-//infringe existing patents.
-//The original developer of this software module and his/her company, the
-//subsequent editors and their companies, and ISO/IEC have no liability
-//for use of this software module or modifications thereof in an implementation.
-//Copyright is not released for non MPEG-U Widgets (ISO/IEC 23007-1) conforming
-//products.
-//Telecom ParisTech retains full right to use the code for his/her own purpose,
-//assign or donate the code to a third party and to inhibit third parties from
-//using the code for non MPEG-U Widgets (ISO/IEC 23007-1) conforming products.
-//
-//This copyright notice must be included in all copies or derivative works.
-//
-//Copyright (c) 2009 Telecom ParisTech.
-//
-// Alternatively, this software module may be redistributed and/or modified
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////////
-//
-// Authors:
-// Jean Le Feuvre, Telecom ParisTech
-// Cyril Concolato, Telecom ParisTech
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-#include "widgetman.h"
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-
-#if !defined(__GNUC__)
-# if defined(_WIN32_WCE)
-# pragma comment(lib, "js32")
-# elif defined (_WIN64)
-# pragma comment(lib, "js")
-# elif defined (WIN32)
-# pragma comment(lib, "js")
-# endif
-#endif
-
-
-JSBool gf_sg_js_event_add_listener(JSContext *c, JSObject *obj, uintN argc, jsval *argv, jsval *rval, GF_Node *vrml_node);
-JSBool gf_sg_js_event_remove_listener(JSContext *c, JSObject *obj, uintN argc, jsval *argv, jsval *rval, GF_Node *vrml_node);
-
-
-
-static Bool is_same_path(const char *p1, const char *p2, u32 len)
-{
- char c1, c2;
- u32 i=0;
- do {
- if (len && (i==len))
- break;
- c1 = p1[i];
- c2 = p2[i];
- if (p1[i] != p2[i]) {
- if ((c1=='/') && (c2=='\\')) {}
- else if ((c1=='\\') && (c2=='/')) {}
- else return GF_FALSE;
- }
- i++;
- } while (c1);
-
- return GF_TRUE;
-}
-
-static void widget_package_extract_file(GF_WidgetPackage *wpack, GF_WidgetPackageResource *res)
-{
- u32 i;
-
- if (wpack->is_zip) {
- unz_global_info gi;
- unzFile uf = unzOpen2(wpack->package_path, NULL);
- if (!uf) return;
-
- unzGetGlobalInfo(uf, &gi);
- for (i=0; i<gi.number_entry; i++) {
- char buf[8192];
- int err;
- FILE *fout;
- char filename_inzip[256];
-
- unz_file_info file_info;
- unzGetCurrentFileInfo(uf, &file_info, filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
-
- if (strcmp(res->inner_path, filename_inzip)) {
- if ((i+1)<gi.number_entry)
- unzGoToNextFile(uf);
- continue;
- }
-
- unzOpenCurrentFile3(uf, NULL, NULL, 0, NULL/*password*/);
-
- fout=gf_fopen(res->extracted_path, "wb");
- if (!fout) break;
- do {
- err = unzReadCurrentFile(uf,buf,8192);
- if (err<0) break;
- if (err>0)
- if (gf_fwrite(buf,err,1,fout)!=1) {
- //err=UNZ_ERRNO;
- break;
- }
- } while (err>0);
- if (fout) gf_fclose(fout);
-
- res->extracted = GF_TRUE;
- break;
- }
- unzClose(uf);
-#ifndef GPAC_DISABLE_ISOM
- } else {
- u32 count;
- GF_ISOFile *isom = gf_isom_open(wpack->package_path, GF_ISOM_OPEN_READ, 0);
- if (!isom ) return;
-
- count = gf_isom_get_meta_item_count(isom, GF_TRUE, 0);
- for (i=0; i<count; i++) {
- u32 ID;
- const char *url, *urn, *enc;
- Bool self_ref;
- const char *item_name;
-
- gf_isom_get_meta_item_info(isom, GF_TRUE, 0, i+1, &ID, NULL, NULL, &self_ref, &item_name, NULL, &enc, &url, &urn);
- if (strcmp(res->inner_path, item_name)) continue;
-
- gf_isom_extract_meta_item(isom, GF_TRUE, 0, ID, res->extracted_path);
- res->extracted = GF_TRUE;
- break;
- }
- gf_isom_close(isom);
-#endif /*GPAC_DISABLE_ISOM*/
- }
-
-}
-
-static Bool package_find_res(GF_WidgetPackage *wpack, char *res_path, char *relocated_path, char *localized_rel_path)
-{
- u32 count, i;
- count = gf_list_count(wpack->resources);
- for (i=0; i<count; i++) {
- GF_WidgetPackageResource *pack_res = (GF_WidgetPackageResource*)gf_list_get(wpack->resources, i);
- if (is_same_path(res_path, pack_res->inner_path, 0)) {
- strcpy(localized_rel_path, res_path);
- strcpy(relocated_path, pack_res->extracted_path);
- if (!pack_res->extracted) widget_package_extract_file(wpack, pack_res);
- return GF_TRUE;
- }
- }
- return GF_FALSE;
-}
-
-/* Checks if a resource in the package has the given rel_path, potentially in a localized sub-folder */
-static Bool widget_package_relocate_uri(void *__self, const char *parent_uri, const char *rel_path, char *relocated_path, char *localized_rel_path)
-{
- char path[GF_MAX_PATH];
- const char *opt;
- GF_WidgetPackage *wpack = (GF_WidgetPackage *)__self;
-
- assert(parent_uri);
- /*resource belongs to our archive*/
- if (strstr(rel_path, wpack->archive_id)) {
- rel_path = strstr(rel_path, wpack->archive_id) + strlen(wpack->archive_id);
- }
- /*parent resource belongs to our archive*/
- else if (strstr(parent_uri, wpack->archive_id)) {
- }
- /*resource doesn't belong to our archive*/
- else {
- return GF_FALSE;
- }
-
- /* First try to locate the resource in the locales folder */
- opt = gf_opts_get_key("core", "lang");
- if (opt) {
- if (!strcmp(opt, "*") || !strcmp(opt, "un") )
- opt = NULL;
- }
-
- while (opt) {
- char lan[100];
- char *sep;
- char *sep_lang = strchr(opt, ';');
- if (sep_lang) sep_lang[0] = 0;
-
- while (strchr(" \t", opt[0]))
- opt++;
- strcpy(lan, opt);
-
- if (sep_lang) {
- sep_lang[0] = ';';
- opt = sep_lang+1;
- } else {
- opt = NULL;
- }
-
- while (1) {
- sep = strstr(lan, "-*");
- if (!sep) break;
- strncpy(sep, sep+2, strlen(sep)-2);
- }
-
- sprintf(path, "locales/%s/%s", lan, rel_path);
- if (package_find_res(wpack, path, relocated_path, localized_rel_path))
- return GF_TRUE;
-
- /*recursively remove region (sub)tags*/
- while (1) {
- sep = strrchr(lan, '-');
- if (!sep) break;
- sep[0] = 0;
- sprintf(path, "locales/%s/%s", lan, rel_path);
- if (package_find_res(wpack, path, relocated_path, localized_rel_path))
- return GF_TRUE;
- }
- }
-
- /*no locale*/
- if (package_find_res(wpack, (char*)rel_path, relocated_path, localized_rel_path))
- return GF_TRUE;
-
- strcpy(localized_rel_path, "");
- strcpy(relocated_path, "");
- return GF_FALSE;
-}
-
-
-static GF_WidgetPackage *widget_isom_new(GF_WidgetManager *wm, const char *path)
-{
-#ifdef GPAC_DISABLE_ISOM
- GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[Widgetman] GPAC was compiled without ISO File Format support\n"));
- return NULL;
-#else
- GF_WidgetPackageResource *pack_res;
- char szPath[GF_MAX_PATH];
- const char *dir;
- GF_WidgetPackage *wzip;
- u32 brand = 0;
- u32 i, count;
- GF_ISOFile *isom = gf_isom_open(path, GF_ISOM_OPEN_READ, 0);
- if (!isom ) return NULL;
-
- brand = gf_isom_get_meta_type(isom, GF_TRUE, 0);
- if ((brand!=GF_4CC('m','w','g','t') ) || !gf_isom_has_meta_xml(isom, GF_TRUE, 0) ) {
- gf_isom_close(isom);
- return NULL;
- }
-
- GF_SAFEALLOC(wzip, GF_WidgetPackage);
- if (!wzip) return NULL;
-
- wzip->wm = wm;
- wzip->relocate_uri = widget_package_relocate_uri;
- wzip->resources = gf_list_new();
- dir = gf_opts_get_key("core", "cache");
- /* create the extracted path for the package root using:
- the cache dir + a CRC of the file path and the instance*/
- sprintf(wzip->root_extracted_path, "%s%p", path, wzip);
- i = gf_crc_32((char *)wzip->root_extracted_path, (u32) strlen(wzip->root_extracted_path));
- sprintf(wzip->archive_id, "GWM_%08X_", i);
- sprintf(wzip->root_extracted_path, "%s/%s", dir, wzip->archive_id);
-
-
- strcpy(szPath, wzip->root_extracted_path);
- strcat(szPath, "config.xml");
- if (gf_isom_extract_meta_xml(isom, GF_TRUE, 0, szPath, NULL) != GF_OK) {
- gf_list_del(wzip->resources);
- gf_free(wzip);
- gf_isom_close(isom);
- return NULL;
- }
-
- wzip->package_path = gf_strdup(path);
-
- GF_SAFEALLOC(pack_res, GF_WidgetPackageResource);
- if (!pack_res) {
- gf_list_del(wzip->resources);
- gf_free(wzip);
- gf_isom_close(isom);
- return NULL;
- }
- pack_res->extracted_path = gf_strdup(szPath);
- pack_res->inner_path = gf_strdup("config.xml");
- pack_res->extracted = GF_TRUE;
- gf_list_add(wzip->resources, pack_res);
-
-
- count = gf_isom_get_meta_item_count(isom, GF_TRUE, 0);
- for (i=0; i<count; i++) {
- u32 ID;
- const char *url, *urn, *enc;
- Bool self_ref;
- char *sep;
- const char *item_name;
-
- gf_isom_get_meta_item_info(isom, GF_TRUE, 0, i+1, &ID, NULL, NULL, &self_ref, &item_name, NULL, &enc, &url, &urn);
-
- sep = strrchr(item_name, '/');
- if (!sep) sep = strrchr(item_name, '\\');
- if (sep) {
- sep[0] = 0;
- sprintf(szPath, "%s_%08X_%s", wzip->root_extracted_path, gf_crc_32((char*)item_name, (u32) strlen(item_name)), sep+1);
- sep[0] = '/';
- } else {
- strcpy(szPath, wzip->root_extracted_path);
- strcat(szPath, item_name);
- }
- GF_SAFEALLOC(pack_res, GF_WidgetPackageResource);
- if (!pack_res) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[WidgetMan] Failed to allocate widget resource\n"));
- continue;
- }
- pack_res->extracted_path = gf_strdup(szPath);
- pack_res->inner_path = gf_strdup(item_name);
- pack_res->extracted = GF_FALSE;
- gf_list_add(wzip->resources, pack_res);
- }
- gf_isom_close(isom);
-
-
- /* register this widget package as a relocator to enable localization of resources inside this package */
- gf_mx_p(wm->term->net_mx);
- gf_list_add(wm->term->uri_relocators, wzip);
- gf_mx_v(wm->term->net_mx);
- return wzip;
-#endif /*GPAC_DISABLE_ISOM*/
-}
-
-static GF_WidgetPackage *widget_zip_new(GF_WidgetManager *wm, const char *path)
-{
- unz_global_info gi;
- const char *dir;
- u32 i;
- GF_WidgetPackage *wzip;
- unzFile uf = unzOpen2(path, NULL);
- if (!uf) return NULL;
-
- GF_SAFEALLOC(wzip, GF_WidgetPackage);
- if (!wzip) return NULL;
-
- wzip->wm = wm;
- wzip->is_zip = GF_TRUE;
- wzip->relocate_uri = widget_package_relocate_uri;
- wzip->resources = gf_list_new();
- wzip->package_path = gf_strdup(path);
- dir = gf_opts_get_key("core", "cache");
- /* create the extracted path for the package root using:
- the cache dir + a CRC of the file path and the instance*/
- sprintf(wzip->root_extracted_path, "%s%p", path, wzip);
- i = gf_crc_32((char *)wzip->root_extracted_path, (u32) strlen(wzip->root_extracted_path));
- sprintf(wzip->archive_id, "GWM_%08X_", i);
- sprintf(wzip->root_extracted_path, "%s/%s", dir, wzip->archive_id);
-
- unzGetGlobalInfo(uf, &gi);
- for (i=0; i<gi.number_entry; i++) {
- char szPath[GF_MAX_PATH];
- char *sep;
- GF_WidgetPackageResource *pack_res;
- char filename_inzip[256];
- unz_file_info file_info;
- unzGetCurrentFileInfo(uf, &file_info, filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
-
- sep = strrchr(filename_inzip, '/');
- if (!sep) sep = strrchr(filename_inzip, '\\');
- if (sep) {
- sep[0] = 0;
- sprintf(szPath, "%s_%08X_%s", wzip->root_extracted_path, gf_crc_32(filename_inzip, (u32) strlen(filename_inzip)), sep+1);
- sep[0] = '/';
- } else {
- strcpy(szPath, wzip->root_extracted_path);
- strcat(szPath, filename_inzip);
- }
-
-
- if (!strcmp(filename_inzip, "config.xml")) {
- int err;
- char buf[8192];
- FILE *fout;
- unzOpenCurrentFile3(uf, NULL, NULL, 0, NULL/*password*/);
-
- fout=gf_fopen(szPath,"wb");
- if (!fout) return NULL;
-
- do {
- err = unzReadCurrentFile(uf,buf,8192);
- if (err<0) break;
-
- if (err>0)
- if (gf_fwrite(buf,err,1,fout)!=1) {
- err=UNZ_ERRNO;
- break;
- }
- } while (err>0);
- if (fout) gf_fclose(fout);
- if (err==0) {
- GF_SAFEALLOC(pack_res, GF_WidgetPackageResource);
- if (!pack_res) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[WidgetMan] Failed to allocate widget resource\n"));
- continue;
- }
-
- pack_res->extracted_path = gf_strdup(szPath);
- pack_res->inner_path = gf_strdup(filename_inzip);
- pack_res->extracted = GF_TRUE;
- gf_list_add(wzip->resources, pack_res);
- }
- } else {
- GF_SAFEALLOC(pack_res, GF_WidgetPackageResource);
- if (!pack_res) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[WidgetMan] Failed to allocate widget resource\n"));
- continue;
- }
- pack_res->extracted_path = gf_strdup(szPath);
- pack_res->inner_path = gf_strdup(filename_inzip);
- pack_res->extracted = GF_FALSE;
- gf_list_add(wzip->resources, pack_res);
- }
-
- if ((i+1)<gi.number_entry)
- unzGoToNextFile(uf);
- }
- unzClose(uf);
-
- /* register this widget package as a relocator to enable localization of resources inside this package */
- gf_mx_p(wm->term->net_mx);
- gf_list_add(wm->term->uri_relocators, wzip);
- gf_mx_v(wm->term->net_mx);
- return wzip;
-}
-
-GF_WidgetPackage *widget_package_new(GF_WidgetManager *wm, const char *path)
-{
- if (gf_unzip_probe(path)) {
- return widget_zip_new(wm, path);
- }
-#ifndef GPAC_DISABLE_ISOM
- /*ISOFF-based packaged widget */
- else if (gf_isom_probe_file(path)) {
- return widget_isom_new(wm, path);
- }
-#endif
- return NULL;
-}
-
-static void widget_package_del(GF_WidgetManager *wm, GF_WidgetPackage *wpackage)
-{
- gf_mx_p(wm->term->net_mx);
- gf_list_del_item(wm->term->uri_relocators, wpackage);
- gf_mx_v(wm->term->net_mx);
-
- while (gf_list_count(wpackage->resources)) {
- GF_WidgetPackageResource *wu = (GF_WidgetPackageResource*)gf_list_get(wpackage->resources, 0);
- gf_list_rem(wpackage->resources, 0);
- gf_delete_file(wu->extracted_path);
- gf_free(wu->extracted_path);
- gf_free(wu->inner_path);
- gf_free(wu);
- }
- gf_list_del(wpackage->resources);
- if (wpackage->sess) gf_dm_sess_del(wpackage->sess);
- gf_free(wpackage->package_path);
- gf_free(wpackage);
-}
-
-
-
-static void wm_delete_message_param(GF_WidgetPin *mp)
-{
- if (!mp) return;
- if (mp->node) gf_free(mp->node);
- if (mp->attribute) gf_free(mp->attribute);
- if (mp->default_value) gf_free(mp->default_value);
- if (mp->name) gf_free(mp->name);
- gf_free(mp);
-}
-
-static void wm_delete_widget_content(GF_WidgetContent *content)
-{
- if (!content) return;
-
- while (gf_list_count(content->interfaces)) {
- GF_WidgetInterface *ifce = (GF_WidgetInterface*)gf_list_last(content->interfaces);
- gf_list_rem_last(content->interfaces);
-
- while (gf_list_count(ifce->messages)) {
- GF_WidgetMessage *msg = (GF_WidgetMessage*)gf_list_last(ifce->messages);
- gf_list_rem_last(ifce->messages);
-
- while (gf_list_count(msg->params)) {
- GF_WidgetPin *par = (GF_WidgetPin*)gf_list_last(msg->params);
- gf_list_rem_last(msg->params);
- wm_delete_message_param(par);
- }
- gf_list_del(msg->params);
-
- wm_delete_message_param(msg->input_action);
- wm_delete_message_param(msg->output_trigger);
- gf_free(msg->name);
- gf_free(msg);
- }
- gf_list_del(ifce->messages);
- wm_delete_message_param(ifce->bind_action);
- wm_delete_message_param(ifce->unbind_action);
- if (ifce->obj) gf_js_remove_root(ifce->content->widget->wm->ctx, &ifce->obj, GF_JSGC_OBJECT);
-
- if (ifce->connectTo) gf_free(ifce->connectTo);
- gf_free(ifce->type);
- gf_free(ifce);
- }
- gf_list_del(content->interfaces);
-
- while (gf_list_count(content->components)) {
- GF_WidgetComponent *comp = (GF_WidgetComponent*)gf_list_last(content->components);
- gf_list_rem_last(content->components);
-
- wm_delete_message_param(comp->activateTrigger);
- wm_delete_message_param(comp->deactivateTrigger);
-
- while (gf_list_count(comp->required_interfaces)) {
- char *type = (char*)gf_list_last(comp->required_interfaces);
- gf_list_rem_last(comp->required_interfaces);
- if (type) gf_free(type);
- }
- gf_list_del(comp->required_interfaces);
- if (comp->id) gf_free(comp->id);
- if (comp->src) gf_free(comp->src);
- gf_free(comp);
- }
- gf_list_del(content->components);
-
- while (gf_list_count(content->preferences)) {
- GF_WidgetPreference *pref = (GF_WidgetPreference*)gf_list_last(content->preferences);
- gf_list_rem_last(content->preferences);
-
- wm_delete_message_param(pref->connectTo);
- if (pref->value) gf_free(pref->value);
- gf_free(pref->name);
- gf_free(pref);
- }
- gf_list_del(content->preferences);
-
- wm_delete_message_param(content->saveTrigger);
- wm_delete_message_param(content->restoreTrigger);
- wm_delete_message_param(content->savedAction);
- wm_delete_message_param(content->restoredAction);
-
- gf_free(content->src);
- gf_free(content->relocated_src);
- gf_free(content->mimetype);
- gf_free(content->encoding);
- gf_free(content);
-}
-
-static void wm_delete_widget(GF_WidgetManager *wm, GF_Widget *wid)
-{
- gf_list_del_item(wm->widgets, wid);
-
- if (wid->url) gf_free(wid->url);
- if (wid->manifest_path) gf_free(wid->manifest_path);
- wm_delete_widget_content(wid->main);
- if (wid->local_path) gf_free(wid->local_path);
- if (wid->name) gf_free(wid->name);
- if (wid->shortname) gf_free(wid->shortname);
- if (wid->identifier) gf_free(wid->identifier);
- if (wid->authorName) gf_free(wid->authorName);
- if (wid->authorEmail) gf_free(wid->authorEmail);
- if (wid->authorHref) gf_free(wid->authorHref);
- if (wid->description) gf_free(wid->description);
- if (wid->license) gf_free(wid->license);
- if (wid->licenseHref) gf_free(wid->licenseHref);
- if (wid->viewmodes) gf_free(wid->viewmodes);
- if (wid->version) gf_free(wid->version);
- if (wid->uuid) gf_free(wid->uuid);
-
-
- while (gf_list_count(wid->icons)) {
- GF_WidgetContent *icon = (GF_WidgetContent*)gf_list_get(wid->icons, 0);
- gf_list_rem(wid->icons, 0);
- wm_delete_widget_content(icon);
- }
- gf_list_del(wid->icons);
-
- while (gf_list_count(wid->features)) {
- GF_WidgetFeature *f = (GF_WidgetFeature*)gf_list_get(wid->features, 0);
- gf_list_rem(wid->features, 0);
- if (f->name) gf_free(f->name);
- while (gf_list_count(f->params)) {
- GF_WidgetFeatureParam *p = (GF_WidgetFeatureParam*)gf_list_get(f->params, 0);
- gf_list_rem(f->params, 0);
- if (p->name) gf_free(p->name);
- if (p->value) gf_free(p->value);
- gf_free(p);
- }
- gf_free(f);
- }
- gf_list_del(wid->features);
-
- if (wid->wpack) widget_package_del(wm, wid->wpack);
- gf_free(wid);
-}
-
-static void wm_delete_interface_instance(GF_WidgetManager *wm, GF_WidgetInterfaceInstance *bifce)
-{
- if (bifce->hostname) gf_free(bifce->hostname);
- if (bifce->obj) {
- SMJS_SET_PRIVATE(wm->ctx, bifce->obj, NULL);
- gf_js_remove_root(wm->ctx, &bifce->obj, GF_JSGC_OBJECT);
- }
- gf_free(bifce);
-}
-
-static void wm_delete_widget_instance(GF_WidgetManager *wm, GF_WidgetInstance *widg)
-{
-
- while (gf_list_count(widg->components)) {
- GF_WidgetComponentInstance *comp = (GF_WidgetComponentInstance*)gf_list_get(widg->components, 0);
- gf_list_rem(widg->components, 0);
- if (comp->wid) wm_delete_widget_instance(wm, comp->wid);
- gf_free(comp);
- }
- gf_list_del(widg->components);
-
- while (gf_list_count(widg->bound_ifces)) {
- GF_WidgetInterfaceInstance *bifce = (GF_WidgetInterfaceInstance*)gf_list_get(widg->bound_ifces, 0);
- gf_list_rem(widg->bound_ifces, 0);
- wm_delete_interface_instance(wm, bifce);
- }
- gf_list_del(widg->bound_ifces);
-
- gf_list_del(widg->output_triggers);
-
- if (widg->obj) {
- SMJS_SET_PRIVATE(wm->ctx, widg->obj, NULL);
- gf_js_remove_root(wm->ctx, &widg->obj, GF_JSGC_OBJECT);
- }
- gf_list_del_item(wm->widget_instances, widg);
- widg->widget->nb_instances--;
- if (!widg->widget->nb_instances) wm_delete_widget(wm, widg->widget);
-
- if (!widg->permanent) {
- gf_cfg_del_section(wm->term->user->config, (const char *)widg->secname);
- gf_cfg_set_key(wm->term->user->config, "Widgets", (const char *)widg->secname, NULL);
- }
- if (widg->mpegu_context) gf_xml_dom_del(widg->mpegu_context);
-
- gf_free(widg);
-}
-
-
-
-static JSBool wm_widget_call_script(GF_WidgetInstance *wid, GF_WidgetPin *pin, uintN argc, jsval *argv, jsval *rval)
-{
- jsval fval;
- if (!wid->scene_context || !wid->scene_global) return JS_FALSE;
-
- /*if on_load property is assigned to this widget, add an event listener on the root.*/
- JS_LookupProperty(wid->scene_context, wid->scene_global, pin->node, &fval);
- if (JSVAL_IS_OBJECT(fval)) {
- JS_CallFunctionValue(wid->scene_context, wid->scene_global, fval, argc, argv, rval);
- }
- return JS_TRUE;
-}
-
-static JSBool wm_widget_set_scene_input_value(JSContext *c, JSObject *obj, uintN argc, jsval *argv, jsval *rval, u32 type, GF_WidgetInstance *wid, GF_WidgetPin *param, const char *value)
-{
- char *str_val;
- GF_Node *n;
- GF_FieldInfo info;
- GF_WidgetMessage *msg;
- GF_WidgetInterface *ifce;
-
- if (!wid && obj) wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid) return JS_FALSE;
- if (!wid->scene) return JS_TRUE;
-
- if (!param) {
- if (!JSVAL_IS_OBJECT(argv[0])) return JS_TRUE;
-
- switch (type) {
- /*set_input*/
- case 0:
- if (argc!=2) return JS_FALSE;
- param = SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- break;
- /*call_input_action*/
- case 1:
- msg = SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- param = msg ? msg->input_action : NULL;
- break;
- /*bind_interface*/
- case 2:
- ifce = SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- param = ifce ? ifce->bind_action : NULL;
- break;
- /*unbind_interface*/
- case 3:
- ifce = SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- param = ifce ? ifce->unbind_action : NULL;
- break;
- }
- }
-
- if (!param || !param->node) return JS_TRUE;
- /*this is a script call*/
- if (!param->attribute) {
- return wm_widget_call_script(wid, param, 0, NULL, rval);
- }
-
- n = gf_sg_find_node_by_name(wid->scene, param->node);
- if (!n) return JS_TRUE;
-
- if (param->in_action) return JS_TRUE;
-
- param->in_action = GF_TRUE;
-
-#ifndef GPAC_DISABLE_SVG
- if (n->sgprivate->tag >= GF_NODE_FIRST_DOM_NODE_TAG) {
- u32 evt_type;
- if (!type) {
- char *_str_val = NULL;
- if (value) {
- str_val = (char *)value;
- } else {
- if (!JSVAL_IS_STRING(argv[1])) goto exit;
- str_val = _str_val = SMJS_CHARS(c, argv[1]);
- }
-
- /* first check if the set_input refers to an attribute name or to an event name */
- evt_type = gf_dom_event_type_by_name(param->attribute);
-
- /*events are not allowed for <input> and <output>*/
- if (evt_type == GF_EVENT_UNKNOWN) {
- /* modify an attribute */
- if (!strcmp(param->attribute, "textContent")) {
- gf_dom_set_textContent(n, (char *)str_val);
- gf_node_changed(n, NULL);
- }
- else {
- if (gf_node_get_attribute_by_name(n, param->attribute, 0, GF_TRUE, GF_FALSE, &info)==GF_OK) {
- gf_svg_parse_attribute(n, &info, (char *)str_val, 0);
- if (info.fieldType==XMLRI_datatype) gf_node_dirty_set(n, GF_SG_SVG_XLINK_HREF_DIRTY, GF_FALSE);
- gf_node_changed(n, &info);
- }
- }
- }
- SMJS_FREE(c, _str_val);
-
- } else {
- GF_DOM_Event evt;
- memset(&evt, 0, sizeof(GF_DOM_Event));
- /* first check if the set_input refers to an attribute name or to an event name */
- evt_type = gf_dom_event_type_by_name(param->attribute);
- /* launch an event */
- if (evt_type != GF_EVENT_UNKNOWN) {
- evt.type = evt_type;
- gf_dom_event_fire(n, &evt);
- } else {
- /*should we fire a DOMAttrModified event ? to clarify in the spec*/
-
- if (gf_node_get_attribute_by_name(n, param->attribute, 0, GF_TRUE, GF_FALSE, &info)==GF_OK) {
- evt.bubbles = 1;
- evt.type = GF_EVENT_ATTR_MODIFIED;
- evt.attr = &info;
- gf_dom_event_fire(n, &evt);
- }
- }
- }
- } else
-#endif
-
-
-#ifndef GPAC_DISABLE_VRML
- {
- if (gf_node_get_field_by_name(n, param->attribute, &info) != GF_OK) return JS_TRUE;
-
- if (!type) {
- char *_str_val = NULL;
- jsdouble val;
-
- switch (info.fieldType) {
- case GF_SG_VRML_SFSTRING:
- if (value) {
- str_val = (char *)value;
- } else {
- if (!JSVAL_IS_STRING(argv[1]))goto exit;
- str_val = SMJS_CHARS(c, argv[1]);
- }
- if ( ((SFString*)info.far_ptr)->buffer) gf_free(((SFString*)info.far_ptr)->buffer);
- ((SFString*)info.far_ptr)->buffer = str_val ? gf_strdup(str_val) : NULL;
- break;
- case GF_SG_VRML_SFBOOL:
- if (value) *((SFBool*)info.far_ptr) = (!strcmp(value, "true")) ? 1 : 0;
- else if (JSVAL_IS_BOOLEAN(argv[1])) *((SFBool*)info.far_ptr) = JSVAL_TO_BOOLEAN(argv[1]);
- else if (JSVAL_IS_INT(argv[1])) *((SFBool*)info.far_ptr) = JSVAL_TO_INT(argv[1]);
- else if (JSVAL_IS_STRING(argv[1])) {
- str_val = SMJS_CHARS(c, argv[1]);
- *((SFBool*)info.far_ptr) = (str_val && !strcmp(str_val, "true")) ? 1 : 0;
- SMJS_FREE(c, str_val);
- } else
- goto exit;
- break;
- case GF_SG_VRML_SFINT32:
- if (value) *((SFInt32*)info.far_ptr) = (s32) atof(value);
- else if (JSVAL_IS_INT(argv[1])) *((SFInt32*)info.far_ptr) = JSVAL_TO_INT(argv[1]);
- else if (JSVAL_IS_NUMBER(argv[1])) {
- JS_ValueToNumber(c, argv[1], &val);
- *((SFInt32*)info.far_ptr) = (s32) val;
- } else if (JSVAL_IS_STRING(argv[1])) {
- Double a_val;
- str_val = SMJS_CHARS(c, argv[1]);
- a_val = str_val ? atof(str_val) : 0;
- *((SFInt32*)info.far_ptr) = (s32) a_val;
- SMJS_FREE(c, str_val);
- } else
- goto exit;
- break;
- case GF_SG_VRML_SFFLOAT:
- if (value) *((SFFloat*)info.far_ptr) = FLT2FIX(atof(value));
- else if (JSVAL_IS_INT(argv[1])) *((SFFloat *)info.far_ptr) = INT2FIX( JSVAL_TO_INT(argv[1]) );
- else if (JSVAL_IS_NUMBER(argv[1])) {
- JS_ValueToNumber(c, argv[1], &val);
- *((SFFloat *)info.far_ptr) = FLT2FIX( val );
- } else if (JSVAL_IS_STRING(argv[1])) {
- Double a_val;
- str_val = SMJS_CHARS(c, argv[1]);
- a_val = str_val ? atof(str_val) : 0;
- *((SFFloat*)info.far_ptr) = FLT2FIX(a_val);
- SMJS_FREE(c, str_val);
- } else
- goto exit;
- break;
- case GF_SG_VRML_SFTIME:
- if (value) *((SFTime*)info.far_ptr) = atof(value);
- else if (JSVAL_IS_INT(argv[1])) *((SFTime *)info.far_ptr) = JSVAL_TO_INT(argv[1]);
- else if (JSVAL_IS_NUMBER(argv[1])) {
- JS_ValueToNumber(c, argv[1], &val);
- *((SFTime *)info.far_ptr) = val;
- } else if (JSVAL_IS_STRING(argv[1])) {
- Double a_val;
- str_val = SMJS_CHARS(c, argv[1]);
- a_val = str_val ? atof(str_val) : 0;
- *((SFTime *)info.far_ptr) = a_val;
- SMJS_FREE(c, str_val);
- } else
- goto exit;
- break;
- case GF_SG_VRML_MFSTRING:
- if (value) {
- str_val = (char *)value;
- } else {
- if (!JSVAL_IS_STRING(argv[1])) goto exit;
- str_val = _str_val = SMJS_CHARS(c, argv[1]);
- }
- if ( ((GenMFField *)info.far_ptr)->count != 1) {
- gf_sg_vrml_mf_reset(info.far_ptr, GF_SG_VRML_MFSTRING);
- gf_sg_vrml_mf_alloc(info.far_ptr, GF_SG_VRML_MFSTRING, 1);
- }
- if ( ((MFString*)info.far_ptr)->vals[0]) gf_free( ((MFString*)info.far_ptr)->vals[0] );
- ((MFString*)info.far_ptr)->vals[0] = str_val ? gf_strdup(str_val) : NULL;
-
- SMJS_FREE(c, _str_val);
- break;
- }
- }
-
- //if this is a script eventIn call directly script
- if ((n->sgprivate->tag==TAG_MPEG4_Script)
-#ifndef GPAC_DISABLE_X3D
- || (n->sgprivate->tag==TAG_X3D_Script)
-#endif
- )
- gf_sg_script_event_in(n, &info);
-
- gf_node_changed(n, &info);
-
- /*if this is an exposedField, route it*/
- if (info.eventType==GF_SG_EVENT_EXPOSED_FIELD) {
- gf_node_event_out(n, info.fieldIndex);
- }
- }
-#endif /*GPAC_DISABLE_VRML*/
-
-exit:
- param->in_action = GF_FALSE;
- return JS_TRUE;
-}
-
-
-static JSBool SMJS_FUNCTION(wm_widget_set_input)
-{
- SMJS_OBJ
- SMJS_ARGS
- SMJS_DECL_RVAL
- return wm_widget_set_scene_input_value(c, obj, argc, argv, rval, 0, NULL, NULL, NULL);
-}
-static JSBool SMJS_FUNCTION(wm_widget_call_input_action)
-{
- SMJS_OBJ
- SMJS_ARGS
- SMJS_DECL_RVAL
- return wm_widget_set_scene_input_value(c, obj, 1, argv, rval, 1, NULL, NULL, NULL);
-}
-
-
-static JSBool SMJS_FUNCTION(wm_widget_call_input_script)
-{
- GF_WidgetMessage *msg;
- GF_WidgetPin *param;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid || (argc!=2) ) return JS_FALSE;
- if (!wid->scene) return JS_TRUE;
-
- if (!JSVAL_IS_OBJECT(argv[0])) return JS_TRUE;
- msg = SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- param = msg ? msg->input_action : NULL;
- if (!param || !param->node || param->attribute) return JS_FALSE;
-
- if (JSVAL_IS_OBJECT(argv[1])) {
- jsval *args;
- JSObject *list = JSVAL_TO_OBJECT(argv[1]);
- u32 i, count;
- JS_GetArrayLength(c, list, (jsuint*) &count);
- args = (jsval*)gf_malloc(sizeof(jsval)*count);
- for (i=0; i<count; i++) {
- JS_GetElement(c, list, (jsint) i, &args[i] );
- }
-
- wm_widget_call_script(wid, param, count, args, SMJS_GET_RVAL);
-
- gf_free(args);
- }
- return JS_TRUE;
-}
-
-
-static void wm_handler_destroy(GF_Node *node, void *rs, Bool is_destroy)
-{
- if (is_destroy) {
- SVG_handlerElement *handler = (SVG_handlerElement *)node;
- if (handler->js_fun_val) {
- gf_js_remove_root(handler->js_context, &handler->js_fun_val, GF_JSGC_VAL);
- handler->js_fun_val=0;
- }
- }
-}
-
-static SVG_handlerElement *wm_create_scene_listener(GF_WidgetInstance *wid, GF_WidgetPin *param)
-{
- /*FIXME - we need to split SVG and base DOM !!*/
-#ifdef GPAC_DISABLE_SVG
- return NULL;
-#else
- u32 evt_type, att_name;
- GF_Node *listener;
- GF_FieldInfo info;
- GF_Node *n = NULL;
- SVG_handlerElement *handler;
-
- evt_type = GF_EVENT_ATTR_MODIFIED;
- n = gf_sg_find_node_by_name(wid->scene, param->node);
- if (!n)
- return NULL;
-
- att_name = 0;
-
-#ifndef GPAC_DISABLE_SVG
- if (n->sgprivate->tag >= GF_NODE_FIRST_DOM_NODE_TAG) {
- /* first check if the set_input refers to an attribute name or to an event name */
- evt_type = gf_dom_event_type_by_name(param->attribute);
- if (evt_type == GF_EVENT_UNKNOWN) {
- evt_type = GF_EVENT_ATTR_MODIFIED;
-
- /* modify textContent */
- if (!strcmp(param->attribute, "textContent")) {
- att_name = (u32) -1;
- }
- /* modify an attribute */
- else if (gf_node_get_attribute_by_name(n, param->attribute, 0, GF_TRUE, GF_FALSE, &info)==GF_OK) {
- att_name = info.fieldIndex;
- }
- else {
- return NULL;
- }
- }
- } else
-#endif
- {
- if (gf_node_get_field_by_name(n, param->attribute, &info) != GF_OK)
- return NULL;
- att_name = info.fieldIndex;
- }
-
- listener = gf_node_new(wid->scene, TAG_SVG_listener);
-
- handler = (SVG_handlerElement *) gf_node_new(wid->scene, TAG_SVG_handler);
- /*we register the handler with the listener node to avoid modifying the DOM*/
- gf_node_register((GF_Node *)handler, listener);
- gf_node_list_add_child(& ((GF_ParentNode *)listener)->children, (GF_Node*)handler);
- handler->sgprivate->UserCallback = wm_handler_destroy;
-
- /*create attributes if needed*/
- gf_node_get_attribute_by_tag(listener, TAG_XMLEV_ATT_event, GF_TRUE, GF_FALSE, &info);
- ((XMLEV_Event*)info.far_ptr)->type = evt_type;
- ((XMLEV_Event*)info.far_ptr)->parameter = att_name;
- gf_node_get_attribute_by_tag(listener, TAG_XMLEV_ATT_handler, GF_TRUE, GF_FALSE, &info);
- ((XMLRI*)info.far_ptr)->target = (GF_Node*)handler;
- gf_node_get_attribute_by_tag(listener, TAG_XMLEV_ATT_target, GF_TRUE, GF_FALSE, &info);
- ((XMLRI*)info.far_ptr)->target = n;
-
- gf_node_get_attribute_by_tag((GF_Node*)handler, TAG_XMLEV_ATT_event, GF_TRUE, GF_FALSE, &info);
- ((XMLEV_Event*)info.far_ptr)->type = evt_type;
- ((XMLEV_Event*)info.far_ptr)->parameter = att_name;
-
- gf_node_dom_listener_add((GF_Node *) n, listener);
-
- return handler;
-#endif
-}
-
-static void wm_component_activation_event(GF_Node *hdl, GF_DOM_Event *evt, GF_Node *observer, Bool unload)
-{
- JSObject *obj;
- JSContext *c;
- GF_WidgetInstance *wid;
- GF_WidgetComponent *comp;
- SVG_handlerElement *handler = (SVG_handlerElement *)hdl;
-
- c = (JSContext*)handler->js_context;
- obj = (JSObject*)handler->evt_listen_obj;
- if (!c || !obj) return;
- wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid) return;
-
- comp = (GF_WidgetComponent *)handler->js_fun;
- if (unload) {
- wm_deactivate_component(c, wid, comp, NULL);
- } else {
- wm_activate_component(c, wid, comp, GF_FALSE);
- }
-}
-static void wm_component_activate_event(GF_Node *hdl, GF_DOM_Event *evt, GF_Node *observer)
-{
- wm_component_activation_event(hdl, evt, observer, GF_FALSE);
-}
-static void wm_component_deactivate_event(GF_Node *hdl, GF_DOM_Event *evt, GF_Node *observer)
-{
- wm_component_activation_event(hdl, evt, observer, GF_TRUE);
-}
-
-static void wm_widget_set_pref_event(GF_Node *hdl, GF_DOM_Event *evt, GF_Node *observer)
-{
- char *att;
- SVG_handlerElement *handler = (SVG_handlerElement *)hdl;
- GF_WidgetInstance *wid = (GF_WidgetInstance *) handler->evt_listen_obj;
- GF_WidgetPreference *pref = (GF_WidgetPreference *) handler->js_fun;
-
- if (evt->type != GF_EVENT_ATTR_MODIFIED) return;
-
- if (evt->detail == (u32) -1) {
-#ifndef GPAC_DISABLE_SVG
- att = gf_dom_flatten_textContent(evt->target);
-#endif
- } else {
- att = gf_node_dump_attribute(evt->target, evt->attr);
- }
- if (!att) return;
- gf_cfg_set_key(wid->widget->wm->term->user->config, (const char *)wid->secname, pref->name, att);
- gf_free(att);
-}
-
-static void on_widget_activated(JSContext *c, JSObject *obj)
-{
- jsval funval, rval;
- u32 i, count;
- GF_XMLNode *context = NULL;
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid || wid->activated) return;
-
- /*widget is now activated*/
- wid->activated = GF_TRUE;
-
- /*for all components, setup bindings on activateTrigger & deactivateTrigger*/
- count = gf_list_count(wid->widget->main->components);
- for (i=0; i<count; i++) {
- GF_WidgetComponent *comp = (GF_WidgetComponent*)gf_list_get(wid->widget->main->components, i);
- /*setup listener*/
- if (comp->activateTrigger && comp->activateTrigger->attribute) {
- SVG_handlerElement *a_hdl = wm_create_scene_listener(wid, comp->activateTrigger);
- if (!a_hdl) return;
- a_hdl->evt_listen_obj = obj;
- a_hdl->js_context = c;
- a_hdl->js_fun = comp;
- a_hdl->handle_event = wm_component_activate_event;
- }
- /*setup listener*/
- if (comp->deactivateTrigger && comp->deactivateTrigger->attribute) {
- SVG_handlerElement *a_hdl = wm_create_scene_listener(wid, comp->deactivateTrigger);
- if (!a_hdl) continue;
- a_hdl->evt_listen_obj = obj;
- a_hdl->js_context = c;
- a_hdl->js_fun = comp;
- a_hdl->handle_event = wm_component_deactivate_event;
- }
- }
-
- if (wid->mpegu_context)
- context = gf_xml_dom_get_root(wid->mpegu_context);
-
- /*load preferences*/
- count = gf_list_count(wid->widget->main->preferences);
- for (i=0; i<count; i++) {
- const char *value;
- GF_WidgetPreference *pref = (GF_WidgetPreference*)gf_list_get(wid->widget->main->preferences, i);
-
-
- /*get stored value for this preference*/
- value = gf_opts_get_key((const char *)wid->secname, pref->name);
- /*if none found, use preference*/
- if (!value) value = pref->value;
-
- /*and overload with migrated context*/
- if (context) {
- GF_XMLNode *pref_node;
- u32 j=0;
- while ((pref_node = (GF_XMLNode*)gf_list_enum(context->content, &j))) {
- const char *att;
- if (pref_node->type != GF_XML_NODE_TYPE) continue;
- if (strcmp(pref_node->name, "preference")) continue;
- att = wm_xml_get_attr(pref_node, "name");
- if (!att) continue;
- if (strcmp(att, pref->name)) continue;
-
- att = wm_xml_get_attr(pref_node, "value");
- if (att) value = att;
- break;
- }
- }
-
- if (pref->connectTo) {
- SVG_handlerElement *hdl;
-
- if (value)
- wm_widget_set_scene_input_value(NULL, NULL, 0, 0, 0, 0, wid, pref->connectTo, value);
-
- /*preference is read only, do not setup listener*/
- if (pref->flags & GF_WM_PREF_READONLY) continue;
- /*preference is migratable only, do not setup listener*/
- if (!(pref->flags & GF_WM_PREF_SAVE)) continue;
-
- /*create the listener*/
- hdl = wm_create_scene_listener(wid, pref->connectTo);
- if (!hdl) continue;
-
- hdl->evt_listen_obj = wid;
- hdl->js_fun = pref;
- hdl->handle_event = wm_widget_set_pref_event;
-
- }
- }
- if (count && wid->widget->main->restoredAction) {
- wm_widget_set_scene_input_value(wid->widget->wm->ctx, wid->obj, 0, NULL, &rval, 0, wid, wid->widget->main->restoredAction, NULL);
- }
-
- if (wid->mpegu_context) {
- gf_xml_dom_del(wid->mpegu_context);
- wid->mpegu_context = NULL;
- }
-
- gf_sg_lock_javascript(wid->widget->wm->ctx, GF_TRUE);
- /*refresh all interface bindings*/
- JS_LookupProperty(wid->widget->wm->ctx, wid->widget->wm->obj, "check_bindings", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- JS_CallFunctionValue(wid->widget->wm->ctx, wid->widget->wm->obj, funval, 0, 0, &rval);
- }
-
- /*if on_load property is assigned to this widget, call it.*/
- JS_LookupProperty(c, obj, "on_load", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- JS_CallFunctionValue(wid->widget->wm->ctx, wid->obj, funval, 0, 0, &rval);
- }
- gf_sg_lock_javascript(wid->widget->wm->ctx, GF_FALSE);
-}
-
-
-static void wm_widget_load_event(GF_Node *hdl, GF_DOM_Event *evt, GF_Node *observer)
-{
- JSObject *obj;
- JSContext *c;
- SVG_handlerElement *handler = (SVG_handlerElement *)hdl;
-
- c = (JSContext*)handler->js_context;
- obj = (JSObject*)handler->evt_listen_obj;
- if (!c || !obj) return;
-
- on_widget_activated(c, obj);
-}
-
-
-static JSBool SMJS_FUNCTION(wm_widget_activate)
-{
-#ifndef GPAC_DISABLE_SVG
- SVG_handlerElement *handler;
-#endif
- GF_MediaObject *mo;
- Bool direct_trigger = GF_FALSE;
- MFURL url;
- SFURL _url;
- GF_Node *inl;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid || !argc) return JS_FALSE;
-
- if (!JSVAL_IS_OBJECT(argv[0])) return JS_FALSE;
-
- inl = gf_sg_js_get_node(c, JSVAL_TO_OBJECT(argv[0]) );
- if (!inl) return JS_FALSE;
-
- _url.OD_ID = 0;
- _url.url = gf_url_concatenate(wid->widget->url, wid->widget->main->relocated_src);
- url.count = 1;
- url.vals = &_url;
- mo = gf_mo_register(inl, &url, GF_FALSE, GF_TRUE);
- if (mo) {
- wid->scene = gf_mo_get_scenegraph(mo);
- if (wid->scene && gf_sg_get_root_node(wid->scene)) direct_trigger = GF_TRUE;
- }
- if (_url.url) gf_free(_url.url);
-
- wid->anchor = inl;
-
- if (direct_trigger) {
- on_widget_activated(c, obj);
- } else {
-#ifndef GPAC_DISABLE_SVG
- handler = gf_dom_listener_build(inl, GF_EVENT_SCENE_ATTACHED, 0);
- handler->handle_event = wm_widget_load_event;
- handler->js_context = c;
- handler->evt_listen_obj = obj;
-#endif
- }
-
- return JS_TRUE;
-}
-
-
-static void wm_handle_dom_event(GF_Node *hdl, GF_DOM_Event *event, GF_Node *observer)
-{
- GF_FieldInfo info;
- GF_Node *n;
- jsval argv[1], rval, jsfun;
- SVG_handlerElement *handler = (SVG_handlerElement *) hdl;
- GF_WidgetPin *param = (GF_WidgetPin*)handler->js_fun;
- GF_WidgetInstance *wid = (GF_WidgetInstance *)handler->evt_listen_obj;
-
- if (!wid->scene)
- return;
-
- n = gf_sg_find_node_by_name(wid->scene, param->node);
- if (!n) return;
-
- /*this is a regular event output*/
- if (event->type != GF_EVENT_ATTR_MODIFIED) {
- jsfun = (jsval) handler->js_fun_val;
- if (JSVAL_IS_OBJECT(jsfun))
- JS_CallFunctionValue(handler->js_context, wid->obj, (jsval) handler->js_fun_val, 0, 0, &rval);
- return;
- }
-
- /*otherwise this is a node.attr output through DOMAttributeModified*/
- argv[0] = JSVAL_NULL;
-
-#ifndef GPAC_DISABLE_SVG
- if (n->sgprivate->tag >= GF_NODE_FIRST_DOM_NODE_TAG) {
- if (!strcmp(param->attribute, "textContent")) {
- char *txt = gf_dom_flatten_textContent(n);
- argv[0] = STRING_TO_JSVAL( JS_NewStringCopyZ(handler->js_context, txt ? txt : "") );
- if (txt) gf_free(txt);
- } else if (gf_node_get_attribute_by_name(n, param->attribute, 0, GF_TRUE, GF_FALSE, &info)==GF_OK) {
- char *attValue;
- if (event->attr->fieldIndex != info.fieldIndex) return;
-
- attValue = gf_node_dump_attribute(n, &info);
- argv[0] = STRING_TO_JSVAL( JS_NewStringCopyZ(handler->js_context, attValue) );
- if (attValue) gf_free(attValue);
- } else {
- return;
- }
- } else
-#endif
- {
- if (gf_node_get_field_by_name(n, param->attribute, &info) != GF_OK) return;
- if (event->attr->fieldIndex != info.fieldIndex) return;
-
- switch (info.fieldType) {
- case GF_SG_VRML_SFSTRING:
- argv[0] = STRING_TO_JSVAL( JS_NewStringCopyZ(handler->js_context, ((SFString*)info.far_ptr)->buffer ) );
- break;
- case GF_SG_VRML_SFINT32:
- argv[0] = INT_TO_JSVAL( *((SFInt32*)info.far_ptr) );
- break;
- case GF_SG_VRML_SFBOOL:
- argv[0] = BOOLEAN_TO_JSVAL( *((SFBool*)info.far_ptr) );
- break;
- case GF_SG_VRML_SFFLOAT:
- argv[0] = DOUBLE_TO_JSVAL( JS_NewDouble(handler->js_context, FIX2FLT( *((SFFloat*)info.far_ptr) ) ) );
- break;
- case GF_SG_VRML_SFTIME:
- argv[0] = DOUBLE_TO_JSVAL( JS_NewDouble(handler->js_context, *((SFTime *)info.far_ptr) ) );
- break;
- }
- }
-
- jsfun = (jsval) handler->js_fun_val;
- if (JSVAL_IS_OBJECT(jsfun))
- JS_CallFunctionValue(handler->js_context, wid->obj, (jsval) handler->js_fun_val, 1, argv, &rval);
-}
-
-static JSBool SMJS_FUNCTION(wm_widget_get_param_value)
-{
- GF_Node *n;
- GF_FieldInfo info;
- GF_WidgetPin *param;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid || !wid->scene || !argc || !JSVAL_IS_OBJECT(argv[0]) ) return JS_FALSE;
-
- param = SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- if (!param) return JS_FALSE;
-
- if (!param->node) {
- if (param->default_value) {
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, param->default_value) ) );
- return JS_TRUE;
- }
- return JS_FALSE;
- }
-
- n = gf_sg_find_node_by_name(wid->scene, param->node);
- if (!n) return JS_FALSE;
-
-#ifndef GPAC_DISABLE_SVG
- if (n->sgprivate->tag >= GF_NODE_FIRST_DOM_NODE_TAG) {
- if (!strcmp(param->attribute, "textContent")) {
- char *txt = gf_dom_flatten_textContent(n);
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, txt ? txt : "") ));
- if (txt) gf_free(txt);
- } else if (gf_node_get_attribute_by_name(n, param->attribute, 0, GF_TRUE, GF_FALSE, &info)==GF_OK) {
- char *attValue = gf_node_dump_attribute(n, &info);
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, attValue) ));
- if (attValue) gf_free(attValue);
- } else {
- return JS_FALSE;
- }
- } else
-#endif
- {
- if (gf_node_get_field_by_name(n, param->attribute, &info) != GF_OK) return JS_FALSE;
-
- switch (info.fieldType) {
- case GF_SG_VRML_SFSTRING:
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, ((SFString*)info.far_ptr)->buffer ) ) );
- break;
- case GF_SG_VRML_SFINT32:
- SMJS_SET_RVAL( INT_TO_JSVAL( *((SFInt32*)info.far_ptr) ));
- break;
- case GF_SG_VRML_SFBOOL:
- SMJS_SET_RVAL(BOOLEAN_TO_JSVAL( *((SFBool*)info.far_ptr) ));
- break;
- case GF_SG_VRML_SFFLOAT:
- SMJS_SET_RVAL( DOUBLE_TO_JSVAL( JS_NewDouble(c, FIX2FLT( *((SFFloat*)info.far_ptr) ) ) ));
- break;
- case GF_SG_VRML_SFTIME:
- SMJS_SET_RVAL( DOUBLE_TO_JSVAL( JS_NewDouble(c, *((SFTime *)info.far_ptr) ) ));
- break;
- }
- }
-
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_widget_get_message_param)
-{
- GF_WidgetPin *par = NULL;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetMessage *msg = (GF_WidgetMessage *)SMJS_GET_PRIVATE(c, obj);
- if (!msg || !argc ) return JS_FALSE;
-
- if (JSVAL_IS_INT(argv[0])) {
- u32 idx = JSVAL_TO_INT(argv[0]);
- par = gf_list_get(msg->params, idx);
- } else if (JSVAL_IS_STRING(argv[0])) {
- u32 i, count = gf_list_count(msg->params);
- char *name = SMJS_CHARS(c, argv[0]);
- for (i=0; i<count; i++) {
- par = gf_list_get(msg->params, i);
- if (!strcmp(par->name, name)) break;
- par = NULL;
- }
- SMJS_FREE(c, name);
- }
-
- if (par) {
- JSObject *obj = JS_NewObject(c, &msg->ifce->content->widget->wm->widgetAnyClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, obj, par);
- JS_DefineProperty(c, obj, "name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, par->name) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, obj, "is_input", BOOLEAN_TO_JSVAL( (par->type == GF_WM_PARAM_OUTPUT) ? JS_FALSE : JS_TRUE), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- switch (par->script_type) {
- case GF_WM_PARAM_SCRIPT_BOOL:
- JS_DefineProperty(c, obj, "script_type", STRING_TO_JSVAL( JS_NewStringCopyZ(c, "boolean") ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- break;
- case GF_WM_PARAM_SCRIPT_NUMBER:
- JS_DefineProperty(c, obj, "script_type", STRING_TO_JSVAL( JS_NewStringCopyZ(c, "number") ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- break;
- case GF_WM_PARAM_SCRIPT_STRING:
- default:
- JS_DefineProperty(c, obj, "script_type", STRING_TO_JSVAL( JS_NewStringCopyZ(c, "string") ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- break;
- }
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(obj) );
- }
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_widget_get_message)
-{
- GF_WidgetMessage *msg;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInterface *ifce = (GF_WidgetInterface*)SMJS_GET_PRIVATE(c, obj);
- if (!ifce || !argc) return JS_FALSE;
- msg = NULL;
-
- if (JSVAL_IS_INT(argv[0])) {
- u32 idx;
- idx = JSVAL_TO_INT(argv[0]);
- msg = (GF_WidgetMessage*)gf_list_get(ifce->messages, idx);
- } else if (JSVAL_IS_STRING(argv[0])) {
- u32 i, count = gf_list_count(ifce->messages);
- char *name = SMJS_CHARS(c, argv[0]);
- for (i=0; i<count; i++) {
- msg = (GF_WidgetMessage*)gf_list_get(ifce->messages, i);
- if (!strcmp(msg->name, name)) break;
- msg = NULL;
- }
- SMJS_FREE(c, name);
- }
- if (msg) {
- JSObject *obj = JS_NewObject(c, &ifce->content->widget->wm->widgetAnyClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, obj, msg);
- JS_DefineProperty(c, obj, "num_params", INT_TO_JSVAL( gf_list_count(msg->params) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, obj, "name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, msg->name) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, obj, "is_input", BOOLEAN_TO_JSVAL( msg->is_output ? JS_FALSE : JS_TRUE ) , 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, obj, "has_output_trigger", BOOLEAN_TO_JSVAL( msg->output_trigger ? JS_TRUE : JS_FALSE) , 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, obj, "has_input_action", BOOLEAN_TO_JSVAL( (msg->input_action && msg->input_action->attribute) ? JS_TRUE : JS_FALSE) , 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, obj, "has_script_input", BOOLEAN_TO_JSVAL( (msg->input_action && !msg->input_action->attribute) ? JS_TRUE : JS_FALSE) , 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineFunction(c, obj, "get_param", wm_widget_get_message_param, 1, 0);
-
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(obj) );
- }
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_widget_get_component)
-{
- char *comp_id;
- u32 i, count;
- GF_WidgetComponentInstance *comp_inst;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid || !argc || !JSVAL_IS_STRING(argv[0]) ) return JS_FALSE;
-
- comp_id = SMJS_CHARS(c, argv[0]);
- count = gf_list_count(wid->components);
- for (i=0; i<count; i++) {
- comp_inst = (GF_WidgetComponentInstance*)gf_list_get(wid->components, i);
- if (comp_inst->comp->id && !strcmp(comp_inst->comp->id, comp_id)) {
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(comp_inst->wid->obj) );
- SMJS_FREE(c, comp_id);
- return JS_TRUE;
- }
- }
- /*if requested load the component*/
- if ((argc==2) && JSVAL_IS_BOOLEAN(argv[1]) && (JSVAL_TO_BOOLEAN(argv[1])==JS_TRUE) ) {
- count = gf_list_count(wid->widget->main->components);
- for (i=0; i<count; i++) {
- GF_WidgetComponent *comp = (GF_WidgetComponent*)gf_list_get(wid->widget->main->components, i);
- if (!comp->id || strcmp(comp->id, comp_id)) continue;
-
- comp_inst = wm_activate_component(c, wid, comp, GF_TRUE);
- if (comp_inst) {
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(comp_inst->wid->obj) );
- SMJS_FREE(c, comp_id);
- return JS_TRUE;
- }
- SMJS_FREE(c, comp_id);
- return JS_TRUE;
- }
- }
-
- SMJS_FREE(c, comp_id);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_widget_get_interface)
-{
- u32 idx;
- GF_WidgetInterface *ifce;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid || !argc || !JSVAL_IS_INT(argv[0]) ) return JS_FALSE;
-
- idx = JSVAL_TO_INT(argv[0]);
- ifce = (GF_WidgetInterface*)gf_list_get(wid->widget->main->interfaces, idx);
-
- if (ifce) {
- if (!ifce->obj) {
- ifce->obj = JS_NewObject(c, &wid->widget->wm->widgetAnyClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, ifce->obj, ifce);
- JS_DefineProperty(c, ifce->obj, "num_messages", INT_TO_JSVAL( gf_list_count(ifce->messages) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, ifce->obj, "type", STRING_TO_JSVAL( JS_NewStringCopyZ(c, ifce->type) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, ifce->obj, "serviceProvider", BOOLEAN_TO_JSVAL( ifce->provider ? JS_TRUE : JS_FALSE ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, ifce->obj, "multipleBinding", BOOLEAN_TO_JSVAL( ifce->multiple_binding ? JS_TRUE : JS_FALSE ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineFunction(c, ifce->obj, "get_message", wm_widget_get_message, 1, 0);
- gf_js_add_root(c, &ifce->obj, GF_JSGC_OBJECT);
- }
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(ifce->obj) );
- }
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_widget_bind_output_trigger)
-{
- GF_WidgetMessage *msg;
- GF_WidgetPin *param;
- SVG_handlerElement *handler;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
-
- SMJS_SET_RVAL( BOOLEAN_TO_JSVAL(JS_FALSE) );
- if (!wid || !wid->scene || (argc!=3)) return JS_TRUE;
-
- if (!JSVAL_IS_OBJECT(argv[0])) return JS_TRUE;
- if (!JSVAL_IS_OBJECT(argv[1])) return JS_TRUE;
- if (!JSVAL_IS_OBJECT(argv[2])) return JS_TRUE;
-
- msg = (GF_WidgetMessage *)SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]));
- if (!msg) return JS_TRUE;
- param = msg->output_trigger;
- if (!param) return JS_TRUE;
-
-
- handler = wm_create_scene_listener(wid, param);
- if (!handler) return JS_TRUE;
- handler->js_fun_val = * (u64 *) & argv[1];
- gf_js_add_root(c, &handler->js_fun_val, GF_JSGC_VAL);
- handler->evt_listen_obj = wid;
- handler->js_fun = param;
- handler->js_context = c;
- handler->handle_event = wm_handle_dom_event;
- handler->sgprivate->UserPrivate = JSVAL_TO_OBJECT(argv[2]);
-
- gf_list_add(wid->output_triggers, handler);
- SMJS_SET_RVAL( BOOLEAN_TO_JSVAL(JS_TRUE) );
-
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_widget_get_context)
-{
- GF_BitStream *bs;
- u32 i, count;
- const char *str;
- char *att;
- SMJS_OBJ
- //SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid) return JS_FALSE;
- if (!wid->scene) {
- SMJS_SET_RVAL(JSVAL_NULL);
- return JS_TRUE;
- }
-
- bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- str = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<contextInformation xmlns=\"urn:mpeg:mpegu:schema:widgets:contextinfo:2010\">\n";
- gf_bs_write_data(bs, (const char *) str, (u32) strlen(str) );
-
- count = gf_list_count(wid->widget->main->preferences);
- for (i=0; i<count; i++) {
- GF_WidgetPreference *pref = (GF_WidgetPreference*)gf_list_get(wid->widget->main->preferences, i);
-
- /*preference is read only, do not include in context*/
- if (pref->flags & GF_WM_PREF_READONLY) continue;
- /*preference is not migratable, do not include in context*/
- if (!(pref->flags & GF_WM_PREF_MIGRATE)) continue;
-
- str = " <preference name=\"";
- gf_bs_write_data(bs, (const char *) str, (u32) strlen(str) );
-
- gf_bs_write_data(bs, (const char *) pref->name, (u32) strlen(pref->name) );
-
- str = "\" value=\"";
- gf_bs_write_data(bs, (const char *) str, (u32) strlen(str) );
-
- /*read from node*/
- if (pref->connectTo && pref->connectTo->attribute) {
- GF_FieldInfo info;
- GF_Node *n = gf_sg_find_node_by_name(wid->scene, pref->connectTo->node);
- if (n) {
-
-#ifndef GPAC_DISABLE_SVG
- if ((n->sgprivate->tag >= GF_NODE_FIRST_DOM_NODE_TAG) && !strcmp(pref->connectTo->attribute, "textContent")) {
- char *txt = gf_dom_flatten_textContent(n);
- gf_bs_write_data(bs, (const char *) txt, (u32) strlen(txt) );
- } else
-#endif
- if (gf_node_get_field_by_name(n, pref->connectTo->attribute, &info)==GF_OK) {
- att = gf_node_dump_attribute(n, &info);
- if (att) {
- gf_bs_write_data(bs, (const char *) att, (u32) strlen(att) );
- gf_free(att);
- }
- }
- }
- }
- /*read from config*/
- else {
- att = (char *)gf_opts_get_key((const char *) wid->secname, pref->name);
- if (!att) att = pref->value;
-
- if (att) gf_bs_write_data(bs, (const char *) att, (u32) strlen(att) );
- }
-
- str = "\"/>\n";
- gf_bs_write_data(bs, (const char *) str, (u32) strlen(str) );
- }
- str = "</contextInformation>\n";
- gf_bs_write_data(bs, (const char *) str, (u32) strlen(str) );
-
- gf_bs_write_u8(bs, 0);
- att = NULL;
- gf_bs_get_content(bs, &att, &count);
- gf_bs_del(bs);
-
- SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, att) ) );
- gf_free(att);
-
- return JS_TRUE;
-}
-
-
-static SMJS_FUNC_PROP_GET( wm_widget_getProperty)
-
-JSString *s;
-char *prop_name;
-const char *opt;
-GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
-if (!wid) return JS_FALSE;
-
-if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
-prop_name = SMJS_CHARS_FROM_STRING(c, SMJS_ID_TO_STRING(id));
-if (!prop_name) return JS_FALSE;
-
-/*
- Manifest properties
-*/
-if (!strcmp(prop_name, "manifest")) {
- s = JS_NewStringCopyZ(c, wid->widget->manifest_path);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "url")) {
- s = JS_NewStringCopyZ(c, wid->widget->local_path ? wid->widget->local_path : wid->widget->url);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "main")) {
- s = JS_NewStringCopyZ(c, wid->widget->main->relocated_src);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "localizedSrc")) {
- s = JS_NewStringCopyZ(c, wid->widget->main->src);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "mainEncoding")) {
- s = JS_NewStringCopyZ(c, wid->widget->main->encoding);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "mainMimeType")) {
- s = JS_NewStringCopyZ(c, wid->widget->main->mimetype);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "defaultWidth")) {
- *vp = INT_TO_JSVAL(wid->widget->width);
-}
-else if (!strcmp(prop_name, "defaultHeight")) {
- *vp = INT_TO_JSVAL(wid->widget->height);
-}
-else if (!strcmp(prop_name, "icons")) {
- u32 i, count;
- JSObject *arr;
- count = gf_list_count(wid->widget->icons);
- arr = JS_NewArrayObject(c, count, NULL);
- for (i = 0; i<count; i++) {
- GF_WidgetContent *icon = (GF_WidgetContent*)gf_list_get(wid->widget->icons, i);
- if (icon) {
- char *abs_reloc_url;
- jsval icon_obj_val;
- JSObject *icon_obj = JS_NewObject(c, &wid->widget->wm->widgetAnyClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, icon_obj, icon);
- JS_DefineProperty(c, icon_obj, "src", STRING_TO_JSVAL( JS_NewStringCopyZ(c, icon->src) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- if (strlen(icon->relocated_src)) abs_reloc_url = gf_url_concatenate(wid->widget->url, icon->relocated_src);
- else abs_reloc_url = gf_strdup("");
- JS_DefineProperty(c, icon_obj, "relocated_src", STRING_TO_JSVAL( JS_NewStringCopyZ(c, abs_reloc_url) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, icon_obj, "width", INT_TO_JSVAL( icon->width ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, icon_obj, "height", INT_TO_JSVAL( icon->height ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- icon_obj_val = OBJECT_TO_JSVAL(icon_obj);
- JS_SetElement(c, arr, i, &icon_obj_val);
- gf_free(abs_reloc_url);
- }
- }
- *vp = OBJECT_TO_JSVAL(arr);
-}
-else if (!strcmp(prop_name, "preferences")) {
- u32 i, count;
- JSObject *arr;
- count = gf_list_count(wid->widget->main->preferences);
- arr = JS_NewArrayObject(c, count, NULL);
- for (i = 0; i<count; i++) {
- GF_WidgetPreference *pref = (GF_WidgetPreference*)gf_list_get(wid->widget->main->preferences, i);
- if (pref) {
- jsval pref_obj_val;
- JSObject *pref_obj = JS_NewObject(c, &wid->widget->wm->widgetAnyClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, pref_obj, pref);
- JS_DefineProperty(c, pref_obj, "name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, pref->name) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, pref_obj, "value", STRING_TO_JSVAL( JS_NewStringCopyZ(c, pref->value) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, pref_obj, "readonly", STRING_TO_JSVAL( JS_NewStringCopyZ(c, ((pref->flags & GF_WM_PREF_READONLY)?"true":"false")) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- pref_obj_val = OBJECT_TO_JSVAL(pref_obj);
- JS_SetElement(c, arr, i, &pref_obj_val);
- }
- }
- *vp = OBJECT_TO_JSVAL(arr);
-}
-else if (!strcmp(prop_name, "features")) {
- u32 i, count;
- JSObject *arr;
- count = gf_list_count(wid->widget->features);
- arr = JS_NewArrayObject(c, count, NULL);
- for (i = 0; i<count; i++) {
- GF_WidgetFeature *feat = (GF_WidgetFeature*)gf_list_get(wid->widget->features, i);
- if (feat) {
- jsval feat_obj_val;
- JSObject *feat_obj = JS_NewObject(c, &wid->widget->wm->widgetAnyClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, feat_obj, feat);
- JS_DefineProperty(c, feat_obj, "name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, feat->name) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, feat_obj, "required", BOOLEAN_TO_JSVAL( (feat->required? JS_TRUE : JS_FALSE) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- {
- u32 j, pcount;
- JSObject *params_arr;
- pcount = gf_list_count(feat->params);
- params_arr = JS_NewArrayObject(c, pcount, NULL);
- for (j=0; j < pcount; j++) {
- GF_WidgetFeatureParam *param = (GF_WidgetFeatureParam*)gf_list_get(feat->params, j);
- JSObject *param_obj = JS_NewObject(c, &wid->widget->wm->widgetAnyClass._class, 0, 0);
- jsval param_obj_val;
- SMJS_SET_PRIVATE(c, param_obj, param);
- JS_DefineProperty(c, param_obj, "name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, param->name) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- JS_DefineProperty(c, param_obj, "value", STRING_TO_JSVAL( JS_NewStringCopyZ(c, param->value) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- param_obj_val = OBJECT_TO_JSVAL(param_obj);
- JS_SetElement(c, params_arr, j, ¶m_obj_val);
- }
- JS_DefineProperty(c, feat_obj, "params", OBJECT_TO_JSVAL(params_arr), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
- }
- feat_obj_val = OBJECT_TO_JSVAL(feat_obj);
- JS_SetElement(c, arr, i, &feat_obj_val);
- }
- }
- *vp = OBJECT_TO_JSVAL(arr);
-}
-
-else if (!strcmp(prop_name, "components")) {
- u32 i, count;
- jsval val;
- JSObject *arr;
- count = gf_list_count(wid->components);
- arr = JS_NewArrayObject(c, count, NULL);
- for (i = 0; i<count; i++) {
- GF_WidgetComponentInstance *comp = (GF_WidgetComponentInstance*)gf_list_get(wid->components, i);
- val = OBJECT_TO_JSVAL(comp->wid->obj);
- JS_SetElement(c, arr, i, &val);
- }
- *vp = OBJECT_TO_JSVAL(arr);
-}
-else if (!strcmp(prop_name, "identifier")) {
- s = JS_NewStringCopyZ(c, wid->widget->identifier);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "name")) {
- s = JS_NewStringCopyZ(c, wid->widget->name);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "shortName")) {
- s = JS_NewStringCopyZ(c, wid->widget->shortname);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "authorName")) {
- s = JS_NewStringCopyZ(c, wid->widget->authorName);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "authorEmail")) {
- s = JS_NewStringCopyZ(c, wid->widget->authorEmail);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "authorHref")) {
- s = JS_NewStringCopyZ(c, wid->widget->authorHref);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "description")) {
- s = JS_NewStringCopyZ(c, wid->widget->description);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "viewmodes")) {
- if (wid->widget->viewmodes) s = JS_NewStringCopyZ(c, wid->widget->viewmodes);
- else s = JS_NewStringCopyZ(c, "");
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "license")) {
- s = JS_NewStringCopyZ(c, wid->widget->license);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "licenseHref")) {
- s = JS_NewStringCopyZ(c, wid->widget->licenseHref);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "version")) {
- s = JS_NewStringCopyZ(c, wid->widget->version);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "uuid")) {
- s = JS_NewStringCopyZ(c, wid->widget->uuid);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "discardable")) {
- *vp = BOOLEAN_TO_JSVAL( wid->widget->discardable ? JS_TRUE : JS_FALSE);
-}
-else if (!strcmp(prop_name, "multipleInstances")) {
- *vp = BOOLEAN_TO_JSVAL( wid->widget->multipleInstance ? JS_TRUE : JS_FALSE);
-}
-
-/*
- Widget Manager special properties (common to all implementations)
-*/
-else if (!strcmp(prop_name, "permanent")) {
- *vp = BOOLEAN_TO_JSVAL( wid->permanent ? JS_TRUE : JS_FALSE);
-}
-else if (!strcmp(prop_name, "is_component")) {
- *vp = BOOLEAN_TO_JSVAL( wid->parent ? JS_TRUE : JS_FALSE);
-}
-else if (!strcmp(prop_name, "parent")) {
- *vp = wid->parent ? OBJECT_TO_JSVAL(wid->parent->obj) : JSVAL_NULL;
-}
-else if (!strcmp(prop_name, "activated")) {
- *vp = BOOLEAN_TO_JSVAL( wid->activated ? JS_TRUE : JS_FALSE);
-}
-else if (!strcmp(prop_name, "section")) {
- s = JS_NewStringCopyZ(c, (const char *) wid->secname);
- *vp = STRING_TO_JSVAL(s);
-}
-else if (!strcmp(prop_name, "num_instances")) {
- *vp = INT_TO_JSVAL( wid->widget->nb_instances);
-}
-else if (!strcmp(prop_name, "num_interfaces")) {
- *vp = INT_TO_JSVAL( gf_list_count(wid->widget->main->interfaces));
-}
-else if (!strcmp(prop_name, "num_components")) {
- *vp = INT_TO_JSVAL( gf_list_count(wid->components));
-}
-else if (!strcmp(prop_name, "num_bound_interfaces")) {
- *vp = INT_TO_JSVAL( gf_list_count(wid->bound_ifces));
-}
-/*all variables used by the WidgetManager script but not stored*/
-else if (!strcmp(prop_name, "originating_device_ip")
- || !strcmp(prop_name, "originating_device")
- || !strcmp(prop_name, "device")
- ) {
-}
-/*
- Widget properties, common to each implementation
-*/
-else {
- char szName[1024];
- sprintf(szName, "WM:%s", prop_name);
- opt = gf_opts_get_key((const char *) wid->secname, szName);
- if (opt) {
- Double val=0;
- if (!strcmp(opt, "true")) *vp = BOOLEAN_TO_JSVAL(JS_TRUE);
- else if (!strcmp(opt, "false")) *vp = BOOLEAN_TO_JSVAL(JS_FALSE);
- else if (sscanf(opt, "%lf", &val)==1) {
- *vp = DOUBLE_TO_JSVAL( JS_NewDouble(c, val) );
- } else {
- s = JS_NewStringCopyZ(c, opt);
- *vp = STRING_TO_JSVAL(s);
- }
- }
-}
-SMJS_FREE(c, prop_name);
-return JS_TRUE;
-}
-
-static SMJS_FUNC_PROP_SET( wm_widget_setProperty)
-
-char szVal[32];
-jsdouble val;
-char *prop_name;
-GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
-if (!wid) return JS_FALSE;
-
-if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
-prop_name = SMJS_CHARS_FROM_STRING(c, SMJS_ID_TO_STRING(id));
-
-/*internal to WidgetManager, never stored*/
-if (!strcmp(prop_name, "permanent")) {
- wid->permanent = (JSVAL_TO_BOOLEAN(*vp)==JS_TRUE) ? GF_TRUE : GF_FALSE;
-}
-
-/*any widget properties*/
-else {
- char szName[1024], *value, *_val = NULL;
-
- if (JSVAL_IS_STRING(*vp)) {
- value = _val = SMJS_CHARS(c, *vp);
- if (!value) value = "";
- }
- else if (JSVAL_IS_BOOLEAN(*vp)) {
- strcpy(szVal, (JSVAL_TO_BOOLEAN(*vp)==JS_TRUE) ? "true" : "false");
- value = szVal;
- }
- else if (JSVAL_IS_NUMBER(*vp)) {
- JS_ValueToNumber(c, *vp, &val);
- sprintf(szVal, "%f", val);
- value = szVal;
- } else {
- SMJS_FREE(c, prop_name);
- return JS_TRUE;
- }
-
- sprintf(szName, "WM:%s", prop_name);
- gf_cfg_set_key(wid->widget->wm->term->user->config, (const char *) wid->secname, szName, value);
- SMJS_FREE(c, _val);
-}
-
-SMJS_FREE(c, prop_name);
-return JS_TRUE;
-}
-
-
-
-static JSBool wm_widget_bind_interface_ex(JSContext *c, JSObject *obj, uintN argc, jsval *argv, jsval *rval, Bool is_unbind)
-{
- u32 i, count;
- GF_WidgetInterfaceInstance *bifce;
- GF_WidgetInterface *ifce;
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid || !wid->scene) return JS_FALSE;
-
- ifce = NULL;
- if (argc) {
- if (!JSVAL_IS_OBJECT(argv[0])) return JS_FALSE;
- ifce = SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- if (!ifce) return JS_FALSE;
- }
-
- if (!is_unbind) {
- char *hostname;
- JSObject *cookie;
- if ((argc<3) || !JSVAL_IS_OBJECT(argv[1]) || !JSVAL_IS_STRING(argv[2])) return JS_FALSE;
-
- cookie = JSVAL_TO_OBJECT(argv[1]);
- hostname = SMJS_CHARS(c, argv[2]);
- count = gf_list_count(wid->bound_ifces);
- for (i=0; i<count; i++) {
- bifce = (GF_WidgetInterfaceInstance*)gf_list_get(wid->bound_ifces, i);
- if (!strcmp(bifce->ifce->type, ifce->type) && (bifce->cookie==cookie) ) {
- SMJS_FREE(c, hostname);
- return JS_TRUE;
- }
- }
- GF_SAFEALLOC(bifce, GF_WidgetInterfaceInstance);
- bifce->wid = wid;
- bifce->ifce = ifce;
- bifce->cookie = cookie;
- bifce->hostname = gf_strdup(hostname);
- SMJS_FREE(c, hostname);
- gf_list_add(wid->bound_ifces, bifce);
-
- if (ifce->bind_action) {
- return wm_widget_set_scene_input_value(c, obj, 1, argv, rval, 2, NULL, NULL, NULL);
- } else {
- widget_on_interface_bind(bifce, GF_FALSE);
- }
- } else {
- JSObject *cookie = NULL;
- if ((argc==2) && JSVAL_IS_OBJECT(argv[1])) cookie = JSVAL_TO_OBJECT(argv[1]);
-
- count = gf_list_count(wid->bound_ifces);
- for (i=0; i<count; i++) {
- bifce = (GF_WidgetInterfaceInstance*)gf_list_get(wid->bound_ifces, i);
- if (!ifce || ( !strcmp(bifce->ifce->type, ifce->type) && (bifce->cookie==cookie)) ) {
- gf_list_rem(wid->bound_ifces, i);
- if (bifce->ifce->unbind_action) {
- wm_widget_set_scene_input_value(c, NULL, 0, NULL, rval, 3, wid, bifce->ifce->unbind_action, NULL);
- } else {
- widget_on_interface_bind(bifce, GF_TRUE);
- }
- if (ifce) {
- /*unregister our message handlers*/
- count = gf_list_count(wid->output_triggers);
- for (i=0; i<count; i++) {
- u32 j, c2, found;
- GF_DOMHandler *handler = (GF_DOMHandler*)gf_list_get(wid->output_triggers, i);
- GF_WidgetPin *param = (GF_WidgetPin*)handler->js_fun;
-
- if (handler->sgprivate->UserPrivate != cookie) continue;
- found = 0;
- c2 = gf_list_count(bifce->ifce->messages);
- for (j=0; j<c2; j++) {
- GF_WidgetMessage *msg = (GF_WidgetMessage*)gf_list_get(bifce->ifce->messages, j);
- if (msg->output_trigger == param) {
- found = 1;
- break;
- }
- }
- if (found) {
-#ifndef GPAC_DISABLE_SVG
- GF_Node *listener = handler->sgprivate->parents->node;
- gf_dom_listener_del(listener, listener->sgprivate->UserPrivate);
-#endif
- gf_list_rem(wid->output_triggers, i);
- i--;
- count--;
- }
- }
- }
- wm_delete_interface_instance(wid->widget->wm, bifce);
- if (ifce) return JS_TRUE;
- i--;
- count--;
- }
- }
- }
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_widget_bind_interface)
-{
- SMJS_OBJ
- SMJS_ARGS
- SMJS_DECL_RVAL
- return wm_widget_bind_interface_ex(c, obj, argc, argv, rval, GF_FALSE);
-}
-static JSBool SMJS_FUNCTION(wm_widget_unbind_interface)
-{
- SMJS_OBJ
- SMJS_ARGS
- SMJS_DECL_RVAL
- return wm_widget_bind_interface_ex(c, obj, argc, argv, rval, GF_TRUE);
-}
-
-
-static JSBool SMJS_FUNCTION(wm_widget_deactivate)
-{
- u32 i, count;
- jsval funval;
- SMJS_OBJ
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid) return JS_FALSE;
-
- /*widget is a component of another widget, unregister*/
- if (wid->parent) {
- GF_WidgetInstance *par_wid = wid->parent;
- count = gf_list_count(par_wid->components);
- for (i=0; i<count; i++) {
- GF_WidgetComponentInstance *comp = (GF_WidgetComponentInstance*)gf_list_get(par_wid->components, i);
- if (comp->wid == wid) {
- gf_list_rem(par_wid->components, i);
- gf_free(comp);
- break;
- }
- }
- wid->parent = NULL;
- }
-
- /*remove all components*/
- while (gf_list_count(wid->components)) {
- GF_WidgetComponentInstance *comp = (GF_WidgetComponentInstance*)gf_list_get(wid->components, 0);
- wm_deactivate_component(c, wid, NULL, comp);
- gf_list_rem(wid->components, 0);
- }
-
- /*mark the widget as deactivated, so it is no longer valid when checking all widgets bindings*/
- wid->activated = GF_FALSE;
-
- /*unbind existing widgets*/
- JS_LookupProperty(wid->widget->wm->ctx, wid->widget->wm->obj, "unbind_widget", &funval);
- if (JSVAL_IS_OBJECT(funval)) {
- jsval an_argv[1];
- an_argv[0] = OBJECT_TO_JSVAL(obj);
- JS_CallFunctionValue(wid->widget->wm->ctx, wid->widget->wm->obj, funval, 1, an_argv, SMJS_GET_RVAL );
- }
-
- /*unbind all interfaces of this widget*/
- wm_widget_bind_interface_ex(c, obj, 0, NULL, SMJS_GET_RVAL, GF_TRUE);
-
- /*detach scene now that all unbind events have been sent*/
- wid->scene = NULL;
- return JS_TRUE;
-}
-
-
-static void wm_widget_jsbind(GF_WidgetManager *wm, GF_WidgetInstance *wid)
-{
- if (wid->obj)
- return;
- wid->obj = JS_NewObject(wm->ctx, &wm->wmWidgetClass._class, 0, 0);
- SMJS_SET_PRIVATE(wm->ctx, wid->obj, wid);
- /*protect from GC*/
- gf_js_add_root(wm->ctx, &wid->obj, GF_JSGC_OBJECT);
-}
-
-void wm_deactivate_component(JSContext *c, GF_WidgetInstance *wid, GF_WidgetComponent *comp, GF_WidgetComponentInstance *comp_inst)
-{
- jsval fval, rval;
-
- if (!comp_inst) {
- u32 i=0;
- while ((comp_inst = (GF_WidgetComponentInstance*)gf_list_enum(wid->components, &i))) {
- if (comp_inst->comp == comp) break;
- comp_inst = NULL;
- }
- }
- if (!comp_inst) return;
-
- if ((JS_LookupProperty(c, wid->widget->wm->obj, "on_widget_remove", &fval)==JS_TRUE) && JSVAL_IS_OBJECT(fval)) {
- jsval argv[1];
- argv[0] = OBJECT_TO_JSVAL(comp_inst->wid->obj);
- JS_CallFunctionValue(wid->widget->wm->ctx, wid->obj, fval, 1, argv, &rval);
- }
-}
-
-GF_WidgetComponentInstance *wm_activate_component(JSContext *c, GF_WidgetInstance *wid, GF_WidgetComponent *comp, Bool skip_wm_notification)
-{
- u32 i, count;
- const char *fun_name = NULL;
- jsval fval, rval;
- GF_WidgetComponentInstance *comp_inst;
- GF_WidgetInstance *comp_wid;
-
- comp_wid = NULL;
- if (comp->src) {
- char *url = gf_url_concatenate(wid->widget->url, comp->src);
-
- count = gf_list_count(wid->widget->wm->widget_instances);
- for (i=0; i<count; i++) {
- comp_wid = (GF_WidgetInstance*)gf_list_get(wid->widget->wm->widget_instances, i);
- if (!strcmp(comp_wid->widget->url, url) && !comp_wid->parent) break;
- comp_wid = NULL;
- }
- if (!comp_wid) {
- comp_wid = wm_load_widget(wid->widget->wm, url, 0, GF_FALSE);
- if (comp_wid) comp_wid->permanent = GF_FALSE;
- }
- gf_free(url);
- }
- if (!comp_wid) return NULL;
-
- if (!comp_wid->activated)
- fun_name = "on_widget_add";
-
- GF_SAFEALLOC(comp_inst, GF_WidgetComponentInstance);
- if (!comp_inst) return NULL;
- comp_inst->comp = comp;
- comp_inst->wid = comp_wid;
- comp_wid->parent = wid;
-
- gf_list_add(wid->components, comp_inst);
-
- if (!comp_inst->wid->obj) wm_widget_jsbind(wid->widget->wm, comp_inst->wid);
-
- if (!skip_wm_notification && fun_name && (JS_LookupProperty(c, wid->widget->wm->obj, fun_name, &fval)==JS_TRUE) && JSVAL_IS_OBJECT(fval)) {
- jsval argv[1];
- argv[0] = OBJECT_TO_JSVAL(comp_inst->wid->obj);
- JS_CallFunctionValue(wid->widget->wm->ctx, wid->obj, fval, 1, argv, &rval);
- }
- if (comp_inst) return comp_inst;
- return NULL;
-}
-
-static JSBool SMJS_FUNCTION(wm_widget_is_interface_bound)
-{
- u32 i, count;
- JSObject *cookie;
- GF_WidgetInterface *ifce;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetInstance *wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, obj);
- if (!wid || !wid->scene || (argc<1) || !JSVAL_IS_OBJECT(argv[0]) ) return JS_FALSE;
-
- ifce = SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- if (!ifce) return JS_FALSE;
- cookie = NULL;
- if ((argc==2) && JSVAL_IS_OBJECT(argv[1]) )
- cookie = JSVAL_TO_OBJECT(argv[1]);
-
- SMJS_SET_RVAL(BOOLEAN_TO_JSVAL(JS_FALSE));
- count = gf_list_count(wid->bound_ifces);
- for (i=0; i<count; i++) {
- GF_WidgetInterfaceInstance *bifce = (GF_WidgetInterfaceInstance*)gf_list_get(wid->bound_ifces, i);
- if (!strcmp(bifce->ifce->type, ifce->type) && (!cookie || (bifce->cookie==cookie))) {
- SMJS_SET_RVAL( BOOLEAN_TO_JSVAL(JS_TRUE) );
- break;
- }
- }
- return JS_TRUE;
-}
-
-
-static JSBool SMJS_FUNCTION(wm_load)
-{
- u32 i, count;
- char *manifest, *url, *widget_ctx;
- GF_WidgetInstance *wid;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetManager *wm = (GF_WidgetManager *)SMJS_GET_PRIVATE(c, obj);
- if (!argc || !JSVAL_IS_STRING(argv[0])) return JS_TRUE;
-
- manifest = SMJS_CHARS(c, argv[0]);
-
- url = NULL;
- if ((argc==2) && ! JSVAL_IS_NULL(argv[1]) && JSVAL_IS_OBJECT(argv[1])) {
- GF_WidgetInstance *parent_widget;
- if (!GF_JS_InstanceOf(c, JSVAL_TO_OBJECT(argv[1]), &wm->wmWidgetClass, NULL) ) return JS_FALSE;
- parent_widget = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[1]) );
-
- if (parent_widget->widget->url) url = gf_url_concatenate(parent_widget->widget->url, manifest);
- }
-
- widget_ctx = NULL;
- if ((argc==3) && !JSVAL_IS_NULL(argv[2]) && JSVAL_IS_STRING(argv[2])) {
- widget_ctx = SMJS_CHARS(c, argv[2]);
- }
-
- if (!url) {
- url = gf_strdup(manifest);
- }
-
- wid=NULL;
- count = gf_list_count(wm->widget_instances);
- for (i=0; i<count; i++) {
- wid = (GF_WidgetInstance*)gf_list_get(wm->widget_instances, i);
- if (!strcmp(wid->widget->url, url) && !wid->activated) break;
- wid = NULL;
- }
- if (!wid) {
- wid = wm_load_widget(wm, url, 0, GF_TRUE);
- }
- if (url) gf_free(url);
-
- /*parse context if any*/
- if (wid && wid->mpegu_context) {
- gf_xml_dom_del(wid->mpegu_context);
- wid->mpegu_context = NULL;
- }
- if (wid && widget_ctx && strlen(widget_ctx)) {
- GF_Err e;
- GF_XMLNode *context = NULL;
- wid->mpegu_context = gf_xml_dom_new();
- e = gf_xml_dom_parse_string(wid->mpegu_context, widget_ctx);
- if (!e) {
- context = gf_xml_dom_get_root(wid->mpegu_context);
- if (strcmp(context->name, "contextInformation")) context = NULL;
- } else {
- }
-
- if (!context && wid->mpegu_context) {
- gf_xml_dom_del(wid->mpegu_context);
- wid->mpegu_context = NULL;
- }
- }
-
- if (wid) {
- wm_widget_jsbind(wm, wid);
- SMJS_SET_RVAL(OBJECT_TO_JSVAL(wid->obj));
- }
- SMJS_FREE(c, manifest);
- SMJS_FREE(c, widget_ctx);
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_unload)
-{
- GF_WidgetInstance *wid;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetManager *wm = (GF_WidgetManager *)SMJS_GET_PRIVATE(c, obj);
- if (!argc || !JSVAL_IS_OBJECT(argv[0])) return JS_TRUE;
-
- if (!GF_JS_InstanceOf(c, JSVAL_TO_OBJECT(argv[0]), &wm->wmWidgetClass, NULL) ) return JS_FALSE;
- wid = (GF_WidgetInstance *)SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
- if (!wid) return JS_TRUE;
-
- /*unless explecetely requested, remove the section*/
- if ((argc!=2) || !JSVAL_IS_BOOLEAN(argv[1]) || (JSVAL_TO_BOOLEAN(argv[1])==JS_TRUE) ) {
- /*create section*/
- gf_cfg_del_section(wm->term->user->config, (const char *) wid->secname);
- gf_cfg_set_key(wm->term->user->config, "Widgets", (const char *) wid->secname, NULL);
- }
- wm_delete_widget_instance(wm, wid);
- return JS_TRUE;
-}
-
-
-
-static SMJS_FUNC_PROP_GET( wm_getProperty)
-
-char *prop_name;
-GF_WidgetManager *wm = (GF_WidgetManager *)SMJS_GET_PRIVATE(c, obj);
-if (!wm) return JS_FALSE;
-
-if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
-prop_name = SMJS_CHARS_FROM_STRING(c, SMJS_ID_TO_STRING(id));
-if (!prop_name) return JS_FALSE;
-
-if (!strcmp(prop_name, "num_widgets")) {
- *vp = INT_TO_JSVAL(gf_list_count(wm->widget_instances));
-}
-else if (!strcmp(prop_name, "last_widget_dir")) {
- const char *opt = gf_opts_get_key("Widgets", "last_widget_dir");
- if (!opt) opt = "/";
- *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(c, opt));
-}
-SMJS_FREE(c, prop_name);
-return JS_TRUE;
-}
-
-
-static SMJS_FUNC_PROP_SET( wm_setProperty)
-
-char *prop_name;
-GF_WidgetManager *wm = (GF_WidgetManager *)SMJS_GET_PRIVATE(c, obj);
-if (!wm) return JS_FALSE;
-
-if (!JSVAL_IS_STRING(*vp)) return JS_TRUE;
-if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
-prop_name = SMJS_CHARS_FROM_STRING(c, SMJS_ID_TO_STRING(id));
-
-if (!strcmp(prop_name, "last_widget_dir")) {
- char *v = SMJS_CHARS(c, *vp);
- gf_cfg_set_key(wm->term->user->config, "Widgets", "last_widget_dir", v);
- SMJS_FREE(c, v);
-}
-SMJS_FREE(c, prop_name);
-return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_get)
-{
- u32 i;
- GF_WidgetInstance *wid;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetManager *wm = (GF_WidgetManager *)SMJS_GET_PRIVATE(c, obj);
- if (!argc || !JSVAL_IS_INT(argv[0])) return JS_TRUE;
-
- i = JSVAL_TO_INT(argv[0]);
- wid = (GF_WidgetInstance*)gf_list_get(wm->widget_instances, i);
- if (wid) SMJS_SET_RVAL( OBJECT_TO_JSVAL(wid->obj) );
- return JS_TRUE;
-}
-
-static JSBool SMJS_FUNCTION(wm_find_interface)
-{
- char *ifce_name;
- u32 i;
- GF_WidgetInstance *wid;
- SMJS_OBJ
- SMJS_ARGS
- GF_WidgetManager *wm = (GF_WidgetManager *)SMJS_GET_PRIVATE(c, obj);
- if (!argc || !JSVAL_IS_STRING(argv[0])) return JS_TRUE;
-
- ifce_name = SMJS_CHARS(c, argv[0]);
- i=0;
- while ( (wid = (GF_WidgetInstance*)gf_list_enum(wm->widget_instances, &i) )) {
- u32 j=0;
- GF_WidgetInterface *wid_ifce;
- while ((wid_ifce = (GF_WidgetInterface*)gf_list_enum(wid->widget->main->interfaces, &j))) {
- if (!strcmp(wid_ifce->type, ifce_name)) {
- SMJS_SET_RVAL( OBJECT_TO_JSVAL(wid->obj) );
- SMJS_FREE(c, ifce_name);
- return JS_TRUE;
- }
- }
- }
- SMJS_FREE(c, ifce_name);
- return JS_TRUE;
-}
-
-
-const char *wm_xml_get_attr(GF_XMLNode *root, const char *name)
-{
-
- u32 i, count;
- count = gf_list_count(root->attributes);
- for (i=0; i<count; i++) {
- char *sep;
- GF_XMLAttribute *att = gf_list_get(root->attributes, i);
- if (!att->name) continue;
- if (!strcmp(att->name, name)) return att->value;
- sep = strchr(att->name, ':');
- if (sep && !strcmp(sep+1, name)) return att->value;
- }
- return NULL;
-}
-
-/* TODO Implement real language check according to BCP 47*/
-static Bool wm_check_language(const char *xml_lang_value, const char *user_locale)
-{
- Bool ret = GF_FALSE;
- char *sep, *val;
- val = (char*)xml_lang_value;
- while (!ret) {
- sep = strchr(val, ';');
- if (sep) sep[0] = 0;
- if (strstr(user_locale, val)) ret = GF_TRUE;
- if (sep) {
- sep[0] = ';';
- val = sep+1;
- } else {
- break;
- }
- }
- return ret;
-}
-
-static GF_XMLNode *wm_xml_find(GF_XMLNode *root, const char *ns_prefix, const char *name, const char *user_locale)
-{
- GF_XMLNode *localized = NULL;
- GF_XMLNode *non_localized = NULL;
- u32 i, count;
-
- if (!root) return NULL;
-
- count = gf_list_count(root->content);
- for (i=0; i<count; i++) {
- GF_XMLNode *n = (GF_XMLNode*)gf_list_get(root->content, i);
- if (n->type==GF_XML_NODE_TYPE && n->name && !strcmp(n->name, name) && ((!ns_prefix && !n->ns) || (ns_prefix && n->ns && !strcmp(ns_prefix, n->ns)))) {
- const char *lang = wm_xml_get_attr(n, "xml:lang");
- if (!lang) {
- if (!non_localized) non_localized = n;
- } else {
- if (user_locale && wm_check_language(lang, user_locale) && !localized) localized = n;
- }
- }
- }
- if (localized) return localized;
- else return non_localized;
-}
-
-static GF_WidgetPin *wm_parse_pin(const char *value, u16 type, const char *pin_name, const char *scriptType, const char *default_value)
-{
- GF_WidgetPin *pin;
- char *sep;
-
- if (!value && !scriptType && !default_value) return NULL;
-
- GF_SAFEALLOC(pin, GF_WidgetPin);
- if (!pin) return NULL;
-
- pin->type = type;
- if (pin_name) pin->name = gf_strdup(pin_name);
-
- if (value) {
- sep = strrchr(value, '.');
- if (!sep && (type==GF_WM_PREF_CONNECT)) {
- gf_free(pin);
- return NULL;
- }
-
- /*node.event || node.attribute*/
- if (sep) {
- sep[0] = 0;
- pin->node = gf_strdup(value);
- pin->attribute = gf_strdup(sep+1);
- sep[0] = '.';
- }
- /*script function*/
- else {
- pin->node = gf_strdup(value);
- }
- }
-
- if (scriptType) {
- if (!strcmp(scriptType, "boolean")) pin->script_type = GF_WM_PARAM_SCRIPT_BOOL;
- else if (!strcmp(scriptType, "number")) pin->script_type = GF_WM_PARAM_SCRIPT_NUMBER;
- } else if (default_value) {
- pin->default_value = gf_strdup(default_value);
- }
- return pin;
-}
-
-static void wm_parse_mpegu_content_element(GF_WidgetContent *content, GF_XMLNode *root, const char *ns_prefix, GF_List *global_prefs)
-{
- GF_XMLNode *ifces, *context, *pref_node;
- GF_WidgetMessage *msg;
- GF_WidgetInterface *ifce;
- GF_XMLNode *ifce_node;
- GF_WidgetPreference *pref;
- const char *att;
- u32 i = 0;
-
- ifces = wm_xml_find(root, ns_prefix, "interfaces", NULL);
- if (ifces) {
-
- /*get all interface element*/
- while ((ifce_node = (GF_XMLNode*)gf_list_enum(ifces->content, &i))) {
- GF_XMLNode *msg_node;
- u32 j;
- const char *ifce_type, *act;
- if (ifce_node->type != GF_XML_NODE_TYPE) continue;
- if (strcmp(ifce_node->name, "interface")) continue;
- ifce_type = wm_xml_get_attr(ifce_node, "type");
- if (!ifce_type) continue;
-
- GF_SAFEALLOC(ifce, GF_WidgetInterface);
- ifce->type = gf_strdup(ifce_type);
- ifce->messages = gf_list_new();
- ifce->content = content;
- gf_list_add(content->interfaces, ifce);
-
- act = wm_xml_get_attr(ifce_node, "serviceProvider");
- if (act && !strcmp(act, "true")) ifce->provider = GF_TRUE;
-
- act = wm_xml_get_attr(ifce_node, "multipleBindings");
- if (act && !strcmp(act, "true")) ifce->multiple_binding = GF_TRUE;
-
- act = wm_xml_get_attr(ifce_node, "required");
- if (act && !strcmp(act, "true")) ifce->required = GF_TRUE;
-
- act = wm_xml_get_attr(ifce_node, "connectTo");
- if (act) ifce->connectTo = gf_strdup(act);
-
- act = wm_xml_get_attr(ifce_node, "bindAction");
- if (act) {
- ifce->bind_action = wm_parse_pin(act, GF_WM_BIND_ACTION, NULL, NULL, NULL);
- }
- act = wm_xml_get_attr(ifce_node, "unbindAction");
- if (act) {
- ifce->unbind_action = wm_parse_pin(act, GF_WM_UNBIND_ACTION, NULL, NULL, NULL);
- }
-
- j=0;
- while ((msg_node = (GF_XMLNode*)gf_list_enum(ifce_node->content, &j))) {
- u32 k;
- GF_XMLNode *par_node;
- const char *msg_name, *action;
- if (msg_node->type != GF_XML_NODE_TYPE) continue;
- if (strcmp(msg_node->name, "messageIn") && strcmp(msg_node->name, "messageOut")) continue;
-
- msg_name = wm_xml_get_attr(msg_node, "name");
- if (!msg_name) continue;
- GF_SAFEALLOC(msg, GF_WidgetMessage);
- msg->name = gf_strdup(msg_name);
- msg->params = gf_list_new();
- msg->ifce = ifce;
- if (!strcmp(msg_node->name, "messageOut")) msg->is_output = 1;
-
- gf_list_add(ifce->messages, msg);
-
- /*get inputAction*/
- action = wm_xml_get_attr(msg_node, "inputAction");
- if (action) {
- msg->input_action = wm_parse_pin(action, GF_WM_INPUT_ACTION, NULL, NULL, NULL);
- }
-
- /*get outputTrigger*/
- action = wm_xml_get_attr(msg_node, "outputTrigger");
- if (action) {
- msg->output_trigger = wm_parse_pin(action, GF_WM_OUTPUT_TRIGGER, NULL, NULL, NULL);
- }
-
- /*get params*/
- k=0;
- while ((par_node=gf_list_enum(msg_node->content, &k))) {
- GF_WidgetPin *wpin;
- u16 type;
- const char *par_name, *att_name;
- if (par_node->type != GF_XML_NODE_TYPE) continue;
- if (strcmp(par_node->name, "input") && strcmp(par_node->name, "output")) continue;
-
-
- par_name = wm_xml_get_attr(par_node, "name");
- /*invalid param, discard message*/
- if (!par_name) {
- gf_list_del_item(ifce->messages, msg);
- gf_list_del(msg->params);
- gf_free(msg->name);
- gf_free(msg);
- break;
- }
-
- if (!strcmp(par_node->name, "output")) {
- type = GF_WM_PARAM_OUTPUT;
- att_name = wm_xml_get_attr(par_node, "attributeModified");
- } else {
- type = GF_WM_PARAM_INPUT;
- att_name = wm_xml_get_attr(par_node, "setAttribute");
- }
- wpin = wm_parse_pin(att_name, type, par_name, wm_xml_get_attr(par_node, "scriptParamType"), wm_xml_get_attr(par_node, "default"));
- if (!wpin) continue;
- wpin->msg = msg;
-
- gf_list_add(msg->params, wpin);
- }
- }
- }
- }
-
- /*get all component elements*/
- i=0;
- while (root && (ifce_node = gf_list_enum(root->content, &i))) {
- GF_XMLNode *req_node;
- u32 j;
- const char *src, *id, *act;
- GF_WidgetComponent *comp;
- if (ifce_node->type != GF_XML_NODE_TYPE) continue;
- if (strcmp(ifce_node->name, "component")) continue;
- src = wm_xml_get_attr(ifce_node, "src");
- id = wm_xml_get_attr(ifce_node, "id");
-
- GF_SAFEALLOC(comp, GF_WidgetComponent);
- comp->required_interfaces = gf_list_new();
- comp->content = content;
- if (id) comp->id = gf_strdup(id);
- if (src) comp->src = gf_strdup(src);
- j=0;
- while ((req_node=gf_list_enum(ifce_node->content, &j))) {
- const char *ifce_type;
- if (req_node->type != GF_XML_NODE_TYPE) continue;
- if (strcmp(req_node->name, "requiredInterface")) continue;
- ifce_type = wm_xml_get_attr(req_node, "type");
- if (!ifce_type) continue;
- gf_list_add(comp->required_interfaces, gf_strdup(ifce_type));
- }
-
- act = wm_xml_get_attr(ifce_node, "activateTrigger");
- if (act) comp->activateTrigger = wm_parse_pin(act, GF_WM_ACTIVATE_TRIGGER, NULL, NULL, NULL);
- act = wm_xml_get_attr(ifce_node, "deactivateTrigger");
- if (act) comp->deactivateTrigger = wm_parse_pin(act, GF_WM_DEACTIVATE_TRIGGER, NULL, NULL, NULL);
-
- gf_list_add(content->components, comp);
- }
-
- /*clone global prefs for this content*/
- i=0;
- while ((pref = gf_list_enum(global_prefs, &i))) {
- GF_WidgetPreference *apref;
- GF_SAFEALLOC(apref, GF_WidgetPreference);
- apref->name = gf_strdup(pref->name);
- if (pref->value) apref->value = gf_strdup(pref->value);
- apref->flags = pref->flags;
- gf_list_add(content->preferences, apref);
- }
-
- context = wm_xml_find(root, ns_prefix, "contextConfiguration", NULL);
- if (context) {
- u32 j;
- /*get all preference elements*/
- i=0;
- while ((pref_node = gf_list_enum(context->content, &i))) {
- const char *att;
- if (pref_node->type != GF_XML_NODE_TYPE) continue;
- if (strcmp(pref_node->name, "preferenceConnect")) continue;
- att = wm_xml_get_attr(pref_node, "name");
- if (!att) continue;
-
- j=0;
- while ((pref = gf_list_enum(content->preferences, &j))) {
- if (!strcmp(pref->name, att) && !pref->connectTo) break;
- }
-
- if (!pref) {
- GF_SAFEALLOC(pref, GF_WidgetPreference);
- if (!pref) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[WidgetMan] Failed to allocate widget preference\n"));
- continue;
- }
-
- pref->name = gf_strdup(att);
- gf_list_add(content->preferences, pref);
- }
- att = wm_xml_get_attr(pref_node, "value");
- if (att) {
- if (pref->value) gf_free(pref->value);
- pref->value = gf_strdup(att);
- }
- att = wm_xml_get_attr(pref_node, "readOnly");
- if (att && !strcmp(att, "true")) pref->flags |= GF_WM_PREF_READONLY;
- att = wm_xml_get_attr(pref_node, "migratable");
- if (att && !strcmp(att, "saveOnly")) pref->flags |= GF_WM_PREF_SAVE;
- else if (att && !strcmp(att, "migrateOnly")) pref->flags |= GF_WM_PREF_MIGRATE;
- else pref->flags |= GF_WM_PREF_SAVE | GF_WM_PREF_MIGRATE;
-
- att = wm_xml_get_attr(pref_node, "connectTo");
- if (att) pref->connectTo = wm_parse_pin(att, GF_WM_PREF_CONNECT, NULL, NULL, NULL);
- }
-
- att = wm_xml_get_attr(context, "savedAction");
- if (att) content->savedAction = wm_parse_pin(att, GF_WM_PREF_SAVEDACTION, NULL, NULL, NULL);
- att = wm_xml_get_attr(context, "restoredAction");
- if (att) content->restoredAction = wm_parse_pin(att, GF_WM_PREF_RESTOREDACTION, NULL, NULL, NULL);
- att = wm_xml_get_attr(context, "saveTrigger");
- if (att) content->saveTrigger = wm_parse_pin(att, GF_WM_PREF_SAVETRIGGER, NULL, NULL, NULL);
- att = wm_xml_get_attr(context, "restoreTrigger");
- if (att) content->restoreTrigger = wm_parse_pin(att, GF_WM_PREF_RESTORETRIGGER, NULL, NULL, NULL);
- }
-}
-
-/* Implements the W3C P&C rule for getting a single attribute value
- see http://www.w3.org/TR/widgets/#rule-for-getting-a-single-attribute-valu0
- should be different from getting normalized text but for now it's ok
- */
-static char *wm_get_single_attribute(const char *input) {
- u32 i, j, len;
- char *output;
- Bool first_space_copied;
-
- if (!input) return gf_strdup("");
-
- len = (u32) strlen(input);
- output = gf_malloc(len+1);
-
- first_space_copied = 1;
- j = 0;
- for (i = 0; i<len; i++) {
- switch (input[i]) {
- case ' ':
- case '\t':
- case '\r':
- case '\n':
- if (!first_space_copied) {
- output[j] = ' ';
- j++;
- first_space_copied = 1;
- }
- break;
- default:
- output[j] = input[i];
- j++;
- first_space_copied = 0;
- }
- }
- if (j && output[j-1] == ' ') output[j-1] = 0;
- output[j] = 0;
- return output;
-}
-
-/* Implements the W3C P&C rule for getting a single attribute value
- see http://www.w3.org/TR/widgets/#rule-for-getting-a-single-attribute-valu0 */
-static u32 wm_parse_non_neg(const char *input) {
- u32 result = 0;
- if (strlen(input) && !strchr(input, '-')) {
- if (sscanf(input, "%u", &result) != 1) result = 0;
- }
- return result;
-}
-
-/* returns the localized concatenated text content
-see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent
-and http://www.w3.org/TR/widgets/#rule-for-getting-text-content0
-*/
-static char *wm_get_text_content(GF_XMLNode *node, char *inherited_locale, const char *user_locale) {
- if (node->type == GF_XML_TEXT_TYPE) {
- if (node->name) return gf_strdup(node->name);
- else return gf_strdup("");
- } else {
- char *xml_lang = (char *)wm_xml_get_attr(node, "xml:lang");
- if (!xml_lang) xml_lang = inherited_locale;
- /*
- if (xml_lang && user_locale && wm_check_language(xml_lang, user_locale))
- */
- {
- u32 i, count;
- char *text_content;
- u32 text_content_len = 0;
- text_content = gf_strdup("");
- count = gf_list_count(node->content);
- for (i=0; i<count; i++) {
- GF_XMLNode *child = (GF_XMLNode *)gf_list_get(node->content, i);
- char *child_content = wm_get_text_content(child, xml_lang, user_locale);
- u32 child_content_len = (u32) strlen(child_content);
- text_content = gf_realloc(text_content, text_content_len+child_content_len+1);
- memcpy(text_content+text_content_len, child_content, child_content_len);
- text_content[text_content_len+child_content_len] = 0;
- text_content_len+=child_content_len;
- gf_free(child_content);
- }
- return text_content;
- }
- /*
- } else {
- return gf_strdup("");
- */
- }
-}
-
-static char *wm_get_normalized_text_content(GF_XMLNode *node, char *inherited_locale, const char *user_locale) {
- char *text_content, *result;
- /* first aggregate text content */
- text_content = wm_get_text_content(node, inherited_locale, user_locale);
- /* calling normalization of text content */
- result = wm_get_single_attribute(text_content);
- gf_free(text_content);
- return result;
-}
-
-/* When relocating resources over HTTP, we check if the resources for a given locale exists
- on the server by sending a HEAD message with an Accept-Language header. */
-void wm_relocate_proc(void *usr_cbk, GF_NETIO_Parameter *parameter)
-{
- switch (parameter->msg_type) {
- case GF_NETIO_GET_METHOD:
- parameter->name = "HEAD";
- break;
- default:
- return;
- }
-}
-
-/* relocate the given resource name (res_name) using registered relocators (e.g. locales, package folder)
- The result is the path of the file, possibly uncompressed, possibly localized.
- The parameter widget_path provides the path for converting relative resource paths into absolute paths.*/
-static Bool wm_relocate_url(GF_WidgetManager *wm, const char *widget_path, const char *res_name, char *relocated_name, char *localized_res_name)
-{
- Bool ok = 0;
- char *res_url;
- Bool result = gf_term_relocate_url(wm->term, res_name, widget_path, relocated_name, localized_res_name);
- if (result) return result;
-
- res_url = gf_url_concatenate(widget_path, res_name);
-
- /*try with HTTP HEAD */
- if (!strnicmp(widget_path, "http", 4)) {
- GF_Err e;
- /*fetch the remote widget manifest synchronously and load it */
- GF_DownloadSession *sess = gf_dm_sess_new(wm->term->downloader, (char *)res_url, GF_NETIO_SESSION_NOT_THREADED, wm_relocate_proc, NULL, &e);
- if (sess) {
- e = gf_dm_sess_process(sess);
- gf_dm_sess_del(sess);
- if (e==GF_OK) {
- const char *opt = gf_opts_get_key("core", "lang");
- strcpy(relocated_name, res_url);
- if (opt)
- sprintf(localized_res_name, "%s/%s", opt, res_name);
- else
- strcpy(localized_res_name, res_name);
- ok = 1;
- }
- }
- }
- gf_free(res_url);
- return ok;
-}
-
-/* function that checks if the default start file exists in the widget (package or folder)
- according to the default start files table from the W3C P&C spec.
- The widget path attribute is used to get the associated relocator from the registered relocators */
-static void wm_set_default_start_file(GF_WidgetManager *wm, GF_WidgetContent *content, const char *widget_path) {
- Bool result;
- char localized_path[GF_MAX_PATH], relocated_path[GF_MAX_PATH];
- char *mimetype = "text/html";
- result = wm_relocate_url(wm, widget_path, "index.htm", relocated_path, localized_path);
- if (result) {
- mimetype = "text/html";
- } else {
- result = wm_relocate_url(wm, widget_path, "index.html", relocated_path, localized_path);
- if (result) {
- mimetype = "text/html";
- } else {
- result = wm_relocate_url(wm, widget_path, "index.svg", relocated_path, localized_path);
- if (result) {
- mimetype = "image/svg+xml";
- } else {
- result = wm_relocate_url(wm, widget_path, "index.xhtml", relocated_path, localized_path);
- if (result) {
- mimetype = "application/xhtml+xml";
- } else {
- result = wm_relocate_url(wm, widget_path, "index.xht", relocated_path, localized_path);
- if (result) mimetype = "application/xhtml+xml";
- }
- }
- }
- }
- if (content->src) gf_free(content->src);
- content->src = gf_strdup(localized_path);
- if (content->relocated_src) gf_free(content->relocated_src);
- content->relocated_src = gf_strdup(relocated_path);
- if (content->mimetype) gf_free(content->mimetype);
- content->mimetype = gf_strdup(mimetype);
- if (content->encoding) gf_free(content->encoding);
- content->encoding = gf_strdup("utf-8");
-}
-
-static GF_WidgetContent *wm_add_icon(GF_Widget *widget, const char *icon_relocated_path, const char *icon_localized_path, const char *uri_fragment)
-{
- GF_WidgetContent *icon;
- u32 i, count;
- Bool already_in = 0;
-
- count = gf_list_count(widget->icons);
- for (i =0; i<count; i++) {
- GF_WidgetContent *in_icon = gf_list_get(widget->icons, i);
- if (!strcmp(icon_localized_path, in_icon->src)) {
- already_in = 1;
- break;
- }
- }
- if (already_in) return NULL;
-
- GF_SAFEALLOC(icon, GF_WidgetContent);
- if (!icon) return NULL;
-
- if (uri_fragment) {
- icon->src = gf_malloc(strlen(icon_localized_path) + strlen(uri_fragment) + 1);
- if (icon->src) {
- strcpy(icon->src, icon_localized_path);
- strcat(icon->src, uri_fragment);
- }
- icon->relocated_src = gf_malloc(strlen(icon_relocated_path) + strlen(uri_fragment) + 1);
- if (icon->relocated_src) {
- strcpy(icon->relocated_src, icon_relocated_path);
- strcat(icon->relocated_src, uri_fragment);
- }
- } else {
- icon->src = gf_strdup(icon_localized_path);
- icon->relocated_src = gf_strdup(icon_relocated_path);
- }
- icon->interfaces = gf_list_new();
- icon->components = gf_list_new();
- icon->preferences = gf_list_new();
- icon->widget = widget;
- gf_list_add(widget->icons, icon);
- return icon;
-}
-
-/* Scans the W3C default icons table and add each icon */
-static void wm_set_default_icon_files(GF_WidgetManager *wm, const char *widget_path, GF_Widget *widget) {
- char relocated_path[GF_MAX_PATH], localized_path[GF_MAX_PATH];
- Bool result;
-
- result = wm_relocate_url(wm, widget_path, "icon.svg", relocated_path, localized_path);
- if (result) wm_add_icon(widget, relocated_path, localized_path, NULL);
-
- result = wm_relocate_url(wm, widget_path, "icon.ico", relocated_path, localized_path);
- if (result) wm_add_icon(widget, relocated_path, localized_path, NULL);
-
- result = wm_relocate_url(wm, widget_path, "icon.png", relocated_path, localized_path);
- if (result) wm_add_icon(widget, relocated_path, localized_path, NULL);
-
- result = wm_relocate_url(wm, widget_path, "icon.gif", relocated_path, localized_path);
- if (result) wm_add_icon(widget, relocated_path, localized_path, NULL);
-
- result = wm_relocate_url(wm, widget_path, "icon.jpg", relocated_path, localized_path);
- if (result) wm_add_icon(widget, relocated_path, localized_path, NULL);
-}
-
-GF_WidgetInstance *wm_load_widget(GF_WidgetManager *wm, const char *path, u32 InstanceID, Bool skip_context)
-{
- char szName[GF_MAX_PATH];
- u32 i, count;
- GF_Widget *widget = NULL;
- GF_WidgetInstance *wi = NULL;
- GF_XMLNode *root, *icon, *nmain, *name, *xml_node;
- GF_Err e;
- GF_DOMParser *dom = NULL;
- GF_WidgetPackage *wpackage = NULL;
-
- GF_DownloadSession *sess = NULL;
- const char *widget_ns_prefix = NULL;
- const char *mpegu_ns_prefix = NULL;
- const char *user_locale = gf_opts_get_key("core", "lang");
-
- /* Try to see if this widget is already loaded */
- e = GF_OK;
- count = gf_list_count(wm->widgets);
- for (i=0; i<count; i++) {
- widget = gf_list_get(wm->widgets, i);
- if (!strcmp(widget->url, path)) break;
- widget = NULL;
- }
-
- /*not found, retrieve the widget (if http), check the package if needed and parse the configuration document/widget manifest*/
- if (!widget) {
- Bool isDownloadedPackage = 0;
-
- /* path used to locate the widget (config.xml if unpackaged or zip/isoff package), potentially after download */
- const char *szLocalPath = path;
- /* used to locate the config document/widget manifest potentially after unzipping */
- const char *szManifestPath = path;
- /* */
- const char *szWidgetPath = path;
- const char *desc;
- GF_WidgetPreference *pref;
- GF_List *global_prefs;
- GF_WidgetContent *content;
- Bool correct_ns = 0;
-
- if (strstr(path, "http://")) {
- /*fetch the remote widget manifest synchronously and load it */
- sess = gf_dm_sess_new(wm->term->downloader, (char *)path, GF_NETIO_SESSION_NOT_THREADED, NULL, NULL, &e);
- if (sess) {
- e = gf_dm_sess_process(sess);
- if (e==GF_OK) {
- szLocalPath = gf_dm_sess_get_cache_name(sess);
-
- if (gf_unzip_probe(szLocalPath)) {
- isDownloadedPackage = 1;
- } else {
- /* TODO ISOFF-based packaged widget */
- }
- }
- }
- if (!sess || (e!=GF_OK) || !szLocalPath) goto exit;
- }
-
- /* Check if the widget package is a valid package and if it contains a config.xml file */
- szManifestPath = szLocalPath;
-
- wpackage = widget_package_new(wm, szLocalPath);
- if (wpackage) {
- count = gf_list_count(wpackage->resources);
- for (i=0; i<count; i++) {
- GF_WidgetPackageResource *wu = gf_list_get(wpackage->resources, i);
- /* According to W3C WPC, the config.xml file (lower case) shall only be located
- at the root of the package
- see http://www.w3.org/TR/widgets/#ta-dxzVDWpaWg */
- if (!strcmp(wu->inner_path, "config.xml")) {
- szManifestPath = wu->extracted_path;
- break;
- }
- }
- szWidgetPath = szManifestPath;
- }
-
-
- /* Parse the Widget Config Document as a DOM */
- dom = gf_xml_dom_new();
- e = gf_xml_dom_parse(dom, szManifestPath, NULL, NULL);
- if (e) goto exit;
-
- root = gf_xml_dom_get_root(dom);
- if (!root) goto exit;
-
- correct_ns = 0;
- count = gf_list_count(root->attributes);
- for (i=0; i<count; i++) {
- GF_XMLAttribute *att = gf_list_get(root->attributes, i);
- if (att->name) {
- if (!strcmp(att->name, "xmlns")) {
- if (!strcmp(att->value, "http://www.w3.org/ns/widgets")) {
- correct_ns = 1;
- }
- } else if (!strnicmp(att->name, "xmlns:", 6)) {
- if (!strcmp(att->value, "http://www.w3.org/ns/widgets")) {
- widget_ns_prefix = att->name+6;
- correct_ns = 1;
- } else if (!strcmp(att->value, "urn:mpeg:mpegu:schema:widgets:manifest:2010")) {
- mpegu_ns_prefix = att->name+6;
- }
- }
- }
- }
- /* According to the spec, wrong or no namespace means invalid widget
- see http://www.w3.org/TR/widgets/#ta-ACCJfDGwDQ */
- if (!correct_ns) goto exit;
-
- /* see http://www.w3.org/TR/widgets/#ta-ACCJfDGwDQ */
- if ((root->ns && (!widget_ns_prefix || strcmp(root->ns, widget_ns_prefix) || strcmp(root->name, "widget"))) ||
- (!root->ns && (widget_ns_prefix || strcmp(root->name, "widget"))))
- goto exit;
-
-
- /*pre-parse the root-level preference for use when parsing MPEG-U elements */
- global_prefs = gf_list_new();
- i=0;
- while ((nmain = gf_list_enum(root->content, &i))) {
- const char *pname, *pvalue;
- /* 'normalized' preference name and readonly*/
- char *npname, *npro;
- u32 i, count;
- Bool pref_exists = 0;
- Bool readOnly = 0;
- if (nmain->type != GF_XML_NODE_TYPE) continue;
- if (strcmp(nmain->name, "preference")) continue;
- pname = wm_xml_get_attr(nmain, "name");
- npname = wm_get_single_attribute(pname);
- if (!npname || !strlen(npname)) continue;
-
- count = gf_list_count(global_prefs);
- for (i = 0; i < count; i++) {
- GF_WidgetPreference *tmp_pref = gf_list_get(global_prefs, i);
- if (!strcmp(tmp_pref->name, npname)) {
- pref_exists = 1;
- break;
- }
- }
- if (pref_exists) continue;
-
- pvalue = wm_xml_get_attr(nmain, "readonly");
- npro = wm_get_single_attribute(pvalue);
- if (npro && strlen(npro) && !strcmp(npro, "true")) readOnly=1;
- if (npro) gf_free(npro);
-
- pvalue = wm_xml_get_attr(nmain, "value");
-
- GF_SAFEALLOC(pref, GF_WidgetPreference);
- pref->name = npname;
- if (pvalue) pref->value = wm_get_single_attribute(pvalue);
- /*global preferences are save and migratable*/
- pref->flags = GF_WM_PREF_SAVE | GF_WM_PREF_MIGRATE;
- if (readOnly) pref->flags |= GF_WM_PREF_READONLY;
- gf_list_add(global_prefs, pref);
- }
-
- /* get the content element from the XML Config document */
- GF_SAFEALLOC(content, GF_WidgetContent);
- if (!content) {
- e = GF_OUT_OF_MEM;
- goto exit;
- }
- content->interfaces = gf_list_new();
- content->components = gf_list_new();
- content->preferences = gf_list_new();
- nmain = wm_xml_find(root, widget_ns_prefix, "content", NULL);
- if (!nmain) {
- /* if not found, use the default table of start files */
- wm_set_default_start_file(wm, content, szWidgetPath);
- } else {
- const char *src, *encoding, *mimetype;
- src = wm_xml_get_attr(nmain, "src");
-
- /*check the resource exists*/
- if (src) {
- Bool result;
- char relocated_path[GF_MAX_PATH], localized_path[GF_MAX_PATH];
- /*remove any existing fragment*/
- char *sep = strchr(src, '#');
- if (sep) sep[0] = 0;
- result = wm_relocate_url(wm, szWidgetPath, src, relocated_path, localized_path);
- if (sep) sep[0] = '#';
- if (result) {
- content->relocated_src = gf_strdup(relocated_path);
- content->src = gf_strdup(localized_path);
- }
- }
-
- encoding = wm_xml_get_attr(nmain, "encoding");
- if (encoding && strlen(encoding)) content->encoding = wm_get_single_attribute(encoding);
- else content->encoding = gf_strdup("utf-8");
-
- mimetype = wm_xml_get_attr(nmain, "type");
- if (mimetype && strlen(mimetype)) {
- char *sep = strchr(mimetype, ';');
- if (sep) sep[0] = 0;
- content->mimetype = wm_get_single_attribute(mimetype);
- if (sep) sep[0] = ';';
- }
- else content->mimetype = gf_strdup("text/html");
-
- if (!content->relocated_src) wm_set_default_start_file(wm, content, szWidgetPath);
- }
- if (strlen(content->relocated_src) == 0) {
- gf_list_del(content->interfaces);
- gf_list_del(content->components);
- gf_list_del(content->preferences);
- gf_free(content);
- content = NULL;
- goto exit;
- }
- /* We need to call the parse of the MPEG-U elements to clone the global preferences into widget preferences,
- this should probably be changed to extract the clone from that function */
- wm_parse_mpegu_content_element(content, nmain, mpegu_ns_prefix, global_prefs);
-
- GF_SAFEALLOC(widget, GF_Widget);
- if (!widget) {
- e = GF_OUT_OF_MEM;
- goto exit;
- }
- widget->url = gf_strdup(path);
- widget->manifest_path = gf_strdup(szManifestPath);
- if (isDownloadedPackage) widget->local_path = gf_strdup(szLocalPath);
- widget->wm = wm;
- widget->main = content;
- content->widget = widget;
- widget->icons = gf_list_new();
- widget->features = gf_list_new();
- if (wpackage) {
- widget->wpack = wpackage;
- wpackage->widget = widget;
- /*attach downloader to our package to avoid destroying the cache file*/
- wpackage->sess = sess;
- sess = NULL;
- }
-
- /*check for icon - can be optional*/
- i=0;
- while ((icon = gf_list_enum(root->content, &i))) {
- if (icon->type==GF_XML_NODE_TYPE &&
- icon->name && !strcmp(icon->name, "icon") &&
- ((!widget_ns_prefix && !icon->ns) || !strcmp(widget_ns_prefix, icon->ns))) {
- char *sep;
- char relocated[GF_MAX_PATH], localized_path[GF_MAX_PATH];
- char *icon_width, *icon_height;
- GF_WidgetContent *iconic;
- Bool result;
-
- char *pname = (char *)wm_xml_get_attr(icon, "src");
- if (!pname || !strlen(pname)) continue;
-
- /*remove any existing fragment*/
- sep = strchr(pname, '#');
- if (sep) sep[0] = 0;
- result = wm_relocate_url(wm, szWidgetPath, pname, relocated, localized_path);
- if (sep) sep[0] = '#';
- if (!result) continue;
-
- iconic = wm_add_icon(widget, relocated, localized_path, sep);
- if (iconic) {
- wm_parse_mpegu_content_element(iconic, icon, mpegu_ns_prefix, global_prefs);
- icon_width = (char *)wm_xml_get_attr(icon, "width");
- if (icon_width) iconic->width = wm_parse_non_neg(icon_width);
- icon_height = (char *)wm_xml_get_attr(icon, "height");
- if (icon_height) iconic->height = wm_parse_non_neg(icon_height);
- }
- }
- }
- /* after processing the icon elements (wether there are valid icons or not), we use the default icon table
- see http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/ta-FAFYMEGELU/004/ */
- wm_set_default_icon_files(wm, szWidgetPath, widget);
-
- /*delete the root-level preference*/
- i=0;
- while ((pref = gf_list_enum(global_prefs , &i))) {
- if (pref->value) gf_free(pref->value);
- gf_free(pref->name);
- gf_free(pref);
- }
- gf_list_del(global_prefs);
-
- /*check for optional meta data*/
- name = wm_xml_find(root, widget_ns_prefix, "name", user_locale);
- if (name) {
- const char *shortname = wm_xml_get_attr(name, "short");
- widget->shortname = wm_get_single_attribute(shortname);
-
- widget->name = wm_get_normalized_text_content(name, NULL, user_locale);
- }
-
- desc = wm_xml_get_attr(root, "id");
- if (desc) {
- /* TODO check if this is a valid IRI, for the moment, just hack to pass the test, check for ':'
- see http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/ta-RawAIWHoMs/ */
- if (strchr(desc, ':'))
- widget->identifier = wm_get_single_attribute(desc);
- }
-
- desc = wm_xml_get_attr(root, "width");
- if (desc) {
- widget->width = wm_parse_non_neg(desc);
- }
- desc = wm_xml_get_attr(root, "height");
- if (desc) {
- widget->height = wm_parse_non_neg(desc);
- }
-
- name = wm_xml_find(root, widget_ns_prefix, "description", user_locale);
- if (name) {
- widget->description = wm_get_normalized_text_content(name, NULL, user_locale);
- }
-
- name = wm_xml_find(root, widget_ns_prefix, "license", user_locale);
- if (name) {
- const char *href = wm_xml_get_attr(name, "href");
- widget->licenseHref = wm_get_single_attribute(href);
-
- /* Warning the license text content should not be normalized */
- widget->license = wm_get_text_content(name, NULL, user_locale);
- }
-
- desc = wm_xml_get_attr(root, "version");
- if (desc) widget->version = wm_get_single_attribute(desc);
-
- desc = wm_xml_get_attr(root, "uuid");
- if (desc) widget->uuid = gf_strdup(desc);
-
- desc = wm_xml_get_attr(root, "discardable");
- if (desc) widget->discardable = !strcmp(desc, "true") ? 1 : 0;
-
- desc = wm_xml_get_attr(root, "multipleInstances");
- if (desc) widget->multipleInstance = !strcmp(desc, "true") ? 1 : 0;
-
- name = wm_xml_find(root, widget_ns_prefix, "author", NULL);
- if (name) {
- desc = wm_xml_get_attr(name, "href");
- if (desc && strchr(desc, ':')) widget->authorHref = wm_get_single_attribute(desc);
-
- desc = wm_xml_get_attr(name, "email");
- widget->authorEmail = wm_get_single_attribute(desc);
-
- widget->authorName = wm_get_normalized_text_content(name, NULL, user_locale);
- }
-
- i=0;
- while ((xml_node = gf_list_enum(root->content, &i))) {
- if (xml_node->type==GF_XML_NODE_TYPE &&
- xml_node->name && !strcmp(xml_node->name, "feature") &&
- ((!widget_ns_prefix && !xml_node->ns) || !strcmp(widget_ns_prefix, xml_node->ns))) {
-
- u32 i, count;
- Bool already_in = 0;
- GF_WidgetFeature *feat;
- const char *feature_name, *req_att;
- char *nfname;
- Bool required = 1;
- u32 j;
- GF_XMLNode *param_node;
-
- feature_name = (char *)wm_xml_get_attr(xml_node, "name");
- if (!feature_name || !strlen(feature_name) || !strchr(feature_name, ':')) continue;
- nfname = wm_get_single_attribute(feature_name);
-
- req_att = (char *)wm_xml_get_attr(xml_node, "required");
- if (req_att && !strcmp(req_att, "false")) required = 0;
-
- count = gf_list_count(widget->features);
- for (i = 0; i<count; i++) {
- GF_WidgetFeature *tmp = gf_list_get(widget->features, i);
- if (!strcmp(nfname, tmp->name)) {
- already_in = 1;
- break;
- }
- }
- if (already_in) continue;
-
- GF_SAFEALLOC(feat, GF_WidgetFeature);
- if (!feat) {
- e = GF_OUT_OF_MEM;
- goto exit;
- }
- feat->name = nfname;
- feat->required = required;
- feat->params = gf_list_new();
- gf_list_add(widget->features, feat);
-
- j = 0;
- while ((param_node = gf_list_enum(xml_node->content, &j))) {
- if (param_node->type==GF_XML_NODE_TYPE &&
- param_node->name && !strcmp(param_node->name, "param") &&
- ((!widget_ns_prefix && !param_node->ns) || !strcmp(widget_ns_prefix, param_node->ns))) {
- GF_WidgetFeatureParam *wfp;
- const char *param_name, *param_value;
- char *npname, *npvalue;
-
- param_name = (char *)wm_xml_get_attr(param_node, "name");
- npname = wm_get_single_attribute(param_name);
- if (!strlen(npname)) continue;
-
- param_value = (char *)wm_xml_get_attr(param_node, "value");
- npvalue = wm_get_single_attribute(param_value);
- if (!strlen(npvalue)) {
- gf_free(npname);
- continue;
- }
-
- GF_SAFEALLOC(wfp, GF_WidgetFeatureParam);
- if (!wfp) {
- e = GF_OUT_OF_MEM;
- goto exit;
- }
-
- wfp->name = npname;
- wfp->value = npvalue;
- gf_list_add(feat->params, wfp);
-
- }
- }
-
- }
- }
-
- gf_list_add(wm->widgets, widget);
- }
-
- GF_SAFEALLOC(wi, GF_WidgetInstance);
- if (!wi) {
- e = GF_OUT_OF_MEM;
- goto exit;
- }
-
- wi->widget = widget;
- wi->bound_ifces = gf_list_new();
- wi->output_triggers = gf_list_new();
- wi->components = gf_list_new();
- widget->nb_instances++;
- wi->instance_id = InstanceID;
- wi->permanent = 1;
-
- if (!InstanceID) {
- char szInst[20];
-
- count = gf_list_count(wm->widget_instances);
- for (i=0; i<count; i++) {
- GF_WidgetInstance *awi = gf_list_get(wm->widget_instances, i);
- if (awi->widget == wi->widget)
- wi->instance_id = awi->instance_id;
- }
- wi->instance_id ++;
-
- sprintf(szName, "%s#%s#Instance%d", path, wi->widget->name, wi->instance_id);
- sprintf((char *)wi->secname, "Widget#%08X", gf_crc_32(szName, (u32) strlen(szName)));
-
- /*create section*/
- gf_cfg_set_key(wm->term->user->config, "Widgets", (const char *) wi->secname, " ");
- gf_cfg_set_key(wm->term->user->config, (const char *) wi->secname, "WM:Manifest", wi->widget->url);
- sprintf(szInst, "%d", wi->instance_id);
- gf_cfg_set_key(wm->term->user->config, (const char *) wi->secname, "WM:InstanceID", szInst);
- }
- gf_list_add(wm->widget_instances, wi);
-
-
- if (!skip_context && strstr(path, "http://")) {
- GF_XMLNode *context;
- GF_DownloadSession *ctx_sess = NULL;
- char *ctxPath;
- context = NULL;
-
- /*fetch the remote widget context synchronously and load it */
- ctxPath = gf_malloc(sizeof(char) * (strlen(path) + 1 + 15/*?mpeg-u-context*/));
- strcpy(ctxPath, path);
- if ((strchr(path, '?') == NULL) && (strstr(path, "%3f")==NULL) && (strstr(path, "%3F")==NULL) ) {
- strcat(ctxPath, "?mpeg-u-context");
- } else {
- strcat(ctxPath, "&mpeg-u-context");
- }
-
- /*try to fetch the associated context*/
- ctx_sess = gf_dm_sess_new(wm->term->downloader, (char *)ctxPath, GF_NETIO_SESSION_NOT_THREADED, NULL, NULL, &e);
- if (ctx_sess) {
- e = gf_dm_sess_process(ctx_sess);
- if (e==GF_OK) {
- wi->mpegu_context = gf_xml_dom_new();
- e = gf_xml_dom_parse(wi->mpegu_context , gf_dm_sess_get_cache_name(ctx_sess), NULL, NULL);
- if (!e) {
- context = gf_xml_dom_get_root(wi->mpegu_context);
- if (strcmp(context->name, "contextInformation")) context = NULL;
- }
- }
- gf_dm_sess_del(ctx_sess);
- e = GF_OK;
- }
- gf_free(ctxPath);
- ctxPath = NULL;
-
- if (!context && wi->mpegu_context) {
- gf_xml_dom_del(wi->mpegu_context);
- wi->mpegu_context = NULL;
- }
-
- }
-
-exit:
- if (dom) gf_xml_dom_del(dom);
- if (sess) gf_dm_sess_del(sess);
- if (e || !wi) {
- if (wi) wm_delete_widget_instance(wm, wi);
- else {
- if (wpackage) widget_package_del(wm, wpackage);
- }
- return NULL;
- }
- return wi;
-}
-
-
-static Bool wm_enum_widget(void *cbk, char *file_name, char *file_path, GF_FileEnumInfo *file_info)
-{
- GF_WidgetInstance *wid;
- GF_WidgetManager *wm = (GF_WidgetManager *)cbk;
- wid = wm_load_widget(wm, file_path, 0, 0);
- if (wid) {
- wm_widget_jsbind(wm, wid);
- /*remove section info*/
- gf_cfg_del_section(wm->term->user->config, (const char *) wid->secname);
- gf_cfg_set_key(wm->term->user->config, "Widgets", (const char *) wid->secname, NULL);
- }
- return 0;
-}
-
-static Bool wm_enum_dir(void *cbk, char *file_name, char *file_path, GF_FileEnumInfo *file_info)
-{
- return (gf_enum_directory(file_path, 0, wm_enum_widget, cbk, "mgt")==GF_OK) ? GF_FALSE : GF_TRUE;
-}
-
-
-static JSBool SMJS_FUNCTION(wm_initialize)
-{
- u32 i, count;
- const char*opt;
- SMJS_OBJ
- //SMJS_ARGS
- GF_WidgetManager *wm = (GF_WidgetManager *)SMJS_GET_PRIVATE(c, obj);
-
- count = gf_opts_get_key_count("Widgets");
- for (i=0; i<count; i++) {
- const char *name = gf_opts_get_key_name("Widgets", i);
- /*this is a previously loaded widgets - reload it*/
- if (!strnicmp(name, "Widget#", 7)) {
- const char *manifest = gf_opts_get_key(name, "WM:Manifest");
- if (manifest) {
- const char *ID = gf_opts_get_key(name, "WM:InstanceID");
- u32 instID = ID ? atoi(ID) : 0;
- GF_WidgetInstance *wi = wm_load_widget(wm, manifest, instID, 0);
- if (wi) {
- strcpy((char *)wi->secname, (const char *) name);
- wm_widget_jsbind(wm, wi);
- }
- }
- }
- }
-
- opt = gf_opts_get_key("Widgets", "WidgetStore");
- if (opt) gf_enum_directory(opt, 1, wm_enum_dir, wm, NULL);
-
- return JS_TRUE;
-}
-
-static void widgetmanager_load(GF_JSUserExtension *jsext, GF_SceneGraph *scene, JSContext *c, JSObject *global, Bool unload)
-{
- GF_WidgetManager *wm;
-
- GF_JSAPIParam par;
- JSPropertySpec wmClassProps[] = {
- SMJS_PROPERTY_SPEC(0, 0, 0, 0, 0)
- };
- JSFunctionSpec wmClassFuncs[] = {
- SMJS_FUNCTION_SPEC("initialize", wm_initialize, 0),
- SMJS_FUNCTION_SPEC("load", wm_load, 2),
- SMJS_FUNCTION_SPEC("unload", wm_unload, 1),
- SMJS_FUNCTION_SPEC("get", wm_get, 1),
- SMJS_FUNCTION_SPEC("findByInterface", wm_find_interface, 1),
- SMJS_FUNCTION_SPEC(0, 0, 0)
- };
-
- wm = jsext->udta;
- /*widget manager is only loaded once*/
- if (wm->ctx && (wm->ctx != c)) {
- /*load the 'Widget' object in the global scope*/
- widget_load(wm, scene, c, global, unload);
- return;
- }
-
- /*unload widgets*/
- if (unload) {
- if (wm->obj) {
- gf_js_remove_root(wm->ctx, &wm->obj, GF_JSGC_OBJECT);
- wm->obj = NULL;
- }
-
- while (gf_list_count(wm->widget_instances)) {
- GF_WidgetInstance *widg = gf_list_get(wm->widget_instances, 0);
- wm_delete_widget_instance(wm, widg);
- }
- wm->ctx = NULL;
- return;
- }
- wm->ctx = c;
-
- if (!scene) return;
-
- /*setup JS bindings*/
- JS_SETUP_CLASS(wm->widmanClass, "WIDGETMANAGER", JSCLASS_HAS_PRIVATE, wm_getProperty, wm_setProperty, JS_FinalizeStub);
-
- GF_JS_InitClass(c, global, 0, &wm->widmanClass, 0, 0, wmClassProps, wmClassFuncs, 0, 0);
- wm->obj = JS_DefineObject(c, global, "WidgetManager", &wm->widmanClass._class, 0, 0);
- SMJS_SET_PRIVATE(c, wm->obj, wm);
- gf_js_add_root(c, &wm->obj, GF_JSGC_OBJECT);
-
-
- {
- JSPropertySpec wmWidgetClassProps[] = {
- SMJS_PROPERTY_SPEC(0, 0, 0, 0, 0)
- };
- JSFunctionSpec wmWidgetClassFuncs[] = {
- SMJS_FUNCTION_SPEC("activate", wm_widget_activate, 1),
- SMJS_FUNCTION_SPEC("deactivate", wm_widget_deactivate, 0),
- SMJS_FUNCTION_SPEC("get_interface", wm_widget_get_interface, 1),
- SMJS_FUNCTION_SPEC("bind_output_trigger", wm_widget_bind_output_trigger, 2),
- SMJS_FUNCTION_SPEC("set_input", wm_widget_set_input, 2),
- SMJS_FUNCTION_SPEC("bind_interface", wm_widget_bind_interface, 2),
- SMJS_FUNCTION_SPEC("unbind_interface", wm_widget_unbind_interface, 1),
- SMJS_FUNCTION_SPEC("call_input_action", wm_widget_call_input_action, 1),
- SMJS_FUNCTION_SPEC("call_input_script", wm_widget_call_input_script, 2),
- SMJS_FUNCTION_SPEC("is_interface_bound", wm_widget_is_interface_bound, 1),
- SMJS_FUNCTION_SPEC("get_param_value", wm_widget_get_param_value, 1),
- SMJS_FUNCTION_SPEC("get_context", wm_widget_get_context, 0),
- SMJS_FUNCTION_SPEC("get_component", wm_widget_get_component, 2),
-
- SMJS_FUNCTION_SPEC(0, 0, 0)
- };
- /*setup JS bindings*/
- JS_SETUP_CLASS(wm->wmWidgetClass, "WMWIDGET", JSCLASS_HAS_PRIVATE, wm_widget_getProperty, wm_widget_setProperty, JS_FinalizeStub);
- GF_JS_InitClass(c, global, 0, &wm->wmWidgetClass, 0, 0, wmWidgetClassProps, wmWidgetClassFuncs, 0, 0);
-
- JS_SETUP_CLASS(wm->widgetAnyClass, "WIDGETANY", JSCLASS_HAS_PRIVATE, JS_PropertyStub, JS_PropertyStub_forSetter, JS_FinalizeStub);
- GF_JS_InitClass(c, global, 0, &wm->widgetAnyClass, 0, 0, 0, 0, 0, 0);
- }
-
- JS_SETUP_CLASS(wm->widgetClass, "MPEGWidget", JSCLASS_HAS_PRIVATE, widget_getProperty, widget_setProperty, JS_FinalizeStub);
-
- if (scene->script_action) {
- if (!scene->script_action(scene->script_action_cbck, GF_JSAPI_OP_GET_TERM, scene->RootNode, &par))
- return;
- wm->term = par.term;
- }
-
-}
-
-
-static GF_JSUserExtension *gwm_new()
-{
- GF_JSUserExtension *dr;
- GF_WidgetManager *wm;
- GF_SAFEALLOC(dr, GF_JSUserExtension);
- if (!dr) return NULL;
- GF_REGISTER_MODULE_INTERFACE(dr, GF_JS_USER_EXT_INTERFACE, "WidgetManager JavaScript Bindings", "gpac distribution");
-
- GF_SAFEALLOC(wm, GF_WidgetManager);
- if (!wm) {
- gf_free(dr);
- return NULL;
- }
- wm->widget_instances = gf_list_new();
- wm->widgets = gf_list_new();
- dr->load = widgetmanager_load;
- dr->udta = wm;
- return dr;
-}
-
-
-static void gwm_delete(GF_BaseInterface *ifce)
-{
- GF_WidgetManager *wm;
- GF_JSUserExtension *dr = (GF_JSUserExtension *) ifce;
- if (!dr)
- return;
- wm = dr->udta;
- if (!wm)
- return;
- if (wm->widget_instances)
- gf_list_del(wm->widget_instances);
- wm->widget_instances = NULL;
- if (wm->widgets)
- gf_list_del(wm->widgets);
- wm->widgets = NULL;
- gf_free(wm);
- dr->udta = NULL;
- gf_free(dr);
-}
-#endif
-
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
-#ifdef GPAC_HAS_SPIDERMONKEY
- GF_JS_USER_EXT_INTERFACE,
-#ifndef GPAC_DISABLE_SVG
- GF_SCENE_DECODER_INTERFACE,
-#endif
-
-#endif
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
-#ifdef GPAC_HAS_SPIDERMONKEY
- if (InterfaceType == GF_JS_USER_EXT_INTERFACE) return (GF_BaseInterface *)gwm_new();
-#ifndef GPAC_DISABLE_SVG
- else if (InterfaceType == GF_SCENE_DECODER_INTERFACE) return (GF_BaseInterface *)LoadWidgetReader();
-#endif
-#endif
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- switch (ifce->InterfaceType) {
-#ifdef GPAC_HAS_SPIDERMONKEY
- case GF_JS_USER_EXT_INTERFACE:
- gwm_delete(ifce);
- break;
-#ifndef GPAC_DISABLE_SVG
- case GF_SCENE_DECODER_INTERFACE:
- ShutdownWidgetReader(ifce);
- break;
-#endif
-
-#endif
- }
-}
-
-
-GPAC_MODULE_STATIC_DECLARATION( widgetman )
+++ /dev/null
-//This software module was originally developed by TelecomParisTech in the
-//course of the development of MPEG-U Widgets (ISO/IEC 23007-1) standard.
-//
-//This software module is an implementation of a part of one or
-//more MPEG-U Widgets (ISO/IEC 23007-1) tools as specified by the MPEG-U Widgets
-//(ISO/IEC 23007-1) standard. ISO/IEC gives users of the MPEG-U Widgets
-//(ISO/IEC 23007-1) free license to this software module or modifications
-//thereof for use in hardware or software products claiming conformance to
-//the MPEG-U Widgets (ISO/IEC 23007-1). Those intending to use this software
-//module in hardware or software products are advised that its use may
-//infringe existing patents.
-//The original developer of this software module and his/her company, the
-//subsequent editors and their companies, and ISO/IEC have no liability
-//for use of this software module or modifications thereof in an implementation.
-//Copyright is not released for non MPEG-U Widgets (ISO/IEC 23007-1) conforming
-//products.
-//Telecom ParisTech retains full right to use the code for his/her own purpose,
-//assign or donate the code to a third party and to inhibit third parties from
-//using the code for non MPEG-U Widgets (ISO/IEC 23007-1) conforming products.
-//
-//This copyright notice must be included in all copies or derivative works.
-//
-//Copyright (c) 2009 Telecom ParisTech.
-//
-// Alternatively, this software module may be redistributed and/or modified
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////////
-//
-// Authors:
-// Jean Le Feuvre, Telecom ParisTech
-// Cyril Concolato, Telecom ParisTech
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-#ifndef _WIDGETMAN_H_
-#define _WIDGETMAN_H_
-
-#include "unzip.h"
-
-/*base SVG type*/
-#include <gpac/modules/js_usr.h>
-
-#ifdef GPAC_HAS_SPIDERMONKEY
-
-#include <gpac/nodes_mpeg4.h>
-#include <gpac/nodes_x3d.h>
-#include <gpac/nodes_svg.h>
-/*dom events*/
-#include <gpac/events.h>
-
-#include <gpac/download.h>
-#include <gpac/crypt.h>
-#include <gpac/network.h>
-#include <gpac/xml.h>
-#include <gpac/internal/scenegraph_dev.h>
-
-
-#include <gpac/isomedia.h>
-
-#include <gpac/internal/smjs_api.h>
-
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/compositor_dev.h>
-
-
-JSBool gf_sg_js_event_add_listener(JSContext *c, JSObject *obj, uintN argc, jsval *argv, jsval *rval, GF_Node *vrml_node);
-JSBool gf_sg_js_event_remove_listener(JSContext *c, JSObject *obj, uintN argc, jsval *argv, jsval *rval, GF_Node *vrml_node);
-
-typedef struct _widget_manager
-{
- JSContext *ctx;
- /*widget manager class*/
- GF_JSClass widmanClass;
- /*widget class used by the widget manager*/
- GF_JSClass wmWidgetClass;
-
- /*widget class used by the widget scripts*/
- GF_JSClass widgetClass;
-
- GF_JSClass widgetAnyClass;
-
- JSObject *obj;
- GF_Terminal *term;
- GF_List *widget_instances;
- /*list of loaded prototypes (eg 1 per all instances of the same widget*/
- GF_List *widgets;
-} GF_WidgetManager;
-
-
-
-enum
-{
- GF_WPIN_STRING,
- GF_WPIN_INTEGER,
- GF_WPIN_NUMBER,
-};
-
-typedef struct
-{
- char *inner_path;
- char *extracted_path;
- Bool extracted;
-} GF_WidgetPackageResource;
-
-typedef struct _widget_package_relocator
-{
- GF_TERM_URI_RELOCATOR
- GF_List *resources;
- struct _widget *widget;
- GF_WidgetManager *wm;
- Bool is_zip;
- char root_extracted_path[GF_MAX_PATH];
- char archive_id[14];
- char *package_path;
- GF_DownloadSession *sess;
-} GF_WidgetPackage;
-
-
-enum
-{
- GF_WM_PARAM_OUTPUT,
- GF_WM_PARAM_INPUT,
- GF_WM_INPUT_ACTION,
- GF_WM_OUTPUT_TRIGGER,
- GF_WM_BIND_ACTION,
- GF_WM_UNBIND_ACTION,
- GF_WM_PREF_CONNECT,
- GF_WM_ACTIVATE_TRIGGER,
- GF_WM_DEACTIVATE_TRIGGER,
- GF_WM_PREF_SAVEDACTION,
- GF_WM_PREF_RESTOREDACTION,
- GF_WM_PREF_SAVETRIGGER,
- GF_WM_PREF_RESTORETRIGGER,
-};
-
-#define GF_WM_PARAM_SCRIPT_STRING (u16) 0
-#define GF_WM_PARAM_SCRIPT_BOOL (u16) 1
-#define GF_WM_PARAM_SCRIPT_NUMBER (u16) 2
-
-typedef struct
-{
- struct __widget_message *msg;
-
- u16 type;
- u16 script_type;
- Bool in_action;
-
- char *name;
- char *node;
- char *attribute;
- char *default_value;
-} GF_WidgetPin;
-
-typedef struct __widget_message
-{
- struct _widget_interface *ifce;
-
- char *name;
- Bool is_output;
- GF_List *params;
-
- GF_WidgetPin *input_action;
- GF_WidgetPin *output_trigger;
-
-} GF_WidgetMessage;
-
-typedef struct _widget_interface
-{
- struct __widget_content *content;
- char *type;
- GF_List *messages;
-
- GF_WidgetPin *bind_action;
- GF_WidgetPin *unbind_action;
- Bool provider, multiple_binding, required;
- char *connectTo;
-
- JSObject *obj;
-} GF_WidgetInterface;
-
-typedef struct _widget_component
-{
- struct __widget_content *content;
- char *id; /*may be NULL*/
- char *src; /*may be NULL*/
- GF_List *required_interfaces; /*may be empty*/
- GF_WidgetPin *activateTrigger;
- GF_WidgetPin *deactivateTrigger;
- GF_WidgetPin *activatedAction;
- GF_WidgetPin *deactivatedAction;
-} GF_WidgetComponent;
-
-enum
-{
- GF_WM_PREF_READONLY = 1,
- GF_WM_PREF_SAVE = 1<<1,
- GF_WM_PREF_MIGRATE = 1<<2,
-};
-
-typedef struct
-{
- char *name, *value;
- u32 flags;
- GF_WidgetPin *connectTo;
-} GF_WidgetPreference;
-
-typedef struct
-{
- char *name, *value;
-} GF_WidgetFeatureParam;
-
-typedef struct
-{
- char *name;
- Bool required;
- GF_List *params;
-} GF_WidgetFeature;
-
-typedef struct __widget_content
-{
- struct _widget *widget;
-
- char *src;
- char *relocated_src;
- u32 width, height;
-
- char *encoding, *mimetype;
-
- GF_List *interfaces;
- GF_List *components;
- /*list of preferences for the widget content*/
- GF_List *preferences;
-
- GF_WidgetPin *savedAction;
- GF_WidgetPin *restoredAction;
- GF_WidgetPin *saveTrigger;
- GF_WidgetPin *restoreTrigger;
-} GF_WidgetContent;
-
-typedef struct _widget
-{
- GF_WidgetManager *wm;
-
- u32 nb_instances;
-
- /* url to the file.wgt file when zip packaged or to the config.xml file when unpackaged */
- char *url;
- /* path to the manifest/config document */
- char *manifest_path;
-
- GF_List *icons;
- /*
- GF_WidgetContent *simple;
- char *icon_url;
- */
- GF_WidgetContent *main;
-
- GF_WidgetPackage *wpack;
-
- /*misc metadata for W3C Widgets API*/
- char *name, *shortname, *identifier,
- *authorName, *authorEmail, *authorHref,
- *description, *version,
- *uuid, *license, *licenseHref, *viewmodes;
-
- u32 width, height;
-
- GF_List *features;
-
- Bool discardable, multipleInstance;
-
- /*when a widget is being received from a remote peer,
- we remember where we locally store it to be able to further remote it
- This is only supported for packaged widgets*/
- char *local_path;
-} GF_Widget;
-
-typedef struct _widget_instance
-{
- GF_Widget *widget;
-
- u32 instance_id;
- JSObject *obj;
- u8 secname[18];
- GF_SceneGraph *scene;
- /*node in the widget manager which holds the widget: Inline {} , <animation>, ...*/
- GF_Node *anchor;
-
- Bool activated, permanent;
-
- GF_List *output_triggers;
- GF_List *bound_ifces;
- /*list of components for a parent widget*/
- GF_List *components;
- /*parent of the widget for a component widget*/
- struct _widget_instance *parent;
-
- GF_DOMParser *mpegu_context;
-
-
- /*scripting context of the widget scene*/
- JSContext *scene_context;
- JSObject *scene_global;
- /*"Widget" object in the scene*/
- JSObject *scene_obj;
-} GF_WidgetInstance;
-
-
-typedef struct
-{
- GF_WidgetInterface *ifce;
- GF_WidgetInstance *wid;
- char *hostname;
- JSObject *obj;
- JSObject *cookie;
-} GF_WidgetInterfaceInstance;
-
-typedef struct
-{
- GF_WidgetComponent *comp;
- GF_WidgetInstance *wid;
-} GF_WidgetComponentInstance;
-
-
-GF_WidgetInstance *wm_load_widget(GF_WidgetManager *wm, const char *path, u32 InstanceID, Bool skip_context);
-
-
-JSBool SMJS_FUNCTION(widget_has_feature);
-JSBool SMJS_FUNCTION(widget_open_url);
-JSBool SMJS_FUNCTION(widget_get_attention);
-JSBool SMJS_FUNCTION(widget_show_notification);
-JSBool SMJS_FUNCTION(widget_get_interface);
-SMJS_DECL_FUNC_PROP_GET(widget_getProperty);
-SMJS_DECL_FUNC_PROP_SET(widget_setProperty);
-
-void widget_on_interface_bind(GF_WidgetInterfaceInstance *ifce, Bool unbind);
-
-void widget_load(GF_WidgetManager *wm, GF_SceneGraph *scene, JSContext *c, JSObject *global, Bool unload);
-
-GF_WidgetComponentInstance *wm_activate_component(JSContext *c, GF_WidgetInstance *wid, GF_WidgetComponent *comp, Bool skip_wm_notification);
-
-void wm_deactivate_component(JSContext *c, GF_WidgetInstance *wid, GF_WidgetComponent *comp, GF_WidgetComponentInstance *comp_inst);
-
-
-
-const char *wm_xml_get_attr(GF_XMLNode *root, const char *name);
-
-GF_BaseInterface *LoadWidgetReader();
-void ShutdownWidgetReader(GF_BaseInterface *ifce);
-
-
-#endif /*GPAC_HAS_SPIDERMONKEY*/
-
-#endif
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/wiiis
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-CFLAGS+= -I"$(LOCAL_INC_PATH)"
-EXTRALIBS+= -L../../extra_lib/lib/gcc -lwiiuse
-
-#common obj
-OBJS= wiiis.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_wiiis$(DYN_LIB_SUFFIX)
-ifeq ($(CONFIG_WIN32),yes)
-#LDFLAGS+=-export-symbols wiiis.def
-endif
-
-
-all: $(LIB)
-
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac $(LDFLAGS)
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-InitialObjectDescriptor {
- objectDescriptorID 1
- ODProfileLevelIndication 0x01
- sceneProfileLevelIndication 0x01
- audioProfileLevelIndication 0xFF
- visualProfileLevelIndication 0xFE
- graphicsProfileLevelIndication 0x01
-
- esdescr [
- ES_Descriptor {
- es_id 1
- decConfigDescr DecoderConfigDescriptor {
- streamType 3
- decSpecificInfo BIFSConfig {
- isCommandStream true
- pixelMetric true
- pixelWidth 400
- pixelHeight 400
- }
- }
- }
- ES_Descriptor {
- es_id 2
- decConfigDescr DecoderConfigDescriptor {
- streamType 1
- }
- }
- ]
-}
-
-OrderedGroup {
-//Group {
- children [
- Background2D {backColor 1 1 1}
-
- WorldInfo {
- title "InputSensor Test - StringSensor device"
- info ["This shows usage of String Sensor" "" "GPAC Regression Tests" "(C) 2002 ENST"]
- }
- DEF VP Viewpoint {
- position 0 0 400
- }
-
- Transform2D {
- children [
- Shape {
- appearance DEF APP Appearance {
- material Material2D {
- emissiveColor 0.0 0.0 0.0
- filled TRUE
- }
- }
- geometry DEF TEXT Text {
- string [ "WiiMote Sensor" ]
- fontStyle FontStyle {
- justify [ "MIDDLE" "MIDDLE" ]
- size 20.0
- }
- }
- }
- ]
- }
- DEF RECT Transform2D {
- children [
- Shape {
- appearance Appearance {
- material Material2D {
- emissiveColor 1 0 0
- filled TRUE
- }
- }
-# geometry Box { size 100 100 100 }
- geometry Rectangle { size 100 100 }
- }
- ]
- }
-
- DEF SC Script {
- eventIn SFInt32 on_uid
- eventIn SFBool on_key_one
- eventIn SFBool on_key_two
- eventIn SFBool on_key_A
- eventIn SFBool on_key_B
- eventIn SFBool on_key_minus
- eventIn SFBool on_key_home
- eventIn SFBool on_key_plus
- eventIn SFBool on_key_left
- eventIn SFBool on_key_right
- eventIn SFBool on_key_down
- eventIn SFBool on_key_up
- eventIn SFVec3f on_ypr
- eventIn SFVec3f on_gravity
-
- field SFNode text USE TEXT
- field SFNode rect USE RECT
- field SFNode vp USE VP
- url "javascript:
-
-function initialize()
-{
- uid=0;
- key_one = key_two = key_A = key_B = key_minus = key_home = key_plus = key_left = key_right = key_down = key_up = FALSE;
- ypr = new SFVec3f(0,0,0);
- grav = new SFVec3f(0,0,0);
- h_rot = new SFRotation(0,1,0,0);
- v_rot = new SFRotation(1,0,0,0);
-}
-
-function update()
-{
- text.string[1] = 'UID '+uid;
- text.string[2] = '1 '+key_one + ' ; 2 '+key_two;
- text.string[3] = 'A '+key_A + ' ; B '+key_B;
- text.string[4] = '- '+key_minus + ' ; home '+key_home + ' ; + '+key_plus;
- text.string[5] = 'left '+key_left + ' ; right '+key_right + ' ; down '+key_down + ' ; up '+key_up;
- text.string[6] = 'Yaw '+ypr.x;
- text.string[7] = 'Pitch '+ypr.y;
- text.string[8] = 'Roll '+ypr.z;
- text.string[9] = 'GravX '+grav.x;
- text.string[10] = 'GravY '+grav.y;
- text.string[11] = 'GravZ '+grav.z;
-
-// rect.rotationAngle = -ypr.y;
- h_rot.angle = -ypr.z;
- v_rot.angle = -ypr.y;
- vp.orientation = h_rot.multiply(v_rot);
-
- if (key_A) vp.position.z -= 40;
- else if (key_B) vp.position.z += 40;
-
- rect.rotationAngle = -grav.z;
-}
-
-function on_uid(value)
-{
- uid=value;
- update();
-}
-
-function on_key_one(value)
-{
- key_one=value;
- update();
-}
-function on_key_two(value)
-{
- key_two=value;
- update();
-}
-function on_key_A(value)
-{
-print(''+value);
- key_A=value;
- update();
-}
-function on_key_B(value)
-{
- key_B=value;
- update();
-}
-function on_key_minus(value)
-{
- key_minus=value;
- update();
-}
-function on_key_home(value)
-{
- key_home=value;
- update();
-}
-function on_key_plus(value)
-{
- key_plus=value;
- update();
-}
-function on_key_left(value)
-{
- key_left=value;
- update();
-}
-function on_key_right(value)
-{
- key_right=value;
- update();
-}
-function on_key_down(value)
-{
- key_down=value;
- update();
-}
-function on_key_up(value)
-{
- key_up=value;
- update();
-}
-function on_ypr(value)
-{
- ypr = value;
- update();
-}
-function on_gravity(value)
-{
- grav = value;
- update();
-}
-
-
- "
- }
-
- InputSensor {
- url [ "10" ]
- buffer {
- REPLACE SC.on_uid BY 0
- REPLACE SC.on_key_one BY FALSE
- REPLACE SC.on_key_two BY FALSE
- REPLACE SC.on_key_A BY FALSE
- REPLACE SC.on_key_B BY FALSE
- REPLACE SC.on_key_minus BY FALSE
- REPLACE SC.on_key_home BY FALSE
- REPLACE SC.on_key_plus BY FALSE
- REPLACE SC.on_key_left BY FALSE
- REPLACE SC.on_key_right BY FALSE
- REPLACE SC.on_key_down BY FALSE
- REPLACE SC.on_key_up BY FALSE
- REPLACE SC.on_ypr BY 0 0 0
- REPLACE SC.on_gravity BY 0 0 0
- }
- }
- ]
-}
-
-
-AT 0 {
- UPDATE OD [
- ObjectDescriptor {
- objectDescriptorID 10
- esdescr [
- ES_Descriptor {
- es_id 5
- decConfigDescr DecoderConfigDescriptor {
- streamType 0x0A
- decSpecificInfo UIConfig {
- deviceName "WiiMote"
- }
- }
- }
- ]
- }
- ]
-}
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2009-2012
- * All rights reserved
- *
- * This file is part of GPAC / Dummy input module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <gpac/modules/codec.h>
-#include <gpac/scenegraph_vrml.h>
-#include <gpac/thread.h>
-
-#include <wiiuse.h>
-
-typedef struct
-{
- u32 nb_wiimotes;
- wiimote** wiimotes;
- Bool running;
- u32 prev_id;
-
- GF_Thread *th;
-} GF_WiiMote;
-
-static Bool WII_RegisterDevice(struct __input_device *ifce, const char *urn, GF_BitStream *dsi, void (*AddField)(struct __input_device *_this, u32 fieldType, const char *name))
-{
- const char *opt;
- GF_WiiMote *wii = (GF_WiiMote *)ifce->udta;
- if (strcmp(urn, "WiiMote")) return 0;
-
- /*init wiiuse lib*/
- opt = gf_opts_get_key("WII", "MaxWiimotes");
- if (opt) wii->nb_wiimotes = atoi(opt);
- if (!wii->nb_wiimotes) wii->nb_wiimotes = 1;
-
- wii->wiimotes = wiiuse_init(wii->nb_wiimotes);
- if (!wii->wiimotes) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[Wii] Cannot initialize wiiuse library\n"));
- return 0;
- }
-
- /*declare the interface*/
- AddField(ifce, GF_SG_VRML_SFINT32, "uid");
- AddField(ifce, GF_SG_VRML_SFBOOL, "1");
- AddField(ifce, GF_SG_VRML_SFBOOL, "2");
- AddField(ifce, GF_SG_VRML_SFBOOL, "A");
- AddField(ifce, GF_SG_VRML_SFBOOL, "B");
- AddField(ifce, GF_SG_VRML_SFBOOL, "-");
- AddField(ifce, GF_SG_VRML_SFBOOL, "home");
- AddField(ifce, GF_SG_VRML_SFBOOL, "+");
- AddField(ifce, GF_SG_VRML_SFBOOL, "left");
- AddField(ifce, GF_SG_VRML_SFBOOL, "right");
- AddField(ifce, GF_SG_VRML_SFBOOL, "down");
- AddField(ifce, GF_SG_VRML_SFBOOL, "up");
- AddField(ifce, GF_SG_VRML_SFVEC3F, "ypr");
- AddField(ifce, GF_SG_VRML_SFVEC3F, "gravity");
-
- return 1;
-}
-
-#define WRITE_BUTTON(_b) \
- if (IS_JUST_PRESSED(wm, _b)) { gf_bs_write_int(bs, 1, 1); gf_bs_write_int(bs, 1, 1); } \
- else if (IS_RELEASED(wm, _b)) { gf_bs_write_int(bs, 1, 1); gf_bs_write_int(bs, 0, 1); } \
- else gf_bs_write_int(bs, 0, 1); \
-
-
-#define WII_PI 3.1415926535898f
-
-static u32 WII_Run(void *par)
-{
- GF_BitStream *bs;
- char *buf;
- u32 i, buf_size, count, scan_delay;
- const char *opt;
-
- GF_InputSensorDevice *ifce = (GF_InputSensorDevice *)par;
- GF_WiiMote *wii = (GF_WiiMote *)ifce->udta;
-
-
- scan_delay = 5;
- opt = gf_opts_get_key("WII", "ScanDelay");
- if (opt) scan_delay = atoi(opt);
-
- /*locate the wiimotes*/
- count = wiiuse_find(wii->wiimotes, wii->nb_wiimotes, scan_delay);
- GF_LOG(GF_LOG_INFO, GF_LOG_MMIO, ("[Wii] Found %d wiimotes\n", count));
- count = wiiuse_connect(wii->wiimotes, wii->nb_wiimotes);
- if (count) {
- GF_LOG(GF_LOG_INFO, GF_LOG_MMIO, ("[Wii] Connected to %d connected wiimotes\n", count));
- } else {
- GF_LOG(GF_LOG_INFO, GF_LOG_MMIO, ("[Wii] Failed to connect to any wiimote\n"));
- }
-
- opt = gf_opts_get_key("WII", "MotionSensing");
- /*enable motion sensing*/
- if (!opt || !strcmp(opt, "yes")) {
- Float smooth_alpha = 0.5;
- Float ori_threshold = 10.0;
- opt = gf_opts_get_key("WII", "OrientationThreshold");
- if (opt) ori_threshold = (Float) atof(opt);
- opt = gf_opts_get_key("WII", "SmoothAlpha");
- if (opt) {
- smooth_alpha = (Float) atof(opt);
- if (smooth_alpha<0) smooth_alpha = 0.5;
- else if (smooth_alpha>1.0) smooth_alpha=0.5;
- }
- GF_LOG(GF_LOG_INFO, GF_LOG_MMIO, ("[Wii] Enabling motion sensing - Alpha smoothing %f - Orientation Threshold %f\n", smooth_alpha, ori_threshold));
-
- for (i=0; i<count; i++) {
- wiiuse_motion_sensing(wii->wiimotes[i], 1);
- wiiuse_set_smooth_alpha(wii->wiimotes[i],smooth_alpha);
- wiiuse_set_orient_threshold(wii->wiimotes[i], ori_threshold);
- }
- }
-
- while (wii->running) {
- count = wiiuse_poll(wii->wiimotes, wii->nb_wiimotes);
- if (!count) {
- continue;
- }
- for (i=0; i<count; i++) {
- struct wiimote_t* wm = wii->wiimotes[i];
- switch (wm->event) {
- case WIIUSE_EVENT:/* A generic event occured on the wiimote. */
- /*create the data frame*/
- bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
- /*if not the same wiimote write the UID*/
- if (wii->prev_id != wm->unid) {
- gf_bs_write_int(bs, 1, 1);
- gf_bs_write_int(bs, wm->unid, 32);
- wii->prev_id = wm->unid;
- } else {
- gf_bs_write_int(bs, 0, 1);
- }
-
- /*write buttons state*/
- WRITE_BUTTON(WIIMOTE_BUTTON_ONE);
- WRITE_BUTTON(WIIMOTE_BUTTON_TWO);
- WRITE_BUTTON(WIIMOTE_BUTTON_A);
- WRITE_BUTTON(WIIMOTE_BUTTON_B);
- WRITE_BUTTON(WIIMOTE_BUTTON_MINUS);
- WRITE_BUTTON(WIIMOTE_BUTTON_HOME);
- WRITE_BUTTON(WIIMOTE_BUTTON_PLUS);
- WRITE_BUTTON(WIIMOTE_BUTTON_LEFT);
- WRITE_BUTTON(WIIMOTE_BUTTON_RIGHT);
- WRITE_BUTTON(WIIMOTE_BUTTON_DOWN);
- WRITE_BUTTON(WIIMOTE_BUTTON_UP);
-
- /*write yaw-pitch-roll - FIXME: wiiuse seems to output NaN in these values upon init*/
- gf_bs_write_int(bs, 1, 1);
- gf_bs_write_float(bs, WII_PI * wm->orient.yaw / 24 );
- gf_bs_write_float(bs, WII_PI * wm->orient.pitch / 180);
- gf_bs_write_float(bs, WII_PI * wm->orient.roll / 180);
-
- /*write gravity - FIXME: wiiuse seems to output NaN in these values upon init*/
- gf_bs_write_int(bs, 1, 1);
- gf_bs_write_float(bs, wm->gforce.x);
- gf_bs_write_float(bs, wm->gforce.y);
- gf_bs_write_float(bs, wm->gforce.z);
-
- gf_bs_align(bs);
- gf_bs_get_content(bs, &buf, &buf_size);
- gf_bs_del(bs);
-
- ifce->DispatchFrame(ifce, buf, buf_size);
- gf_free(buf);
- break;
- case WIIUSE_STATUS: /*A status report was obtained from the wiimote. */
- break;
- case WIIUSE_DISCONNECT:/*The wiimote disconnected. */
- break;
- case WIIUSE_READ_DATA:/* Data was returned that was previously requested from the wiimote ROM/registers. */
- break;
- case WIIUSE_NUNCHUK_INSERTED:
- case WIIUSE_NUNCHUK_REMOVED:
- case WIIUSE_CLASSIC_CTRL_INSERTED:
- case WIIUSE_CLASSIC_CTRL_REMOVED:
- case WIIUSE_GUITAR_HERO_3_CTRL_INSERTED:
- case WIIUSE_GUITAR_HERO_3_CTRL_REMOVED:
- break;
- }
- }
- }
- return 0;
-}
-
-static void WII_Start(struct __input_device *ifce)
-{
- GF_WiiMote *wii = (GF_WiiMote *)ifce->udta;
- wii->running = 1;
- gf_th_run(wii->th, WII_Run, ifce);
-}
-
-static void WII_Stop(struct __input_device *ifce)
-{
- GF_WiiMote *wii = (GF_WiiMote *)ifce->udta;
- wii->running = 0;
-}
-
-
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_INPUT_DEVICE_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- GF_WiiMote *wii;
- GF_InputSensorDevice *plug;
- if (InterfaceType != GF_INPUT_DEVICE_INTERFACE) return NULL;
-
- GF_SAFEALLOC(plug, GF_InputSensorDevice);
- GF_REGISTER_MODULE_INTERFACE(plug, GF_INPUT_DEVICE_INTERFACE, "GPAC Wiimote InputSensor", "gpac distribution")
-
- plug->RegisterDevice = WII_RegisterDevice;
- plug->Start = WII_Start;
- plug->Stop = WII_Stop;
-
- GF_SAFEALLOC(wii, GF_WiiMote);
- plug->udta = wii;
- wii->th = gf_th_new("WiiMote");
- return (GF_BaseInterface *)plug;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *bi)
-{
- GF_WiiMote *wii;
- GF_InputSensorDevice *ifce = (GF_InputSensorDevice*)bi;
- if (ifce->InterfaceType!=GF_INPUT_DEVICE_INTERFACE) return;
-
- wii = ifce->udta;
- if (wii->wiimotes) {
- wiiuse_cleanup(wii->wiimotes, wii->nb_wiimotes);
- }
- gf_free(wii);
- gf_free(bi);
-}
-
-GPAC_MODULE_STATIC_DECLARATION( wiiis )
+++ /dev/null
-include ../../config.mak
-
-vpath %.c $(SRC_PATH)/modules/oss_audio
-
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include" $(OSS_CFLAGS)
-LDFLAGS+=$(OSS_LDFLAGS)
-
-ifeq ($(DEBUGBUILD),yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD),yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-ifeq ($(OSS_INC_TYPE),yes)
-else
-CFLAGS+=-DOSS_FIX_INC
-endif
-
-ifeq ($(TARGET_ARCH_ARMV4L),yes)
-CFLAGS+=-DFORCE_SR_LIMIT
-endif
-
-#common obj
-OBJS= oss.o
-
-SRCS := $(OBJS:.o=.c)
-
-LIB=gm_oss_audio$(DYN_LIB_SUFFIX)
-
-
-all: $(LIB)
-
-$(LIB): $(OBJS)
- $(CC) $(SHFLAGS) $(LDFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac
-ifeq ($(STATICBUILD),yes)
- $(CC) $(SHFLAGS) -o ../../bin/gcc/gm_oss_audio-static$(DYN_LIB_SUFFIX) $(OBJS) $(EXTRALIBS) -L../../bin/gcc -lgpac_static $(OSS_LDFLAGS) $(LDFLAGS)
-endif
-
-clean:
- rm -f $(OBJS) ../../bin/gcc/$(LIB)
-
-dep: depend
-
-depend:
- rm -f .depend
- $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
- rm -f Makefile.bak .depend
-
--include .depend
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2000-2012
- * All rights reserved
- *
- * This file is part of GPAC / linux_oss audio render module
- *
- * GPAC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GPAC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#if defined(__DARWIN__) || defined(__APPLE__)
-#include <soundcard.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <string.h>
-
-#else
-
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#ifdef OSS_FIX_INC
-#include <soundcard.h>
-#else
-#include <sys/soundcard.h>
-#endif
-
-#endif
-
-#include <gpac/modules/audio_out.h>
-
-#define OSS_AUDIO_DEVICE "/dev/dsp"
-
-typedef struct
-{
- int audio_dev, sr, nb_ch;
- u32 buf_size, delay, num_buffers, total_duration;
- u32 force_sr;
- char *wav_buf;
-} OSSContext;
-
-
-#define OSSCTX() OSSContext *ctx = (OSSContext *)dr->opaque;
-
-
-static GF_Err OSS_Setup(GF_AudioOutput*dr, void *os_handle, u32 num_buffers, u32 total_duration)
-{
- int audio;
- const char *opt;
- OSSCTX();
-
- opt = gf_opts_get_key("core", "force-alsarate");
- if (opt) ctx->force_sr = atoi(opt);
-
- /*open OSS in non-blocking mode*/
- audio = open(OSS_AUDIO_DEVICE, 0);
- if (audio < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("[OSS] Cannot open audio device\n"));
- return GF_NOT_SUPPORTED;
- }
-
- /*set blocking mode back*/
- //fcntl(audio, F_SETFL, fcntl(audio, F_GETFL) & ~FNDELAY);
- ctx->audio_dev=audio;
- ctx->num_buffers = num_buffers;
- ctx->total_duration = total_duration;
- return GF_OK;
-}
-
-static void OSS_Shutdown(GF_AudioOutput*dr)
-{
- OSSCTX();
- ioctl(ctx->audio_dev,SNDCTL_DSP_RESET,NULL);
- close(ctx->audio_dev);
- if (ctx->wav_buf) gf_free(ctx->wav_buf);
- ctx->wav_buf = NULL;
-}
-
-
-static GF_Err OSS_Configure(GF_AudioOutput*dr, u32 *SampleRate, u32 *NbChannels, u32 *audioFormat, u32 channel_cfg)
-{
- int format, blockalign, nb_bufs, frag_spec;
- long flags;
- OSSCTX();
-
- if (!ctx) return GF_BAD_PARAM;
- /* reset and reopen audio-device */
- ioctl(ctx->audio_dev,SNDCTL_DSP_RESET,NULL);
- close(ctx->audio_dev);
- if (ctx->wav_buf) gf_free(ctx->wav_buf);
- ctx->wav_buf = NULL;
- ctx->audio_dev=open(OSS_AUDIO_DEVICE,O_WRONLY|O_NONBLOCK);
- if (!ctx->audio_dev) return GF_IO_ERR;
-
- /* Make the file descriptor use blocking writes with fcntl() so that
- we don't have to handle sleep() ourselves*/
- flags = fcntl(ctx->audio_dev, F_GETFL);
- flags &= ~O_NONBLOCK;
- if (fcntl(ctx->audio_dev, F_SETFL, flags) < 0 ) return GF_IO_ERR;
-
- ctx->nb_ch = (int) (*NbChannels);
- if (ioctl(ctx->audio_dev, SNDCTL_DSP_CHANNELS, &ctx->nb_ch)==-1) return GF_IO_ERR;
-
- blockalign = ctx->nb_ch;
-
- //only support for PCM 8/16/24/32 packet mode
- switch (*audioFormat) {
- case GF_AUDIO_FMT_U8:
- format = AFMT_S8;
- break;
- default:
- //otherwise force PCM16
- *audioFormat = GF_AUDIO_FMT_S16;
- case GF_AUDIO_FMT_S16:
- blockalign *= 2;
- format = AFMT_S16_LE;
- break;
- }
- if(ioctl(ctx->audio_dev, SNDCTL_DSP_SETFMT,&format)==-1) return GF_IO_ERR;
- ctx->sr = (*SampleRate);
- if(ioctl(ctx->audio_dev, SNDCTL_DSP_SPEED,&ctx->sr)==-1) return GF_IO_ERR;
-
- nb_bufs = ctx->num_buffers ? ctx->num_buffers : 8;
- ctx->buf_size = (*SampleRate * blockalign * ctx->total_duration) / (1000 * nb_bufs);
- frag_spec = 4;
- while (ctx->buf_size > (1<<(frag_spec+1)))
- frag_spec++;
-
- ctx->buf_size = 1<<frag_spec;
-
- ctx->delay = (1000*ctx->buf_size) / (*SampleRate * blockalign);
- frag_spec = ((nb_bufs<<16) & 0xFFFF0000) | frag_spec;
-
- ctx->delay = (1000*ctx->buf_size*nb_bufs) / (*SampleRate * blockalign);
- if ( ioctl(ctx->audio_dev, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) return GF_IO_ERR;
-
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[OSS] setup %d buffers %d bytes each (%d ms buffer delay)", nb_bufs, ctx->buf_size, ctx->delay));
- ctx->wav_buf = gf_realloc(ctx->wav_buf, ctx->buf_size*sizeof(char));
- if(!ctx->wav_buf) return GF_OUT_OF_MEM;
- memset(ctx->wav_buf, 0, ctx->buf_size*sizeof(char));
- return GF_OK;
-}
-
-static void OSS_WriteAudio(GF_AudioOutput*dr)
-{
- u32 written;
- OSSCTX();
- written = dr->FillBuffer(dr->audio_renderer, ctx->wav_buf, ctx->buf_size);
- /*this will also perform sleep*/
- if (written) {
- u32 reallyWritten = write(ctx->audio_dev, ctx->wav_buf, written);
- if (reallyWritten != written) {
- GF_LOG(GF_LOG_INFO, GF_LOG_MMIO, ("[OSS] Failed to write all audio to device, has written %u, should have %u", reallyWritten, written));
- }
- }
-}
-
-static void OSS_SetVolume(GF_AudioOutput*dr, u32 Volume) {}
-static void OSS_SetPan(GF_AudioOutput*dr, u32 Pan) {}
-static void OSS_SetPriority(GF_AudioOutput*dr, u32 Priority) {}
-static u32 OSS_GetAudioDelay(GF_AudioOutput*dr)
-{
- OSSCTX()
- return ctx->delay;
-}
-
-/*
- * to get the best matching samplerate the oss-device can be set up
- * with the desired sr. if not supported the returned value contains the
- * best matching sr.
- *
- * todo: supported samplerate could depend on nb_channels and format
- */
-static GF_Err OSS_QueryOutputSampleRate(GF_AudioOutput*dr, u32 *desired_sr, u32 *NbChannels, u32 *nbBitsPerSample)
-{
-#ifdef FORCE_SR_LIMIT
- *NbChannels = 2;
- if (!( *desired_sr % 11025)) return GF_OK;
- if (*desired_sr<22050) *desired_sr = 22050;
- else *desired_sr = 44100;
- return GF_OK;
-#else
- /* reset and reopen audio-device */
- int i;
- OSSCTX();
- if (ctx->force_sr) {
- *desired_sr = ctx->force_sr;
- return GF_OK;
- }
- i=*desired_sr;
- if(ioctl(ctx->audio_dev, SNDCTL_DSP_SPEED,&i)==-1) return GF_IO_ERR;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[OSS] uses samplerate %d for desired sr %d\n", i, *desired_sr));
- *desired_sr = i;
- i = *NbChannels;
- if(ioctl(ctx->audio_dev,SNDCTL_DSP_CHANNELS, &i)==-1) return GF_IO_ERR;
- GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[OSS] uses %d channels for %d desired ones\n", i, *NbChannels));
- *NbChannels = i;
- if(ioctl(ctx->audio_dev, SNDCTL_DSP_SPEED,&ctx->sr)==-1) return GF_OK;
- if(ioctl(ctx->audio_dev,SNDCTL_DSP_CHANNELS, &ctx->nb_ch)==-1) return GF_OK;
- return GF_OK;
-#endif
-}
-
-void *NewOSSRender()
-{
- OSSContext *ctx;
- GF_AudioOutput*driv;
- ctx = gf_malloc(sizeof(OSSContext));
- if(!ctx)
- return NULL;
- memset(ctx, 0, sizeof(OSSContext));
- driv = gf_malloc(sizeof(GF_AudioOutput));
- if(!driv)
- {
- gf_free(ctx);
- ctx=NULL;
- return NULL;
- }
- memset(driv, 0, sizeof(GF_AudioOutput));
- driv->opaque = ctx;
- driv->SelfThreaded = 0;
- driv->Setup = OSS_Setup;
- driv->Shutdown = OSS_Shutdown;
- driv->Configure = OSS_Configure;
- driv->GetAudioDelay = OSS_GetAudioDelay;
- driv->SetVolume = OSS_SetVolume;
- driv->SetPan = OSS_SetPan;
- driv->SetPriority = OSS_SetPriority;
- driv->QueryOutputSampleRate = OSS_QueryOutputSampleRate;
- driv->WriteAudio = OSS_WriteAudio;
-
- GF_REGISTER_MODULE_INTERFACE(driv, GF_AUDIO_OUTPUT_INTERFACE, "OSS Audio Output", "gpac distribution");
- return driv;
-}
-
-void DeleteOSSRender(void *ifce)
-{
- GF_AudioOutput*dr = (GF_AudioOutput*) ifce;
- OSSContext *ctx = (OSSContext *)dr->opaque;
- gf_free(ctx);
- gf_free(dr);
-}
-
-
-/*
- * ********************************************************************
- * interface
- */
-GPAC_MODULE_EXPORT
-const u32 *QueryInterfaces()
-{
- static u32 si [] = {
- GF_AUDIO_OUTPUT_INTERFACE,
- 0
- };
- return si;
-}
-
-GPAC_MODULE_EXPORT
-GF_BaseInterface *LoadInterface(u32 InterfaceType)
-{
- if (InterfaceType == GF_AUDIO_OUTPUT_INTERFACE)
- return NewOSSRender();
- return NULL;
-}
-
-GPAC_MODULE_EXPORT
-void ShutdownInterface(GF_BaseInterface *ifce)
-{
- if (ifce->InterfaceType==GF_AUDIO_OUTPUT_INTERFACE)
- DeleteOSSRender((GF_AudioOutput*)ifce);
-}
-
-GPAC_MODULE_STATIC_DECLARATION( oss )
+++ /dev/null
-// 01122011 AMD1 startWidget listWidgets getWidget implemented
-/* wrapper as a module
- var iphone_wm_gui = (function () {
- */
-// to make sure the initialization is done only once
-var init = true;
-
-// constant
-var xlinkns = 'http://www.w3.org/1999/xlink';
-//var evns = 'http://www.w3.org/2001/xml-events';
-
-// state of the widget manager: displays homepage (value=home) or executes widget (value="exec")
-var state = 'home';
-
-// convenience variables for SVG elements
-var homepage = null, arrows = null, icons = null, widgetContainer = null, homebar = null, execbar = null;
-
-// where is the index into pages of icons on the home page
-var where = 0,maxwhere = 0,whereW = 0;
-
-// array of activated widgets
-var activatedWidgets = new Array();
-var numActivatedWidgets = 0;
-
-// variables for flexible layout
-// variables for flexible layout
-var totalWidth = 0,totalHeight = 0,iconNbHoriz = 0,iconNbVert = 0,iconsPerPage = 0;
-
-//previous size
-var previousWidth = 0,previousHeight = 0;
-
-// to differentiate between install icon and scan dir for icons
-var isThisAScan = null;
-
-// preferred icon type
-var preferredIconType = '.svg';
-
-// adapt layout to the size of the screen
-function adaptLayoutToSize() {
- if (l_deb < log_level) {
- alert("[UI] adaptLayoutToSize");
- }
- display_width = parseInt(scene.get_option('General', 'LastWidth'));
- display_height = parseInt(scene.get_option('General', 'LastHeight'));
- alert("display "+display_width+" "+display_height);
- if (!scene.fullscreen && display_width && display_height) {
- scene.set_size(display_width, display_height);
- }
- var tmpObject, tmpObj2;
- // get size to adapt to
- totalWidth = document.documentElement.viewport.width;
- totalHeight = document.documentElement.viewport.height;
- if (totalWidth == 0) {
- totalWidth = 160;
- }
- if (totalHeight == 0) {
- totalHeight = 280;
- }
- while (totalWidth < 160 || totalHeight < 280) {
- totalWidth *= 4;
- totalHeight *= 4;
- }
- // min size is 160 by 280
- if (totalWidth < 160) {
- totalWidth = 160;
- }
- if (totalHeight < 280) {
- totalHeight = 280;
- }
- // round to lower multiple of 80
- totalWidth -= totalWidth % 80;
- var iconHeight = totalHeight - 120;
- iconHeight -= iconHeight % 80;
- // how many lines and columns of icons
- iconNbHoriz = totalWidth / 80;
- iconNbVert = iconHeight / 80;
- totalHeight = iconHeight + 120;
- // 120 is upper bar (60) + lower bar (60)
- iconsPerPage = iconNbHoriz * iconNbVert;
- // fix svg viewbox
- document.getElementById("svg").setAttribute("viewBox", "0 0 " + totalWidth + " " + totalHeight);
- // fix odd line
- tmpObj2 = document.getElementById("odd");
- var i, already = tmpObj2.getElementsByTagName("use").length;
- //alert("odd line "+already+" "+iconNbHoriz);
- for (i = already; i < iconNbHoriz; i++) {
- tmpObject = document.createElement("use");
- tmpObject.setAttribute("x", i * 80);
- tmpObject.setAttributeNS(xlinkns, "href", (((i % 2) == 0) ? "#lightRect" : "#darkRect" ));
- tmpObj2.appendChild(tmpObject);
- }
- // fix even line
- tmpObj2 = document.getElementById("even");
- already = tmpObj2.getElementsByTagName("use").length;
- //alert("even line "+already+" "+iconNbHoriz);
- for (i = already; i < iconNbHoriz; i++) {
- tmpObject = document.createElement("use");
- tmpObject.setAttribute("x", i * 80);
- tmpObject.setAttributeNS(xlinkns, "href", (((i % 2) == 0) ? "#darkRect" : "#lightRect" ));
- tmpObj2.appendChild(tmpObject);
- }
- // fix frame (black with rounded corners)
- tmpObject = document.getElementById("frame");
- tmpObject.setAttribute("width", totalWidth);
- tmpObject.setAttribute("height", totalHeight);
- tmpObject = document.getElementById("frame2");
- tmpObject.setAttribute("width", totalWidth);
- tmpObject.setAttribute("height", totalHeight);
- // fix screen (white)
- tmpObject = document.getElementById("screen");
- tmpObject.setAttribute("width", totalWidth);
- tmpObject.setAttribute("height", totalHeight - 120);
- // fix grid back (gray)
- tmpObject = document.getElementById("gridback");
- tmpObject.setAttribute("width", totalWidth);
- tmpObject.setAttribute("height", totalHeight - 120);
- // fix icon background grid
- tmpObject = document.getElementById("grid");
- already = tmpObject.getElementsByTagName("use").length;
- for (i = already; i < iconNbVert; i++) {
- tmpObj2 = document.createElement("use");
- tmpObj2.setAttribute("y", i * 80);
- tmpObj2.setAttributeNS(xlinkns, "href", (((i % 2) == 0) ? "#odd" : "#even" ));
- tmpObject.appendChild(tmpObj2);
- }
- // if there are already too many lines, remove the extra ones otherwise they are rendered on top of the lower
- // part of the decoration
- if (already > iconNbVert) {
- while (already-- > iconNbVert) {
- tmpObject.removeChild(tmpObject.lastChild);
- }
- }
- // fix commands (lower bar)
- document.getElementById("commands").setAttribute("transform", "translate(0, " + (totalHeight - 60) + ")");
- document.getElementById("homeButton").setAttribute("transform", "translate(" + (totalWidth / 2) + ", 30)");
- document.getElementById("right").setAttribute("transform", "translate(" + (totalWidth - 50) + ", 10)");
- document.getElementById("rightW").setAttribute("transform", "translate(" + (totalWidth - 50) + ", 10)");
- // fix the cuts (white rects left and right because we have no clipping)
- tmpObject = document.getElementById("leftCut");
- tmpObject.setAttribute("width", totalWidth);
- tmpObject.setAttribute("height", totalHeight);
- tmpObject.setAttribute("x", -1 - totalWidth);
- tmpObject = document.getElementById("rightCut");
- tmpObject.setAttribute("width", totalWidth);
- tmpObject.setAttribute("height", totalHeight);
- tmpObject.setAttribute("x", 1 + totalWidth);
- // respace executing widgets if any
- tmpObject = widgetContainer.getElementsByTagName("g");
- for (i = 0; i < tmpObject.length; i++) {
- var gg = tmpObject.item(i);
- gg.setAttribute("transform", "translate(" + (totalWidth * (i - 1)) + ", 0)");
- if (gg.firstElementChild != null) {
- gg.firstElementChild.setAttribute("width", totalWidth);
- gg.firstElementChild.setAttribute("height", totalHeight - 120);
- }
- }
-}
-
-//
-// widget close on click at "Kill" button
-//
-function on_kill_widget() {
- if (state == 'exec') {
- widget_close(activatedWidgets[whereW]);
- }
-}
-
-//
-// widget get on click at "GetW" button
-//
-function on_get_widget() {
- alert("on_get_widget " + WidgetManager.MPEGUStandardServiceProviders.length);
- if (WidgetManager.MPEGUStandardServiceProviders.length != 0) {
- upnp_renders = selector_window1();
- upnp_renders.on_select = function(item) {
- upnp_renders.unregister(root);
- upnp_renders = null;
- if (item == -1) {
- return;
- }
- alert("upnp_renders.on_select(" + item + ")");
- var device = WidgetManager.MPEGUStandardServiceProviders[item];
- device.standardService.SetActionListener("listWidgets", get_widget_callback(device), true);
- device.standardService.CallAction("listWidgets", new Array());
- }
- upnp_renders.register(root);
- }
-}
-
-function get_widget_callback(device) {
- return function() {
- //alert("get_widget_callback");
- // msgHandler is the first argument, the next arguments are from the reply to listWidgets
- var act = arguments[0];
- var act1 = act.GetArgumentValue("widgetCodes");
- var act2 = act.GetArgumentValue("widgetNames");
- //alert(act1+" "+act2);
- target_widgets = selector_window2(act1.split(" "), act2.split(" "));
- target_widgets.on_select = function(item) {
- alert("target_widgets.on_select");
- target_widgets.unregister(root);
- target_widgets = null;
- if (item == -1) {
- return;
- }
- alert("target_widgets.on_select(" + item + ")");
- var args = new Array();
- args[0] = "widgetCode";
- args[1] = item;
- device.standardService.SetActionListener("getWidget", get_widget_callback2, true);
- device.standardService.CallAction("getWidget", args);
- }
- target_widgets.register(root);
- }
-}
-
-function get_widget_callback2() {
- // msgHandler is the first argument, the next arguments are from the reply to listWidgets
- alert("callback2-1");
- var act = arguments[0];
- var act1 = act.GetArgumentValue("widgetUrl");
- var act2 = act.GetArgumentValue("widgetContext");
- alert("callback2-2 " + act1 + " " + act2);
- var wid = WidgetManager.load(act1, null, act2);
- WidgetManager.on_widget_add(wid);
-}
-
-//
-// creates the menu of available targets for pushing a widget elsewhere
-//
-function selector_window1() {
- var i, count, render;
- var selector = document.createElement('g'), obj, child;
- selector.setAttribute('transform', 'translate(10,10)');
- count = WidgetManager.MPEGUStandardServiceProviders.length;
- selector.appendChild(rect(0, 0, 300, 20 * (count + 1), 'white', 'black', null));
- for (i = 0; i < count; i++) {
- render = WidgetManager.MPEGUStandardServiceProviders[i];
- obj = createtext(render.Name, 'black', 5, 17 + (20 * i), 15, 'sans-serif');
- obj.setAttribute('id', "select" + i);
- selector.appendChild(obj);
- obj.addEventListener('mouseover', sw1("select" + i), false);
- obj.addEventListener('mouseout', sw2("select" + i), false);
- obj.addEventListener('click', sw4(i), false);
- }
- obj = createtext('Cancel', 'rgb(0,0,120)', 55, 17 + (20 * i), 15, 'sans-serif');
- obj.setAttribute('id', "canc");
- selector.appendChild(obj);
- obj.addEventListener('mouseover', function() { document.getElementById("canc").setAttribute("fill", "red"); }, false);
- obj.addEventListener('mouseout', function() { document.getElementById("canc").setAttribute("fill", "black"); }, false);
- obj.addEventListener('click', function() { upnp_renders.on_select(-1); }, false);
- selector.register = function(disp) {
- disp.appendChild(this);
- };
- selector.unregister = function(disp) {
- disp.removeChild(this);
- };
- return selector;
-}
-
-//
-// creates the menu of available targets for pushing a widget elsewhere
-//
-function selector_window2(codes, names) {
- alert("selector_window2");
- var i, count, render;
- var selector = document.createElement('g'), obj, child;
- selector.setAttribute('transform', 'translate(10,10)');
- count = codes.length;
- selector.appendChild(rect(0, 0, 300, 20 * (count + 1), 'white', 'black', null));
- for (i = 0; i < count; i++) {
- render = names[i];
- obj = createtext(render, 'black', 5, 17 + (20 * i), 15, 'sans-serif');
- obj.setAttribute('id', "selecto" + i);
- selector.appendChild(obj);
- obj.addEventListener('mouseover', sw1("selecto" + i), false);
- obj.addEventListener('mouseout', sw2("selecto" + i), false);
- obj.addEventListener('click', sw5(i), false);
- }
- obj = createtext('Cancel', 'rgb(0,0,120)', 55, 17 + (20 * i), 15, 'sans-serif');
- obj.setAttribute('id', "cance");
- selector.appendChild(obj);
- obj.addEventListener('mouseover', function() { document.getElementById("cance").setAttribute("fill", "red"); }, false);
- obj.addEventListener('mouseout', function() { document.getElementById("cance").setAttribute("fill", "black"); }, false);
- obj.addEventListener('click', function() { target_widgets.on_select(-1); }, false);
- selector.register = function(disp) {
- disp.appendChild(this);
- };
- selector.unregister = function(disp) {
- disp.removeChild(this);
- };
- return selector;
-}
-
-function sw4(si) {
- return function() { upnp_renders.on_select(si); };
-}
-
-function sw5(si) {
- return function() { target_widgets.on_select(si); };
-}
-
-//
-// when deleting an executing widgets, all executing widgets to its right are moved to the left
-//
-function recurseMoveAfterDelete(target) {
- if (target != null && target.nextElementSibling != null) {
- var v = target.nextElementSibling;
- recurseMoveAfterDelete(v);
- v.setAttribute("transform", target.getAttribute("transform"));
- }
-}
-
-//
-// click on home button to switch from icons to executing widgets
-//
-function home_button(evt) {
- if (l_deb < log_level) {
- alert("[UI] home_button");
- }
- if (state != 'home') {
- state = 'home';
- widgetContainer.setAttribute('display', 'none');
- homepage.setAttribute('display', 'inline');
- homebar.setAttribute('display', 'inline');
- execbar.setAttribute('display', 'none');
- arrows.setAttribute('display', 'inline');
- arrowsW.setAttribute('display', 'none');
- widgetAddList.setAttribute('display', 'none');
- } else {
- state = 'exec';
- widgetContainer.setAttribute('display', 'inline');
- homepage.setAttribute('display', 'none');
- homebar.setAttribute('display', 'none');
- execbar.setAttribute('display', 'inline');
- arrows.setAttribute('display', 'none');
- arrowsW.setAttribute('display', 'inline');
- widgetAddList.setAttribute('display', 'none');
- }
-}
-
-// constants
-var adjustFrom = "0,0";
-var animDue = true;
-
-//
-// after each change of icon page, this function adjusts the visibility of arrows in the lower bar
-//
-function adjustwhere(animDue) {
- if (l_deb < log_level) {
- alert("[UI] adjust " + where + " 0 " + maxwhere);
- }
- document.getElementById("left").setAttribute("display", ((where > 0) ? "inline" : "none"));
- document.getElementById("right").setAttribute("display", ((where < maxwhere) ? "inline" : "none"));
- if (!animDue) {
- icons.setAttribute("transform", 'translate(' + (-80 * iconNbHoriz * where) + ',0)');
- } else {
- var aw = document.createElement("animateTransform");
- aw.setAttribute("attributeName", "transform");
- aw.setAttribute("type", "translate");
- //alert('time '+document.documentElement.getCurrentTime());
- aw.setAttribute("begin", document.documentElement.getCurrentTime());
- aw.setAttribute("dur", "1s");
- aw.setAttribute("fill", "freeze");
- aw.setAttributeNS(xlinkns, "href", "#icons");
- aw.setAttribute("from", adjustFrom);
- aw.setAttribute("to", (-80 * iconNbHoriz * where) + ",0");
- document.documentElement.appendChild(aw);
- }
- adjustFrom = (-80 * iconNbHoriz * where) + ",0";
-}
-
-//
-// action of the left button on the lower bar
-//
-function left_button() {
- if (l_deb < log_level) {
- alert("[UI] left button " + where + " 0");
- }
- if (where > 0) {
- where--;
- adjustwhere(true);
- }
-}
-
-//
-// action of the right button of the lower bar
-//
-function right_button() {
- if (l_deb < log_level) {
- alert("[UI] right button " + where + " " + maxwhere);
- }
- if (where < maxwhere) {
- where++;
- adjustwhere(true);
- }
-}
-
-var adjustFromW = "0,0";
-var oldwhereW = -1;
-
-//
-// after each change of icon page, this function adjusts the visibility of arrows in the lower bar
-//
-function adjustWhereWidgets(animDue) {
- if (oldwhereW != whereW) {
- // hide oldwhereW
- if (oldwhereW >= 0 && activatedWidgets[oldwhereW] != null) {
- WidgetManager.corein_message(activatedWidgets[oldwhereW], "hide");
- }
- }
- if (l_deb < log_level) {
- alert("[UI] adjustW " + whereW + " 0 " + (numActivatedWidgets - 1));
- }
- document.getElementById("leftW").setAttribute("display", ((whereW > 0) ? "inline" : "none"));
- document.getElementById("rightW").setAttribute("display", ((whereW < (numActivatedWidgets - 1)) ? "inline" : "none"));
- if (!animDue) {
- widgetContainer.setAttribute("transform", "translate(" + (-totalWidth * whereW) + ",0)");
- } else {
- var aw = document.createElement("animateTransform");
- aw.setAttribute("attributeName", "transform");
- aw.setAttribute("type", "translate");
- aw.setAttribute("begin", document.documentElement.getCurrentTime());
- aw.setAttribute("dur", "1s");
- aw.setAttribute("fill", "freeze");
- aw.setAttributeNS(xlinkns, "href", "#widget");
- aw.setAttribute("from", adjustFromW);
- aw.setAttribute("to", (-totalWidth * whereW) + ",0");
- document.documentElement.appendChild(aw);
- }
- adjustFromW = (-totalWidth * whereW) + ",0";
- document.getElementById("widgetName").textContent =
- (whereW >= 0 && activatedWidgets[whereW] != null ? activatedWidgets[whereW].shortName : '-');
- if (oldwhereW != whereW) {
- // show whereW
- if (whereW >= 0 && activatedWidgets[whereW] != null) {
- WidgetManager.corein_message(activatedWidgets[whereW], "show");
- }
- oldwhereW = whereW;
- }
-}
-
-//
-// action of the left button on the lower bar
-//
-function left_buttonW() {
- if (l_deb < log_level) {
- alert("[UI] left button " + whereW);
- }
- if (whereW > 0) {
- whereW--;
- adjustWhereWidgets(animDue);
- }
-}
-
-//
-// action of the right button of the lower bar
-//
-function right_buttonW() {
- if (l_deb < log_level) {
- alert("[UI] right button " + whereW + " " + (numActivatedWidgets - 1));
- }
- if (whereW < (numActivatedWidgets - 1)) {
- whereW++;
- adjustWhereWidgets(animDue);
- }
-}
-
-//
-// action of each icon, starting the matching widget
-//
-function activating_widget(w) {
- if (l_deb < log_level) {
- alert("[UI] activating widget: " + w.name);
- }
- widget_add(w);
-}
-
-//
-// main initialization function
-// init variables, then init the widget manager C code, then inits UPnP
-//
-function initialize() {
- if (l_deb < log_level) {
- alert("[UI] initialize");
- }
- init = false;
- var display_width = parseInt(scene.get_option('Widgets', 'LastWMWidth'));
- var display_height = parseInt(scene.get_option('Widgets', 'LastWMHeight'));
- if (display_width && display_height) {
- scene.set_size(display_width, display_height);
- }
- root = document.documentElement;
- homepage = document.getElementById('homepage');
- homebar = document.getElementById('homebar');
- execbar = document.getElementById('execbar');
- arrows = document.getElementById('arrows');
- arrowsW = document.getElementById('arrowsW');
- icons = document.getElementById('icons');
- widgetContainer = document.getElementById('widget');
- widgetAddList = document.getElementById('widgetAddList');
- /* Setup the GPAC Widget Manager - this will also scan the available widgets */
- log_level = l_inf;
- widget_manager_init();
- WidgetManager.on_widget_remove = widget_remove;
- WidgetManager.on_widget_add = widget_add;
- /* register the callback to be notified of incoming widgets */
- has_upnp = (typeof UPnP != 'undefined');
- if (has_upnp) {
- /* setting the callback to allow other devices to push their widgets */
- UPnP.onMediaConnect = onMediaConnect;
- /* Tell GPAC that the calls to the main Renderer (like open, ...) must be forwared to this scene */
- UPnP.BindRenderer();
- }
- WidgetManager.coreOutShow = coreOutShowImplementation;
- WidgetManager.coreOutGetAttention = coreOutGetAttentionImplementation;
- WidgetManager.coreOutHide = coreOutHideImplementation;
- WidgetManager.coreOutRequestDeactivate = coreOutRequestDeactivateImplementation;
- WidgetManager.coreOutInstallWidget = coreOutInstallWidgetImplementation;
- WidgetManager.coreOutActivateTemporaryWidget = coreOutActivateTemporaryWidgetImplementation;
- WidgetManager.coreOutMigrateComponent = coreOutMigrateComponentImplementation;
- WidgetManager.coreOutRequestMigrationTargets = coreOutRequestMigrationTargetsImplementation;
-}
-
-//
-// implementation of core:out install widget
-//
-function coreOutInstallWidgetImplementation(wid, args) {
- var w = widgetInstall(args[0], true, false, wid);
- var ifce = getInterfaceByType(wid, "urn:mpeg:mpegu:schema:widgets:core:out:2010");
- if (ifce != null) {
- wmjs_core_out_invoke_reply(coreOut.installWidgetMessage, ifce.get_message("installWidget"),
- wid, (w != null ? 1 : 0)); // send return code 1 = success
- }
-}
-
-//
-// implementation of core:out activate temporary widget
-//
-function coreOutActivateTemporaryWidgetImplementation(wid, args) {
- var w = widgetInstall(args[0], true, true, null);
- if (w != null) {
- activating_widget(w);
- }
- var ifce = getInterfaceByType(wid, "urn:mpeg:mpegu:schema:widgets:core:out:2010");
- if (ifce != null) {
- wmjs_core_out_invoke_reply(coreOut.activateTemporaryWidgetMessage, ifce.get_message("activateTemporaryWidget"),
- wid, (w != null ? 1 : 0)); // send return code 1 = success
- }
-}
-
-//
-// implementation of core:out migrate component
-//
-function coreOutMigrateComponentImplementation(wid, args) {
- //alert("coreOutMigrateComponent "+wid.name+" "+args.length);
- var comp = wid.get_component(args[0], true);
- var ifce = getInterfaceByType(wid, "urn:mpeg:mpegu:schema:widgets:core:out:2010");
- if (comp == null) {
- log(l_err, 'Component ' + args[0] + ' cannot be found in widget ' + wid.name);
- if (ifce != null) {
- wmjs_core_out_invoke_reply(coreOut.migrateComponentMessage, ifce.get_message("migrateComponent"), wid, 0);
- }
- return;
- }
- if (args.length > 1 && args[1] != null) {
- //WidgetManager.migrate_widget(UPnP.GetMediaRenderer(parseInt(args[1])), comp);
- WidgetManager.migrate_widget(WidgetManager.get_mpegu_service_providers(parseInt(args[1])), comp);
- widget_close(comp);
- } else {
- upnp_renders = selector_window(comp);
- upnp_renders.on_select = function(item, wid) {
- upnp_renders.unregister(root);
- upnp_renders = null;
- if (item == -1) {
- return;
- }
- if (comp != null) {
- alert("upnp_renders.on_select(" + item + "," + comp.name + ")");
- //WidgetManager.migrate_widget(UPnP.GetMediaRenderer(item), comp);
- WidgetManager.migrate_widget(WidgetManager.get_mpegu_service_providers(item), comp);
- widget_close(comp);
- }
- };
- upnp_renders.register(root);
- }
- if (ifce != null) {
- wmjs_core_out_invoke_reply(coreOut.migrateComponentMessage, ifce.get_message("migrateComponent"), wid, 1); // send return code 1 = success
- }
-}
-
-//
-// implementation of core:out request migration targets
-//
-function coreOutRequestMigrationTargetsImplementation(wid, args) {
- var count = UPnP.MediaRenderersCount, codes = new Array(), names = new Array(), descriptions = new Array(), i;
- for (i = 0; i < count; i++) {
- var render = UPnP.GetMediaRenderer(i);
- codes.push("" + i);
- names.push(render.Name);
- descriptions.push(render.HostName + " " + render.UUID);
- }
- i = null;
- var ifce_count = wid.num_interfaces, j;
- for (j = 0; j < ifce_count; j++) {
- var ifce = wid.get_interface(j);
- if (ifce.type == "urn:mpeg:mpegu:schema:widgets:core:out:2010") {
- i = ifce;
- break;
- }
- }
- if (i != null) {
- wmjs_core_out_invoke_reply(coreOut.requestMigrationTargetsMessage, i.get_message("requestMigrationTargets"),
- wid, codes, names, descriptions);
- }
-}
-
-//
-// implementation of core:out Show message
-// this is a request by the widget to be shown
-//
-function coreOutShowImplementation(wid, args) {
- //alert("core:out show "+wid.name);
- var target = widgetContainer.firstElementChild;
- var i;
- for (i = 0; i < numActivatedWidgets; i++) {
- //alert("is it "+activatedWidgets[i].name);
- if (activatedWidgets[i] == wid) {
- break;
- }
- target = target.nextElementSibling;
- }
- // here, i is the index of the current widget
- //alert(" "+i+" "+numActivatedWidgets);
- if (i < numActivatedWidgets) {
- whereW = i;
- adjustWhereWidgets(false);
- }
- var ifce = getInterfaceByType(wid, "urn:mpeg:mpegu:schema:widgets:core:out:2010");
- if (ifce != null) {
- wmjs_core_out_invoke_reply(coreOut.showMessage, ifce.get_message("show"), wid, 1); // send return code 1 = success
- }
-}
-
-//
-// implementation of core:out GetAttention message
-// this is a request by the widget to be shown and some special signal is given
-//
-function coreOutGetAttentionImplementation(wid, args) {
- //alert("core:out getAttention "+wid.name);
- var target = widgetContainer.firstElementChild;
- var i;
- for (i = 0; i < numActivatedWidgets; i++) {
- //alert("is it "+activatedWidgets[i].name);
- if (activatedWidgets[i] == wid) {
- break;
- }
- target = target.nextElementSibling;
- }
- // here, i is the index of the current widget
- //alert(" "+i+" "+numActivatedWidgets);
- if (i < numActivatedWidgets) {
- whereW = i;
- adjustWhereWidgets(false);
- }
- document.getElementById("getAttention").beginElement();
- var ifce = getInterfaceByType(wid, "urn:mpeg:mpegu:schema:widgets:core:out:2010");
- if (ifce != null) {
- wmjs_core_out_invoke_reply(coreOut.getAttentionMessage, ifce.get_message("getAttention"), wid, 1); // send return code 1 = success
- }
-}
-
-//
-// implementation of core:out hide message
-// this is a request by the widget to be hidden (some other widget (if any) is shown)
-//
-function coreOutHideImplementation(wid, args) {
- //alert("core:out hide "+wid.name);
- var target = widgetContainer.firstElementChild;
- var i;
- for (i = 0; i < numActivatedWidgets; i++) {
- //alert("is it "+activatedWidgets[i].name);
- if (activatedWidgets[i] == wid) {
- break;
- }
- target = target.nextElementSibling;
- }
- // here, i is the index of the current widget
- //alert("hide "+i+" "+numActivatedWidgets);
- if (i < numActivatedWidgets) {
- if (whereW > 0) {
- whereW--;
- }
- else if (whereW < numActivatedWidgets - 1) {
- whereW++;
- }
- else {
- return;
- }
- adjustWhereWidgets(false);
- }
- var ifce = getInterfaceByType(wid, "urn:mpeg:mpegu:schema:widgets:core:out:2010");
- if (ifce != null) {
- wmjs_core_out_invoke_reply(coreOut.hideMessage, ifce.get_message("hide"), wid, 1); // send return code 1 = success
- }
-}
-
-//
-// implementation of core:out requestDeactivate message
-// this is a request by the widget to be stopped
-//
-function coreOutRequestDeactivateImplementation(wid, args) {
- //alert("core:out hide "+wid.name);
- var target = widgetContainer.firstElementChild;
- var i;
- for (i = 0; i < numActivatedWidgets; i++) {
- //alert("is it "+activatedWidgets[i].name);
- if (activatedWidgets[i] == wid) {
- break;
- }
- target = target.nextElementSibling;
- }
- // here, i is the index of the current widget
- //alert("hide "+i+" "+numActivatedWidgets);
- if (i < numActivatedWidgets) {
- widget_close(activatedWidgets[i]);
- }
- var ifce = getInterfaceByType(wid, "urn:mpeg:mpegu:schema:widgets:core:out:2010");
- if (ifce != null) {
- wmjs_core_out_invoke_reply(coreOut.requestDeactivateMessage, ifce.get_message("requestDeactivate"), wid, 1); // send return code 1 = success
- }
-}
-
-//
-// WM callback for when a component is activated by its parent
-//
-function widget_add(w) {
- log(l_inf, "widget add " + w.name);
- if (!w.activated) {
- if (sameFileIgnoringSVGView(w.icon, w.main)) {
- // same file in icon and main
- } else {
- widget_launch(w, document.createElement("animation"));
- }
- } else if (w.multipleInstances) {
- var newwid = WidgetManager.open(w.manifest, null);
- widget_launch(newwid, document.createElement("animation"));
- } else {
- return false;
- }
- state = 'exec';
- widgetContainer.setAttribute('display', 'inline');
- homepage.setAttribute('display', 'none');
- homebar.setAttribute('display', 'none');
- execbar.setAttribute('display', 'inline');
- arrows.setAttribute('display', 'none');
- arrowsW.setAttribute('display', 'inline');
- widgetAddList.setAttribute('display', 'none');
- return true;
-}
-
-function sameFileIgnoringSVGView(name1, name2) {
- if (name1 == name2) {
- return true;
- }
- if (name1 == null) {
- return false;
- }
- var i1 = name1.indexOf("#");
- var i2 = name2.indexOf("#");
- if (i1 < 0) {
- i1 = name1.length;
- }
- else {
- i1--;
- }
- if (i2 < 0) {
- i2 = name2.length;
- }
- else {
- i2--;
- }
- return name1.substring(0, i1) == name2.substring(0, i2);
-}
-
-//
-// recompute the number of widgets loaded currently
-//
-function getNbWidgets() {
- var i, nbWidgets = 0;
- for (i = 0; i < WidgetManager.num_widgets; i++) {
- var w = WidgetManager.get(i);
- if (w != null && w.loaded) {
- nbWidgets++;
- }
- }
- return nbWidgets;
-}
-
-//
-// just resize the window and viewport, and initialize the first time this is called
-//
-function resize() {
- if (init) {
- initialize();
- }
- if (document.documentElement.viewport.width == previousWidth && document.documentElement.viewport.height == previousHeight) {
- return;
- }
- if (l_deb < log_level) {
- alert("[UI] start initialize() w:" + document.documentElement.viewport.width + " h:" + document.documentElement.viewport.height);
- }
- adaptLayoutToSize();
- // start by filling the "home page" with known icons
- where = 0;
- var nbWidgets = getNbWidgets();
- maxwhere = ((nbWidgets - 1) - ((nbWidgets - 1) % iconsPerPage)) / iconsPerPage;
- var wid;
- var iconIterator = document.getElementById("icons").firstElementChild;
- var position = 0;
- for (i = 1; i <= WidgetManager.num_widgets; i++) {
- wid = WidgetManager.get(i - 1);
- // alert("build:"+wid.main+" "+wid.loaded);
- if (wid.loaded) {
- insert_icon(wid, position, i - 1, iconIterator);
- WidgetManager.corein_message(wid, 'setSize', 'width', totalWidth, 'height', totalHeight - 120, 'dpi', 96);
- position++;
- if (iconIterator != null) {
- iconIterator = iconIterator.nextElementSibling;
- }
- }
- }
- adjustwhere(false);
- adjustWhereWidgets(false);
- previousWidth = document.documentElement.viewport.width;
- previousHeight = document.documentElement.viewport.height;
- scene.set_option("Widgets", "LastWMWidth", '' + previousWidth);
- scene.set_option("Widgets", "LastWMHeight", '' + previousHeight);
-}
-
-//
-// function inserting an icon on the home page
-//
-function insert_icon(widget, position, widgetIndex, previousIcon) {
- if (l_deb < log_level) {
- alert("[UI] insert_icon: " + widget.shortName + " " + position + " " + widgetIndex + " WMnw:" + WidgetManager.num_widgets);
- }
- widget.loaded = true;
- if (l_deb < log_level) {
- alert("[UI] widget name: " + widget.name);
- }
- var icon = null, original = null;
- for (var i = 0; i < widget.icons.length; i++) {
- // default to the first icon even if not of the preferred type
- if (i == 0) {
- icon = widget.icons[0].relocated_src;
- //original = widget.icons[0].original;
- // alert("choosing default icon " + icon);
- }
- // check for preferred type
- if (widget.icons[i].relocated_src.indexOf(preferredIconType) > 0) {
- icon = widget.icons[i].relocated_src;
- //original = widget.icons[i].original;
- break;
- }
- }
- var shortName = widget.shortName;
- if (typeof shortName == 'undefined') {
- shortName = widget.name.substring(0, 9);
- }
- createIconSVGdecoration(previousIcon, widget, (((position % iconNbHoriz) * 80) + ((80 * (position - (position % iconsPerPage))) / iconNbVert)),
- ((((position % iconsPerPage) - (position % iconNbHoriz)) / iconNbHoriz) * 80), "icons", icon,
- shortName, widgetIndex);
-}
-
-// constant
-// const corein = "urn:mpeg:mpegu:schema:widgets:core:in:2010";
-
-//
-// commodity method to empty a list of children
-//
-function removeAllChildren(o) {
- if (o != null && o.hasChildNodes()) {
- while (o.childNodes.length >= 1) {
- o.removeChild(o.firstChild);
- }
- }
-}
-
-//
-// create the home page icon with all its behaviours
-//
-function createIconSVGdecoration(previousIcon, widget, x, y, fatherId, iconUrl, name, widIndex) {
- var g, g2;
- if (l_inf < log_level) {
- alert("[UI] createIconSVGdecoration " + iconUrl + " " + x + " " + y);
- }
- if (previousIcon != null) {
- g = previousIcon;
- } else {
- g = document.createElement("g");
- document.getElementById(fatherId).appendChild(g);
- }
- g.setAttribute("transform", 'translate(' + x + ',' + y + ')');
- if (previousIcon != null) {
- g2 = g.firstElementChild;
- } else {
- g2 = document.createElement("g");
- g2.setAttribute("transform", 'translate(15,10)');
- g.appendChild(g2);
- }
- if (iconUrl == null || iconUrl == "") {
- iconUrl = "icons/face-surprise.svg";
- }
- //
- // process differently cases where widget.icon == widget.main
- //
- var container;
- if (sameFileIgnoringSVGView(iconUrl, widget.main) && widget.main.indexOf('.svg') >= 0) {
- // see if the animation already exists
- container = document.getElementById(name);
- if (container == null) {
- // if the animation does not exist yet, create it
- container = media('animation', iconUrl, 50, 50);
- // store the animation in the main defs
- document.getElementById("mainDefs").appendChild(container);
- container.setAttribute('id', name);
- }
- if (previousIcon == null) {
- // put the container in a use
- var use = document.createElement("use");
- use.setAttribute('id', 'iconContainer' + name);
- use.setAttributeNS(xlinkns, 'href', '#' + name);
- g2.appendChild(use);
- }
- } else {
- if (previousIcon == null) {
- container = appropriateElementForMedia(iconUrl, 50, 50);
- container.setAttribute('id', name);
- g2.appendChild(container);
- }
- }
- if (previousIcon == null) {
- g2 = document.createElement("g");
- g2.setAttribute("transform", 'translate(40,70)');
- g.appendChild(g2);
- var anim = createtext(name, 'white', 0, 0, 14, 'Arial Unicode MS');
- anim.setAttribute("text-anchor", "middle");
- anim.setAttribute("display-align", "center");
- g2.appendChild(anim);
- var rect = invisible_rect(80, 80);
- g.appendChild(rect);
- rect.addEventListener("click", csi(widget), false);
- }
-}
-
-function csi(widget) {
- return function(evt) { activating_widget(widget);};
-}
-
-//
-// widget closing action (WM callback)
-//
-function widget_close(wid) {
- if (wid == null) {
- return;
- }
- if (l_inf <= log_level) {
- alert('[UI] widget_close:' + wid.name);
- }
- // maybe inform the widget that it is going to be deactivated
- WidgetManager.corein_message(wid, "deactivate");
- var target = widgetContainer.firstElementChild;
- var i;
- for (i = 0; i < numActivatedWidgets; i++) {
- if (activatedWidgets[i] == wid) {
- break;
- }
- target = target.nextElementSibling;
- }
- if (target != null) {
- // move next widgets back one slot
- recurseMoveAfterDelete(target);
- // stop the subscene
- if (target.firstElementChild != null) {
- target.firstElementChild.setAttributeNS(xlinkns, "href", "");
- }
- // end trying
- widgetContainer.removeChild(target);
- }
- wid.deactivate();
- wid.activated = false;
- activatedWidgets.splice(i, 1);
- numActivatedWidgets--;
- whereW = (whereW >= i ? (whereW > 0 ? whereW - 1 : 0) : whereW);
- adjustWhereWidgets(false);
- // if no more widgets, go back to the icons
- if (numActivatedWidgets == 0) {
- state = 'home';
- widgetContainer.setAttribute('display', 'none');
- homepage.setAttribute('display', 'inline');
- homebar.setAttribute('display', 'inline');
- execbar.setAttribute('display', 'none');
- arrows.setAttribute('display', 'inline');
- arrowsW.setAttribute('display', 'none');
- widgetAddList.setAttribute('display', 'none');
- }
- if (!wid.permanent) {
- WidgetManager.unload(wid, false);
- }
-}
-
-//
-// widget unloading action (WM callback)
-//
-function widget_remove(wid) {
- if (l_deb <= log_level) {
- alert('[UI] widget_remove:' + wid.name);
- }
- widget_close(wid);
- WidgetManager.unload(wid, false);
-}
-
-//
-// widget launcher action
-//
-function widget_launch(wid, scene_container) {
- if (l_inf <= log_level) {
- alert('[UI] widget_launch:' + wid.name);
- }
- var tmp = document.createElement("g");
- tmp.setAttribute("transform", "translate(" + (totalWidth * numActivatedWidgets) + ", 0)");
- widgetContainer.appendChild(tmp);
- var icon = null;
- alert("wid: " + wid.name + "|" + wid.shortName);
- if (typeof wid.shortName != 'undefined') {
- var container = document.getElementById(wid.shortName);
- if (container != null) {
- icon = container.getAttributeNS(xlinkns, 'href');
- }
- }
- if (icon != null &&
- sameFileIgnoringSVGView(icon, wid.main) &&
- endsWith(wid.main, '.svg')) {
- // get the animation with id=shortName stored in mainDefs
- scene_container = document.getElementById(wid.shortName);
- // get the original use on it, used in the icon
- var iconContainer = document.getElementById('iconContainer' + wid.shortName);
- // create a new use
- var use = document.createElement('use');
- // point to the animation
- use.setAttributeNS(xlinkns, 'href', '#' + wid.shortName);
- // resize the animation
- scene_container.setAttribute("width", totalWidth);
- scene_container.setAttribute("height", totalHeight - 120);
- // resize the original use
- //should do: fix the aspect ratio conservation
- var m, t = Math.abs(totalHeight - 120 - totalWidth) / 2;
- if (totalWidth > totalHeight - 120) {
- m = 50 / (totalHeight - 120);
- iconContainer.setAttribute('transform', 'scale(' + m + ',' + m + ') translate(' + (-t) + ',0)');
- } else {
- m = 50 / totalWidth;
- iconContainer.setAttribute('transform', 'scale(' + m + ',' + m + ') translate(0,' + (-t) + ') ');
- }
- // add the new use as widget execution container
- tmp.appendChild(use);
- wid.activate(scene_container);
- } else {
- scene_container.setAttribute("width", totalWidth);
- scene_container.setAttribute("height", totalHeight - 120);
- tmp.appendChild(scene_container);
- scene_container.setAttributeNS(xlinkns, 'href', wid.main);
- wid.activate(scene_container);
- }
- wid.activated = true;
- activatedWidgets.splice(numActivatedWidgets, 0, wid);
- whereW = numActivatedWidgets;
- numActivatedWidgets++;
- adjustWhereWidgets(false);
- wid.load_component = widget_load_component;
- wid.permanent = true;
- wid.on_load = function () {
- WidgetManager.corein_message(this, 'setSize', 'width', totalWidth, 'height', totalHeight - 120, 'dpi', 96);
- };
- //
- if (log_level > l_inf) {
- var i = 0;
- alert(">>>>>>>>>>>>> " + wid.name + " interfaces:");
- for (; i < wid.num_interfaces; i++) {
- alert("" + wid.get_interface(i).type);
- }
- }
- //
-}
-
-//
-// widget load component (WM callback)
-//
-function widget_load_component(comp, is_unload) {
- if (l_deb <= log_level) {
- alert('[UI] widget_load_component:' + comp.name);
- }
- if (is_unload) {
- widget_close(comp);
- comp.parent = null;
- } else {
- widget_add(comp);
- comp.permanent = false;
- comp.parent = this;
- }
-}
-
-var upnp_renders = null, target_widgets = null;
-
-//
-// widget remoting function
-//
-function on_widget_remote() {
- if (WidgetManager.MPEGUStandardServiceProviders.length != 0 && numActivatedWidgets > 0) {
- upnp_renders = selector_window(activatedWidgets[whereW]);
- upnp_renders.on_select = function(item, wid) {
- upnp_renders.unregister(root);
- upnp_renders = null;
- if (item == -1) {
- return;
- }
- if (wid != null) {
- alert("upnp_renders.on_select(" + item + "," + wid.name + ")");
- //WidgetManager.migrate_widget(UPnP.GetMediaRenderer(item), wid);
- WidgetManager.migrate_widget(WidgetManager.get_mpegu_service_providers(item), wid);
- widget_close(wid);
- }
- };
- upnp_renders.register(root);
- }
-}
-
-//
-// creates the menu of available targets for pushing a widget elsewhere
-//
-function selector_window(widget) {
- var i, count, render;
- var selector = document.createElement('g'), obj, child;
- selector.setAttribute('transform', 'translate(10,10)');
- count = WidgetManager.MPEGUStandardServiceProviders.length;
- selector.appendChild(rect(0, 0, 300, 20 * (count + 1), 'white', 'black'));
- for (i = 0; i < count; i++) {
- render = WidgetManager.MPEGUStandardServiceProviders[i];
- obj = createtext(render.Name, 'black', 5, 17 + (20 * i), 15, 'sans-serif');
- obj.setAttribute('id', "selector" + i);
- selector.appendChild(obj);
- obj.addEventListener('mouseover', sw1("selector" + i), false);
- obj.addEventListener('mouseout', sw2("selector" + i), false);
- obj.addEventListener('click', sw3(i, widget), false);
- }
- obj = createtext('Cancel', 'rgb(0,0,120)', 55, 17 + (20 * i), 15, 'sans-serif');
- obj.setAttribute('id', "cancel");
- selector.appendChild(obj);
- obj.addEventListener('mouseover', function(evt) { document.getElementById("cancel").setAttribute("fill", "red"); }, false);
- obj.addEventListener('mouseout', function(evt) { document.getElementById("cancel").setAttribute("fill", "black"); }, false);
- obj.addEventListener('click', function(evt) { upnp_renders.on_select(-1, null); }, false);
- selector.register = function(disp) {
- disp.appendChild(this);
- };
- selector.unregister = function(disp) {
- disp.removeChild(this);
- };
- return selector;
-}
-
-function sw1(s) {
- return function(evt) { document.getElementById(s).setAttribute("fill", "blue"); };
-}
-
-function sw2(s) {
- return function(evt) { document.getElementById(s).setAttribute("fill", "black"); };
-}
-
-function sw3(si, widget) {
- return function(evt) { upnp_renders.on_select(si, widget); };
-}
-
-//
-// when a widget is pushed to here, install the widget and execute it
-//
-function onMediaConnect(url, src_ip) {
- if (l_inf <= log_level) {
- alert('[UI] onMediaConnect :\"' + url + '\"');
- }
- if (WidgetManager.probe(url)) {
- var w = WidgetManager.open(url, src_ip);
- if (w == null) {
- return;
- }
- widget_add(w);
- adjustWhereWidgets(false);
- w.permanent = false;
- }
-}
-
-//
-// file list vars
-//
-var flstart = 0,fllist = null,maxFileNames = 14;
-
-//
-// create a file menu in the main screen, allowing to navigate directories and choose widget config files
-//
-function on_widget_add_menu() {
- state = 'list';
- widgetContainer.setAttribute('display', 'none');
- homepage.setAttribute('display', 'none');
- homebar.setAttribute('display', 'none');
- execbar.setAttribute('display', 'inline');
- arrows.setAttribute('display', 'none');
- arrowsW.setAttribute('display', 'none');
- widgetAddList.setAttribute('display', 'inline');
- maxFileNames = Math.round(((iconNbVert * 80) / 25) - 1.4);
- isThisAScan = false;
- refillWidgetAddList(false);
-}
-
-//
-// create a file menu in the main screen, allowing to navigate directories and choose a directory to scan for widgets
-// and load all their icons
-//
-function on_dir_scan() {
- state = 'list';
- widgetContainer.setAttribute('display', 'none');
- homepage.setAttribute('display', 'none');
- homebar.setAttribute('display', 'none');
- execbar.setAttribute('display', 'inline');
- arrows.setAttribute('display', 'none');
- arrowsW.setAttribute('display', 'none');
- widgetAddList.setAttribute('display', 'inline');
- maxFileNames = Math.round(((iconNbVert * 80) / 25) - 1.4);
- isThisAScan = true;
- refillWidgetAddList(true);
-}
-
-//
-// remove all installed icons
-//
-function on_clean_up() {
- var i;
- //if (l_inf <= log_level) alert('[UI] unloading ' + WidgetManager.num_widgets + ' widgets');
- for (i = WidgetManager.num_widgets - 1; i >= 0; i--) {
- var w = WidgetManager.get(i);
- if (w.loaded) {
- alert("unloading " + w.name);
- w.loaded = false;
- WidgetManager.unload(w, false);
- }
- }
- where = 0;
- maxwhere = 0;
- removeAllChildren(document.getElementById("icons"));
- adjustwhere(false);
-}
-
-//
-// install, but do not launch, the widget whose config.xml has been chosen, and return to the home page
-//
-function widgetInstall(uri, manual, temporary, parent_wid) {
- var wid, j, count = WidgetManager.num_widgets, nbWidgets = getNbWidgets();
- for (j = 0; j < count; j++) {
- wid = WidgetManager.get(j);
- if (wid.url == uri) {
- if (wid.loaded) {
- break;
- }
- if (temporary) {
- wid.permanent = false;
- }
- else {
- insert_icon(wid, nbWidgets, nbWidgets);
- }
- }
- }
- if (j == count) {
- wid = WidgetManager.open(uri, null, parent_wid);
- if (wid != null) {
- if (temporary) {
- wid.permanent = false;
- }
- else {
- insert_icon(wid, nbWidgets, nbWidgets);
- }
- }
- }
- if (manual) {
- return wid;
- }
- state = 'home';
- widgetContainer.setAttribute('display', 'none');
- homepage.setAttribute('display', 'inline');
- homebar.setAttribute('display', 'inline');
- execbar.setAttribute('display', 'none');
- arrows.setAttribute('display', 'inline');
- arrowsW.setAttribute('display', 'none');
- removeAllChildren(widgetAddList);
- maxwhere = ((nbWidgets - 1) - ((nbWidgets - 1) % iconsPerPage)) / iconsPerPage;
- where = maxwhere;
- adjustwhere(false);
- return wid;
-}
-
-//
-// clean up file list space and refill it
-//
-function refillWidgetAddList(flag) {
- removeAllChildren(widgetAddList);
- fllist = null;
- flstart = 0;
- fllist = Sys.enum_directory(Sys.last_wdir, "", false);
- fillWidgetAddList(flag);
-}
-
-//
-// go to parent directory
-//
-function flUpDir(evt) {
- var s = Sys.last_wdir;
- if (l_inf <= log_level) {
- alert("[UI] lwd:" + Sys.last_wdir);
- }
- var index = s.lastIndexOf("\\");
- if (index != -1) {
- Sys.last_wdir = s.substring(0, index);
- refillWidgetAddList(isThisAScan);
- } else {
- index = s.lastIndexOf("/");
- if (index != -1) {
- Sys.last_wdir = s.substring(0, index);
- refillWidgetAddList(isThisAScan);
- } else {
- Sys.last_wdir = "/";
- refillWidgetAddList(isThisAScan);
- }
- }
-}
-
-//
-// go to a named directory
-//
-function flGoTo(newDir) {
- //alert("goto "+newDir);
- var s = Sys.last_wdir;
- if (s == "/") {
- Sys.last_wdir = newDir;
- } else {
- var c = s.charAt(s.length - 1);
- if (c != '\\' && c != '/') {
- s += "/";
- }
- Sys.last_wdir = s + newDir;
- }
- //alert(Sys.last_wdir);
- refillWidgetAddList(isThisAScan);
-}
-
-//
-// if the directory contains more files that can be shown, show previous page of file names
-//
-function flPrevFiles(evt) {
- if (flstart == 0) {
- return;
- }
- flstart -= maxFileNames;
- if (flstart < 0) {
- flstart = 0;
- }
- removeAllChildren(widgetAddList);
- fillWidgetAddList(isThisAScan);
-}
-
-//
-// if the directory contains more files that can be shown, show next page of file names
-//
-function flNextFiles(evt) {
- if (flstart + maxFileNames < fllist.length) {
- flstart += maxFileNames;
- removeAllChildren(widgetAddList);
- fillWidgetAddList(isThisAScan);
- }
-}
-
-//
-// scan the current directory recursively for widgets, clean up and return to home page
-//
-function flScanDir(evt) {
- scan_directory(Sys.last_wdir);
- state = 'home';
- var nbWidgets = getNbWidgets();
- widgetContainer.setAttribute('display', 'none');
- homepage.setAttribute('display', 'inline');
- homebar.setAttribute('display', 'inline');
- execbar.setAttribute('display', 'none');
- arrows.setAttribute('display', 'inline');
- arrowsW.setAttribute('display', 'none');
- removeAllChildren(widgetAddList);
- maxwhere = ((nbWidgets - 1) - ((nbWidgets - 1) % iconsPerPage)) / iconsPerPage;
- where = maxwhere;
- adjustwhere(false);
-}
-
-//
-// scanning
-//
-function scan_directory(dir) {
- var ii, j, count, list, w, uri, loadedWidgets = 0;
- list = Sys.enum_directory(dir, '.xml;.wgt', 0);
- for (ii = 0; ii < list.length; ii++) {
- uri = list[ii].path + list[ii].name;
- if (list[ii].directory) {
- scan_directory(uri);
- } else {
- count = WidgetManager.num_widgets;
- for (j = 0; j < count; j++) {
- var wid = WidgetManager.get(j);
- if (wid.loaded) {
- loadedWidgets++;
- }
- if (wid.url == uri) {
- if (wid.loaded) {
- break;
- }
- insert_icon(wid, getNbWidgets(), j);
- break;
- }
- }
- if (j == count) {
- w = WidgetManager.open(uri, null);
- if (w != null) {
- insert_icon(w, loadedWidgets, WidgetManager.num_widgets - 1);
- }
- }
- }
- }
-}
-
-//
-// create the up, prev, next button, show current directory and as many file names as possible
-// the file names are active: clicking on a directory name goes to that directory
-// clicking on a file tries to load that file as a widget
-//
-function fillWidgetAddList(flag) {
- if (flag) {
- widgetAddList.appendChild(use("cartoucheflag"));
- document.getElementById("dirflag").textContent = Sys.last_wdir;
- } else {
- widgetAddList.appendChild(use("cartouche"));
- document.getElementById("dir").textContent = Sys.last_wdir;
- }
- // next lines are file names
- var obj;
- for (i = 0; i < (fllist.length - flstart) && i < maxFileNames; i++) {
- obj = use("fileMenuElement" + i);
- obj.setAttribute('transform', 'translate(0,' + (25 * (i + 1)) + ')');
- widgetAddList.appendChild(obj);
- document.getElementById("fileMenuElement" + i + "u").setAttributeNS(xlinkns, 'href', "#" + (fllist[i + flstart].directory ? 'folder' : 'new'));
- document.getElementById("fileMenuElement" + i + "t").textContent = fllist[i + flstart].name;
- if (obj.listener != null) {
- obj.removeEventListener("click", obj.listener);
- }
- if (fllist[i + flstart].directory) {
- obj.listener = createGoto(escaping(fllist[i + flstart].name));
- obj.addEventListener("click", obj.listener, false);
- } else if (isWidgetFileName(fllist[i + flstart].name)) {
- obj.listener = createWidgetInstall(escaping(Sys.last_wdir + '/' + fllist[i + flstart].name));
- obj.addEventListener("click", obj.listener, false);
- }
- }
-}
-
-function createGoto(s) {
- return function () {
- flGoTo(s);
- };
-}
-
-function createWidgetInstall(s) {
- return function () {
- widgetInstall(s, false, false, null);
- };
-}
-
-// // // // // // // // // // // // // // //
-// function library
-// // // // // // // // // // // // // // //
-
-function isWidgetFileName(s) {
- if (endsWith(s, 'config.xml')) {
- return true;
- }
- if (endsWith(s, '.wgt')) {
- return true;
- }
- return false;
-}
-
-//
-// replace globally \ with / in a string
-//
-function escaping(s) {
- s = s.replace(/\\/g, '/');
- return s;
-}
-
-//
-// create rect
-//
-function rect(x, y, w, h, fill, stroke, id) {
- var child = document.createElement('rect');
- if (id != null) {
- child.setAttribute('id', id);
- }
- child.setAttribute('x', x);
- child.setAttribute('y', y);
- child.setAttribute('width', w);
- child.setAttribute('height', h);
- child.setAttribute('fill', fill);
- child.setAttribute('stroke', stroke);
- return child;
-}
-
-//
-// create text
-//
-function createtext(content, fill, x, y, size, family) {
- var child = document.createElement('text');
- child.setAttribute('fill', fill);
- child.textContent = content;
- child.setAttribute('x', x);
- child.setAttribute('y', y);
- child.setAttribute('font-size', size);
- child.setAttribute('font-family', family);
- return child;
-}
-
-//
-// create invisible rect getting all events
-//
-function invisible_rect(w, h) {
- var child = document.createElement('rect');
- child.setAttribute('width', w);
- child.setAttribute('height', h);
- child.setAttribute('fill', 'none');
- child.setAttribute('stroke', 'none');
- child.setAttribute('pointer-events', 'all');
- return child;
-}
-
-//
-// create animation
-//
-function media(etype, uri, w, h) {
- var child = document.createElement(etype);
- child.setAttributeNS(xlinkns, 'href', uri);
- child.setAttribute('width', w);
- child.setAttribute('height', h);
- if (etype == 'animation') {
- child.setAttributeNS('http://gpac.io/svg-extensions', 'use-as-primary', 'false');
- }
- return child;
-}
-
-//
-// create use
-//
-function use(uri) {
- var child = document.createElement('use');
- child.setAttributeNS(xlinkns, 'href', '#' + uri);
- return child;
-}
-
-//
-// create appropriate element for media reference by the given uri
-//
-function appropriateElementForMedia(uri, w, h) {
- if (uri.indexOf('#') != -1) {
- return media('animation', uri, w, h);
- }
- if (endsWith(uri, '.svg')) {
- return media('animation', uri, w, h);
- }
- if (endsWith(uri, '.bt')) {
- return media('animation', uri, w, h);
- }
- if (endsWith(uri, '.png')) {
- return media('image', uri, w, h);
- }
- if (endsWith(uri, '.jpg')) {
- return media('image', uri, w, h);
- }
- if (endsWith(uri, '.gif')) {
- return media('image', uri, w, h);
- }
- if (l_war <= log_level) {
- alert("[UI] WARNING: bad suffix for an icon URI: " + uri);
- }
- return media('image', uri, w, h);
-}
-
-//
-// substitute for the useful predefined function endsWith
-//
-function endsWith(s1, s2) {
- return s1.toLowerCase().substring(s1.length - s2.length) == s2;
-}
-
-/* wrapper as a module
- // export the resize function as the resize member of iphone_wm_gui, as well as other functions
- return {
- resize: resize,
- left_button: left_button,
- right_button: right_button,
- left_buttonW: left_buttonW,
- right_buttonW: right_buttonW,
- home_button: home_button,
- on_dir_scan: on_dir_scan,
- on_clean_up: on_clean_up,
- on_widget_add_menu: on_widget_add_menu,
- on_kill_widget: on_kill_widget,
- on_get_widget: on_get_widget,
- on_widget_remote: on_widget_remote,
- flUpDir: flUpDir,
- flPrevFiles: flPrevFiles,
- flNextFiles: flNextFiles,
- flScanDir: flScanDir,
- get_widget_callback2: get_widget_callback2
- }
-
- }());*/
-
-function widget_activated_and_bound(wid) {
- WidgetManager.corein_message(wid, "activate");
-}
-
-function printAllFieldsOf(obj, printableName) {
- var details = "fields of " + printableName + ":\n";
- for (var field in obj) {
- fieldContents = obj[field];
- if (typeof(fieldContents) == "function") {
- fieldContents = "(function)";
- }
- details += " " + field + ": " + fieldContents + "\n";
- }
- alert(details);
-}
+++ /dev/null
-<?xml version="1.0" encoding="iso-8859-1"?>
-<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2"
- xmlns:gpac-ext='http://gpac.io/svg-extensions'
- width="571.35199" xmlns:ev="http://www.w3.org/2001/xml-events" height="462.51999" viewBox="0 0 320 600">
- <!--
- This is a Widget Manager creating an iPhone-style UI.
- A certain number of widgets are installed, and their icons are visible on the home page.
- If the home page is full, arrows appear at the bottom to get to the other pages of icons.
- There is a companion file rifuim.js with the script that adapts this SVG to the size of the screen
- -->
- <defs id="mainDefs">
- <rect id="lightRect" width="80" height="80" fill="rgb(50,50,50)" stroke="none"/>
- <rect id="darkRect" width="80" height="80" fill="rgb(40,40,40)" stroke="none"/>
- <g id="odd">
- <use xlink:href="#lightRect"/>
- <use xlink:href="#darkRect" x="80"/>
- </g>
- <g id="even">
- <use xlink:href="#darkRect"/>
- <use xlink:href="#lightRect" x="80"/>
- </g>
- <animation id='go-up' xlink:href='icons/go-up.svg' width='25' height='25'/>
- <animation id='go-previous' xlink:href='icons/go-previous.svg' width='25' height='25'/>
- <animation id='go-next' xlink:href='icons/go-next.svg' width='25' height='25'/>
- <animation id='go-jump' xlink:href='icons/go-jump.svg' width='25' height='25'/>
- <animation id='folder' xlink:href='icons/folder.svg' width='25' height='25'/>
- <animation id='new' xlink:href='icons/document-new.svg' width='25' height='25'/>
- <g id="cartouche">
- <g transform="translate(0,0)">
- <use xlink:href="#go-up"/>
- <rect pointer-events="all" width="25" height="25" fill="none" stroke="none">
- <handler ev:event="click">flUpDir();</handler>
- </rect>
- </g>
- <g transform="translate(25,0)">
- <use xlink:href="#go-previous"/>
- <rect pointer-events="all" width="25" height="25" fill="none" stroke="none">
- <handler ev:event="click">flPrevFiles();</handler>
- </rect>
- </g>
- <g transform="translate(50,0)">
- <use xlink:href="#go-next"/>
- <rect pointer-events="all" width="25" height="25" fill="none" stroke="none">
- <handler ev:event="click">flNextFiles();</handler>
- </rect>
- </g>
- <g transform="translate(75,0)">
- <text id="dir" fill="black" font-family="Comic Sans MS" font-size="15" x="0" y="17"/>
- </g>
- </g>
- <g id="cartoucheflag">
- <g transform="translate(0,0)">
- <use xlink:href="#go-up"/>
- <rect pointer-events="all" width="25" height="25" fill="none" stroke="none">
- <handler ev:event="click">flUpDir();</handler>
- </rect>
- </g>
- <g transform="translate(25,0)">
- <use xlink:href="#go-previous"/>
- <rect pointer-events="all" width="25" height="25" fill="none" stroke="none">
- <handler ev:event="click">flPrevFiles();</handler>
- </rect>
- </g>
- <g transform="translate(50,0)">
- <use xlink:href="#go-next"/>
- <rect pointer-events="all" width="25" height="25" fill="none" stroke="none">
- <handler ev:event="click">flNextFiles();</handler>
- </rect>
- </g>
- <g transform="translate(75,0)">
- <use xlink:href="#go-jump"/>
- <rect pointer-events="all" width="25" height="25" fill="none" stroke="none">
- <handler ev:event="click">flScanDir();</handler>
- </rect>
- </g>
- <g transform="translate(100,0)">
- <text id="dirflag" fill="black" font-family="Comic Sans MS" font-size="15" x="0" y="17"/>
- </g>
- </g>
- <g id="fileMenuElement0">
- <use id="fileMenuElement0u"/>
- <rect id="fileMenuElement0r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement0t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement0r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement0r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement1">
- <use id="fileMenuElement1u"/>
- <rect id="fileMenuElement1r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement1t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement1r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement1r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement2">
- <use id="fileMenuElement2u"/>
- <rect id="fileMenuElement2r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement2t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement2r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement2r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement3">
- <use id="fileMenuElement3u"/>
- <rect id="fileMenuElement3r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement3t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement3r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement3r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement4">
- <use id="fileMenuElement4u"/>
- <rect id="fileMenuElement4r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement4t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement4r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement4r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement5">
- <use id="fileMenuElement5u"/>
- <rect id="fileMenuElement5r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement5t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement5r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement5r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement6">
- <use id="fileMenuElement6u"/>
- <rect id="fileMenuElement6r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement6t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement6r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement6r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement7">
- <use id="fileMenuElement7u"/>
- <rect id="fileMenuElement7r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement7t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement7r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement7r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement8">
- <use id="fileMenuElement8u"/>
- <rect id="fileMenuElement8r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement8t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement8r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement8r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement9">
- <use id="fileMenuElement9u"/>
- <rect id="fileMenuElement9r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement9t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement9r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement9r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement10">
- <use id="fileMenuElement10u"/>
- <rect id="fileMenuElement10r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement10t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement10r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement10r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement11">
- <use id="fileMenuElement11u"/>
- <rect id="fileMenuElement11r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement11t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement11r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement11r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement12">
- <use id="fileMenuElement12u"/>
- <rect id="fileMenuElement12r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement12t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement12r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement12r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement13">
- <use id="fileMenuElement13u"/>
- <rect id="fileMenuElement13r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement13t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement13r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement13r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement14">
- <use id="fileMenuElement14u"/>
- <rect id="fileMenuElement14r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement14t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement14r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement14r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement15">
- <use id="fileMenuElement15u"/>
- <rect id="fileMenuElement15r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement15t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement15r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement15r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement16">
- <use id="fileMenuElement16u"/>
- <rect id="fileMenuElement16r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement16t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement16r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement16r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement17">
- <use id="fileMenuElement17u"/>
- <rect id="fileMenuElement17r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement17t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement17r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement17r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement18">
- <use id="fileMenuElement18u"/>
- <rect id="fileMenuElement18r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement18t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement18r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement18r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement19">
- <use id="fileMenuElement19u"/>
- <rect id="fileMenuElement19r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement19t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement19r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement19r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement20">
- <use id="fileMenuElement20u"/>
- <rect id="fileMenuElement20r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement20t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement20r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement20r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement21">
- <use id="fileMenuElement21u"/>
- <rect id="fileMenuElement21r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement21t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement21r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement21r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement22">
- <use id="fileMenuElement22u"/>
- <rect id="fileMenuElement22r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement22t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement22r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement22r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement23">
- <use id="fileMenuElement23u"/>
- <rect id="fileMenuElement23r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement23t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement23r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement23r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement24">
- <use id="fileMenuElement24u"/>
- <rect id="fileMenuElement24r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement24t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement24r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement24r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement25">
- <use id="fileMenuElement25u"/>
- <rect id="fileMenuElement25r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement25t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement25r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement25r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement26">
- <use id="fileMenuElement26u"/>
- <rect id="fileMenuElement26r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement26t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement26r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement26r").setAttribute("fill", "rgb(245,245,245)");</handler>
- </g>
- <g id="fileMenuElement27">
- <use id="fileMenuElement27u"/>
- <rect id="fileMenuElement27r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement27t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement27r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement27r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement28">
- <use id="fileMenuElement28u"/>
- <rect id="fileMenuElement28r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement28t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement28r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement28r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement29">
- <use id="fileMenuElement29u"/>
- <rect id="fileMenuElement29r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement29t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement29r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement29r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement30">
- <use id="fileMenuElement30u"/>
- <rect id="fileMenuElement30r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement30t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement30r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement30r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement31">
- <use id="fileMenuElement31u"/>
- <rect id="fileMenuElement31r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement31t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement31r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement31r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement32">
- <use id="fileMenuElement32u"/>
- <rect id="fileMenuElement32r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement32t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement32r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement32r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement33">
- <use id="fileMenuElement33u"/>
- <rect id="fileMenuElement33r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement33t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement33r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement33r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement34">
- <use id="fileMenuElement34u"/>
- <rect id="fileMenuElement34r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement34t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement34r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement34r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement35">
- <use id="fileMenuElement35u"/>
- <rect id="fileMenuElement35r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement35t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement35r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement35r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement36">
- <use id="fileMenuElement36u"/>
- <rect id="fileMenuElement36r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement36t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement36r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement36r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement37">
- <use id="fileMenuElement37u"/>
- <rect id="fileMenuElement37r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement37t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement37r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement37r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement38">
- <use id="fileMenuElement38u"/>
- <rect id="fileMenuElement38r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement38t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement38r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement38r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement39">
- <use id="fileMenuElement39u"/>
- <rect id="fileMenuElement39r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement39t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement39r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement39r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement40">
- <use id="fileMenuElement40u"/>
- <rect id="fileMenuElement40r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement40t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement40r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement40r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement41">
- <use id="fileMenuElement41u"/>
- <rect id="fileMenuElement41r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement41t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement41r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement41r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement42">
- <use id="fileMenuElement42u"/>
- <rect id="fileMenuElement42r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement42t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement42r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement42r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement43">
- <use id="fileMenuElement43u"/>
- <rect id="fileMenuElement43r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement43t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement43r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement43r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement44">
- <use id="fileMenuElement44u"/>
- <rect id="fileMenuElement44r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement44t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement44r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement44r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement45">
- <use id="fileMenuElement45u"/>
- <rect id="fileMenuElement45r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement45t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement45r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement45r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement46">
- <use id="fileMenuElement46u"/>
- <rect id="fileMenuElement46r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement46t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement46r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement46r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement47">
- <use id="fileMenuElement47u"/>
- <rect id="fileMenuElement47r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement47t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement47r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement47r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement48">
- <use id="fileMenuElement48u"/>
- <rect id="fileMenuElement48r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement48t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement48r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement48r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- <g id="fileMenuElement49">
- <use id="fileMenuElement49u"/>
- <rect id="fileMenuElement49r" x="25" y="0" width="550" height="20" fill="rgb(245,245,245)" stroke="none"/>
- <text id="fileMenuElement49t" fill="gray" font-family="Comic Sans MS" font-size="20" x="30" y="17"/>
- <handler ev:event="mouseover">document.getElementById("fileMenuElement49r").setAttribute("fill", "black");</handler>
- <handler ev:event="mouseout">document.getElementById("fileMenuElement49r").setAttribute("fill", "rgb(245,245,245)");</handler>
- <handler ev:event="click">;</handler>
- </g>
- </defs>
- <rect id="frame" width="320" height="600" rx="15" fill="black" stroke="black"/>
- <!--text id="help" fill="rgb(90,90,120)" font-size="12" x="20" y="15">right click on home removes current widget</text-->
- <g id="execbar" display="none">
- <g id="remoting" transform="translate(18, 22)">
- <rect rx="8" ry="8" fill="rgb(140,140,50)" width="30" height="16"/>
- <text fill="black" font-family="Comic Sans MS" font-size="12" x="2" y="12">Push</text>
- <handler ev:event="click">on_widget_remote();</handler>
- </g>
- <g id="kill" transform="translate(55, 22)">
- <rect rx="8" ry="8" fill="rgb(140,140,50)" width="30" height="16"/>
- <text fill="black" font-family="Comic Sans MS" font-size="12" x="2" y="12">KillW</text>
- <handler ev:event="click">on_kill_widget();</handler>
- </g>
- <text id="widgetName" fill="white" font-family="Comic Sans MS" font-size="20" x="110" y="35">widgetName</text>
- </g>
- <g id="homebar" display="inline">
- <g id="adding" transform="translate(18, 22)">
- <rect rx="8" ry="8" fill="rgb(140,140,50)" width="30" height="16"/>
- <text fill="black" font-family="Comic Sans MS" font-size="12" x="2" y="12">Add</text>
- <handler ev:event="click">on_widget_add_menu();</handler>
- </g>
- <g id="removing" transform="translate(55, 22)">
- <rect rx="8" ry="8" fill="rgb(140,140,50)" width="30" height="16"/>
- <text fill="black" font-family="Comic Sans MS" font-size="10" x="2" y="12">Reset</text>
- <handler ev:event="click">on_clean_up();</handler>
- </g>
- <g id="dirscan" transform="translate(92, 22)">
- <rect rx="8" ry="8" fill="rgb(140,140,50)" width="30" height="16"/>
- <text fill="black" font-family="Comic Sans MS" font-size="12" x="2" y="12">Scan</text>
- <handler ev:event="click">on_dir_scan();</handler>
- </g>
- <g id="get" transform="translate(130, 22)">
- <rect rx="8" ry="8" fill="rgb(140,140,50)" width="36" height="16"/>
- <text fill="black" font-family="Comic Sans MS" font-size="12" x="2" y="12">GetW</text>
- <handler ev:event="click">on_get_widget();</handler>
- </g>
- </g>
- <rect id="screen" width="320" height="480" fill="white" stroke="black" x="0" y="60"/>
-
- <g id="homepage" transform="translate(0, 60)">
- <rect id="gridback" width="320" height="480" fill="rgb(40,40,40)" stroke="black"/>
- <g id="grid">
- <use xlink:href="#odd" transform="translate(0, 0)"/>
- <use xlink:href="#even" transform="translate(0, 80)"/>
- </g>
- <g id="icons" transform="translate(0,0)">
- </g>
- </g>
-
- <g transform="translate(0,60)">
- <g id="widget">
- </g>
- </g>
-
- <g transform="translate(0,60)">
- <g id="widgetAddList"/>
- </g>
-
-
- <g id="commands" transform="translate(0, 540)">
- <g id="homeButton" transform="translate(160,30)">
- <circle r="20" fill="rgb(40,40,40)" stroke="yellow"/>
- <rect width="18" height="18" x="-9" y="-9" fill="none" stroke="yellow"/>
- <handler ev:event="click">home_button(evt);</handler>
- </g>
- <g id="arrows">
- <g id="left" display="none" transform="translate(10, 10)">
- <animation xlink:href="icons/left_arrow.svg" width="40" height="40"/>
- <rect width="40" height="40" fill="none" stroke="none" pointer-events="all"/>
- <handler ev:event="click">left_button();</handler>
- </g>
- <g id="right" display="none" transform="translate(270, 10)">
- <animation xlink:href="icons/right_arrow.svg" width="40" height="40"/>
- <rect width="40" height="40" fill="none" stroke="none" pointer-events="all"/>
- <handler ev:event="click">right_button();</handler>
- </g>
- </g>
- <g id="arrowsW">
- <g id="leftW" display="none" transform="translate(10, 10)">
- <animation xlink:href="icons/go-previous.svg" width="40" height="40"/>
- <rect width="40" height="40" fill="none" stroke="none" pointer-events="all"/>
- <handler ev:event="click">left_buttonW();</handler>
- </g>
- <g id="rightW" display="none" transform="translate(270, 10)">
- <animation xlink:href="icons/go-next.svg" width="40" height="40"/>
- <rect width="40" height="40" fill="none" stroke="none" pointer-events="all"/>
- <handler ev:event="click">right_buttonW();</handler>
- </g>
- </g>
- </g>
- <rect id="rightCut" width="1000" height="600" x="321" y="0" fill="white" stroke="none"/>
- <rect id="leftCut" width="1000" height="600" x="-1001" y="0" fill="white" stroke="none"/>
- <rect id="frame2" width="320" height="600" rx="15" fill="none" stroke="black"/>
- <script xlink:href="mpegu-core.js"/>
- <script xlink:href="iphone_wm_gui.js"/>
- <handler ev:event="resize">resize();</handler>
- <animateColor id="getAttention" attributeName="fill" xlink:href="#frame" begin="indefinite" dur="1" from="red"
- to="black" restart="always" fill="freeze"/>
-</svg>
+++ /dev/null
-//This software module was originally developed by Telecom Paris in the
-//course of the development of MPEG-U Widgets (ISO/IEC 23007-1) standard.
-//
-//This software module is an implementation of a part of one or
-//more MPEG-U Widgets (ISO/IEC 23007-1) tools as specified by the MPEG-U Widgets
-//(ISO/IEC 23007-1) standard. ISO/IEC gives users of the MPEG-U Widgets
-//(ISO/IEC 23007-1) free license to this software module or modifications
-//thereof for use in hardware or software products claiming conformance to
-//the MPEG-U Widgets (ISO/IEC 23007-1). Those intending to use this software
-//module in hardware or software products are advised that its use may
-//infringe existing patents.
-//The original developer of this software module and his/her company, the
-//subsequent editors and their companies, and ISO/IEC have no liability
-//for use of this software module or modifications thereof in an implementation.
-//Copyright is not released for non MPEG-U Widgets (ISO/IEC 23007-1) conforming
-//products.
-//Telecom Paris retains full right to use the code for his/her own purpose,
-//assign or donate the code to a third party and to inhibit third parties from
-//using the code for non MPEG-U Widgets (ISO/IEC 23007-1) conforming products.
-//
-//This copyright notice must be included in all copies or derivative works.
-//
-//Copyright (c) 2009.
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////
-//
-// Authors:
-// Jean Le Feuvre, Telecom Paris
-// Jean-Claude Dufourd, Telecom Paris
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-// 01122011 AMD1 startWidget listWidgets getWidget implemented
-
-/*
- The widget manager in MPEG-U reference software is implemented in 2 parts:
- - a native GPAC module called gm_widgetman implementing
- * W3C widget loading (download, unzip, manifest parsing)
- * W3C Widget APIs
- * MPEG Widgets interfaces, messages and parameters listing
-
- - a script module (this file) implementing
- * MPEG Widget interface binding with UPnP services (UPnP is implemented in another module)
- * MPEG Widget interface binding with other local widgets
- * MPEG Widget discovery through UPnP devices announcement. The discovery is done by setting the device presentationURL to the widget URL
-
-
- A typical user of the widget manager will therefore see the following interfaces:
-
-interface WidgetManager {
- readonly unsigned integer num_widgets;
- string last_widget_dir;
-
- Widget open(string url, string source_ip);
- void bind(Widget wid);
- Widget get(unsigned int idx);
- void unload(Widget wid);
- void migrate_widget(upnp_renderer, widget);
- void corein_message(widget, msg_name, arg1name, arg1val, ....);
-
- //callback functions for the GUI to be notifed of widgets added / removed when UPnP devices are appearing/disappearing
- void on_widget_add(widget);
- void on_widget_remove(widget);
-
- //callback functions for core:out
- void coreOutSetSize(wid, args);
- void coreOutShow(wid, args);
- void coreOutHide(wid, args);
- void coreOutRequestActivate(wid, args);
- void coreOutRequestDeactivate(wid, args);
- void coreOutShowNotification(wid, args);
- void coreOutPlaceComponent(wid, args);
- void coreOutGetAttention(wid, args);
-
- }
-
-
-interface Widget {
- //exported meta-data from MPEG-U Manifest
- readonly string mainEncoding;
- readonly string mainMimeType;
- readonly integer defaultWidth;
- readonly integer defaultHeight;
-
- readonly Array icons;
- readonly Array features;
- readonly Array preferences;
-
-
- readonly string identifier;
- readonly string name;
- readonly string shortName;
- readonly string authorName;
- readonly string authorEmail;
- readonly string authorHref;
- readonly string description;
- readonly string viewmodes;
- readonly string licence;
- readonly string licenceHref;
- readonly string version;
- readonly string uuid;
- readonly boolean discardable;
- readonly boolean multipleInstances;
-
- //widget-manager specific data
- readonly string manifest;
- readonly string main;
- readonly string localizedSrc;
- readonly Array components; //array of widget objects used as component
- boolean permanent;
- readonly boolean is_component;
- readonly Widget parent;
- readonly boolean activated;
- readonly string section;
- readonly integer num_section;
- readonly integer num_interfaces;
- readonly integer num_bound_interfaces;
- readonly integer num_components;
-
-
- device = local UPnP device created in order to publish interfaces of this widget as upnp services
- originating_device = the device who sent the widget, either through migration or device discovery (presentationURL)
- originating_device_ip = the IP of the device who sent the widget
-
-
-
- void activate(Element node_with_ref_to_main);
- void deactivate();
- }
-
-interface Icon {
- readonly string src;
- readonly string relocated_src;
- readonly integer width;
- readonly integer height;
-}
-
-interface Preference {
- readonly string name;
- readonly string value;
- readonly boolean readonly;
-}
-
-interface Features {
- readonly string name;
- readonly boolean required;
- readonly Array params
-}
-
-interface FeatureParam {
- readonly string name;
- readonly string value;
-}
- */
-
-/*log function*/
-function log(lev, str) {
- if (lev <= log_level) alert('[WM] ' + str);
-}
-
-/*log levels*/
-l_err = 0;
-l_war = 1;
-l_inf = 2;
-l_deb = 3;
-
-/*default log level*/
-log_level = l_deb;
-
-whiteSpaceRegExp = new RegExp(' ', 'g');
-
-/*initializes the widget manager*/
-function widget_manager_init() {
- log(l_inf, 'Initializing MPEG-U Widgets');
- /*if UPnP is enabled, override the deviceAdd callback*/
- WidgetManager.upnp = false;
- WidgetManager.migrate_widget = wmjs_migrate_widget;
- WidgetManager.probe = wmjs_probe_widget;
- WidgetManager.open = wmjs_open_widget;
- WidgetManager.bind = wmjs_bind_widget;
-
- WidgetManager.on_widget_add = wmjs_on_widget_add;
- WidgetManager.on_widget_remove = wmjs_on_widget_remove;
-
- WidgetManager.check_bindings = wmjs_bind_widgets;
- WidgetManager.unbind_widget = wmjs_unbind_widget;
- WidgetManager.corein_message = wmjs_corein_message;
-
- WidgetManager.get_mpegu_service_providers = wmjs_get_mpegu_service_providers;
- WidgetManager.initialize();
-
- if (typeof(UPnP) != 'undefined') {
- WidgetManager.upnp = true;
- log(l_inf, 'Enabling Widget UPnP Discovery')
- UPnP.onDeviceAdd = wmjs_on_device_add;
- log(l_inf, 'Creating the standard MPEG-U Service')
- wmjs_create_standard_service();
- }
- log(l_inf, 'MPEG-U Widgets successfully initialized');
- initCore();
-}
-
-function wmjs_on_widget_add(widget) {}
-
-function wmjs_on_widget_remove(widget) {}
-
-function wmjs_probe_widget(url) {
- if ((url.lastIndexOf('.wgt') >= 0) || (url.lastIndexOf('.mgt') >= 0) || (url.lastIndexOf('.xml') >= 0)) return 1;
- return 0;
-}
-
-function wmjs_bind_output_trigger(widget, msg, callback, udta)
-{
- var res = widget.bind_output_trigger(msg, callback, udta);
- if (!res) {
- log(l_err, 'Cannot bind output trigger of message '+msg.name+' in widget '+widget.name);
- }
-}
-
-function wmjs_open_widget(url, src_ip, parent_widget) {
- log(l_deb, "wmjs_open_widget");
- var wid;
- if (arguments.length>=3) {
- wid = WidgetManager.load(url, parent_widget);
- } else {
- wid = WidgetManager.load(url);
- }
- if (wid == null) {
- log(l_err, 'File ' + url + ' is not a valid widget');
- return null;
- }
- wid.device = null;
- wid.originating_device = null;
- wid.originating_device_ip = null;
- if (src_ip) {
- wid.permanent = false;
- wid.originating_device_ip = src_ip;
- log(l_inf, 'Widget received - ip ' + wid.originating_device_ip);
- } else {
- wid.permanent = true;
- wid.originating_device_ip = null;
- }
- return wid;
-}
-
-/*performs an unbind check on all widgets*/
-function wmjs_unbind_widget(widget) {
- var i, count, wid, ifce_count, j;
- log(l_inf, 'wmjs_unbind_widget ' + widget.name);
-
- if (WidgetManager.upnp && widget.device) {
- UPnP.DeleteDevice(widget.device);
- widget.device = null;
- }
-
- count = WidgetManager.num_widgets;
- ifce_count = widget.num_interfaces;
- for (i = 0; i < count; i++) {
- wid = WidgetManager.get(i);
- if (!wid) continue;
- if (wid == widget) continue;
- if (!wid.activated) continue;
-
- for (j = 0; j < ifce_count; j++) {
- var an_ifce = widget.get_interface(j);
- wid.unbind_interface(an_ifce, widget);
- }
- }
- wmjs_bind_widgets();
-}
-
-
-/*performs a bind check on all widgets*/
-function wmjs_bind_widgets() {
- log(l_deb, 'wmjs_bind_widgets');
- var i, wid, count;
- count = WidgetManager.num_widgets;
- for (i = 0; i < count; i++) {
- wid = WidgetManager.get(i);
- if (!wid) continue;
- if (!wid.activated) continue;
- WidgetManager.bind(wid);
- }
-}
-
-
-/*performs a bind on the given widget*/
-function wmjs_bind_widget(wid) {
- var i, j, ifce_count, device, service, msg, do_bind;
-
- if (!wid.activated) {
- log(l_inf, 'widget not activated - cannot bind');
- return;
- }
- ifce_count = wid.num_interfaces;
-
- log(l_inf, 'Binding widget ' + wid.name + ' - Nb Interfaces ' + ifce_count);
-
- /*browse all interfaces and locate services*/
- for (i = 0; i < ifce_count; i++) {
- var ifce = wid.get_interface(i);
- log(l_inf, 'Binding interface ' + ifce.type);
-
- /*look for a core:* service for this interface and setup*/
- if (wmjs_bind_interface_to_core_service(wid, ifce)) {
- continue;
- }
- /*if our widget is already bound to this widget, skip it*/
- if (!ifce.multipleBinding && wid.is_interface_bound(ifce)) {
- log(l_deb, 'Widget ' + wid.name + ' interface ' + ifce.type + ' already bound');
- continue;
- }
- /*if the widget is the provider of the service, create the service*/
- if (ifce.serviceProvider) {
- log(l_inf, 'widget is a service provider');
- if (WidgetManager.upnp) wmjs_create_upnp_service(wid, ifce);
- continue;
- }
- /*look for a UPnP service for this interface and setup*/
- if (WidgetManager.upnp && wmjs_bind_interface_to_upnp(wid, ifce)) {
- continue;
- }
- /*look for a local service for this interface*/
- if (wmjs_bind_interface_to_local(wid, ifce)) {
- continue;
- }
- /*no service found*/
- log(l_inf, 'Cannot find service for widget ' + wid.name + ' interface ' + ifce.type);
- }
-}
-
-/*called when a new UPnP device has been added or removed in the network*/
-function wmjs_on_device_add(device, is_add) {
- log(l_deb, 'wmjs_on_device_add');
- if (!is_add) {
- //TODO JCD: this is wrong, sometimes a device is not "is_add" but is not to be removed either
- /*log(l_inf, 'Device Removed ' + device.Name);
- wmjs_standard_service_remove(device);
- wmjs_unbind_upnp_device(device);
- if (device.widget != null) {
- log(l_inf, 'Widget Removed ' + device.widget.name);
- WidgetManager.on_widget_remove(device.widget);
- device.widget.originating_device = null;
- device.widget = null;
- }
- WidgetManager.check_bindings();*/
- return;
- }
- log(l_inf, 'Device Added ' + device.Name + ' URL ' + device.PresentationURL);
- wmjs_standard_service_add(device);
- WidgetManager.check_bindings();
- /*look for a presentation url - if not given or not identifying a widget, don't do anything*/
- var url = device.PresentationURL;
- if (!url || (url == '')) return;
- if (! WidgetManager.probe(url)) return;
- /*OK load the widget*/
- var widget = WidgetManager.load(url);
- widget.newBorn = true;
- if (widget == null) {
- log(l_err, 'File ' + url + ' is not a valid widget');
- return;
- }
- widget.originating_device = device;
- device.widget = widget;
- /*indicate our widget is not to be stored*/
- widget.permanent = false;
- WidgetManager.on_widget_add(widget);
-}
-
-
-/*
- LOCAL INTERFACE BINDING ROUTINES
-
- In this implementation, widgets-to-widget communication in the same widget manager are called "local" communications.
- The implementation do not rely on any service description for that and directly matches the widgets interfaces
- */
-
-function wmjs_output_trigger_callback_local(msg_out, wid_src, msg_in, wid_dst) {
- log(l_deb, "wmjs_output_trigger_callback_local");
- return function(value) {
- log(l_deb, "wmjs_output_trigger_callback_local/function " + value + " '" + wid_src.name + "'" + wid_dst.name + "'");
- var param_count = msg_out.num_params;
- var args = new Array();
- var is_script = 0;
- var ai = 0, i;
- if (msg_in.has_script_input) is_script = 1;
- log(l_inf, 'Invoking Widget(' + wid_src.name + ').' + msg_out.name);
- for (i = 0; i < param_count; i++) {
- var param = msg_out.get_param(i);
- if (param.is_input) continue;
-
- if (is_script) {
- args[ai] = wid_src.get_param_value(param);
- ai++;
- } else {
- wid_dst.set_input(msg_in.get_param(param.name), wid_src.get_param_value(param));
- }
- }
- log(l_inf, 'Calling Widget(' + wid_dst.name + ').' + msg_in.name);
-
- if (msg_in.has_input_action) {
- wid_dst.call_input_action(msg_in);
- } else if (is_script) {
- wid_dst.call_input_script(msg_in, args);
- }
- };
-}
-
-
-function wmjs_interface_invoke_callback_local(wid_dst, ifce_dst, is_reply) {
- log(l_deb, "wmjs_interface_invoke_callback_local '" + wid_dst.name + "' '" + ifce_dst.type + "' - reply " + is_reply);
- return function() {
- log(l_deb, "wmjs_interface_invoke_callback_local/function '" + wid_dst.name + "' '" + ifce_dst.type + "' - reply " + is_reply);
- var j, i, ai, param_count, msgHandler, msg_src, msg_dst, is_script;
- var args = new Array();
- is_script = 0;
- msgHandler = arguments[0];
- /*get msg from source interface (this object)*/
- msg_src = this.get_message(msgHandler.msgName);
- // JCD: take into account message repetition, if any
- for (j = 0; j < ifce_dst.num_messages; j++) {
- msg_dst = ifce_dst.get_message(j);
- if (msg_dst.name == msgHandler.msgName) {
- log(l_deb, (is_reply ? 'invokeReply ' : 'invoke ') + msg_src.name + ' on ' + wid_dst.name + '.' + msg_dst.name);
- if (msg_dst.has_script_input) is_script = 1;
- param_count = msg_src.num_params;
- ai = 1;
- for (i = 0; i < param_count; i++) {
- var param = msg_dst.get_param(i);
- if (! param.is_input) continue;
- if (is_script) {
- args[ai - 1] = arguments[ai];
- } else {
- wid_dst.set_input(param, arguments[ai]);
- }
- ai++;
- }
- if (msg_dst.has_input_action) {
- wid_dst.call_input_action(msg_dst);
- } else if (is_script) {
- wid_dst.call_input_script(msg_dst, args);
- }
- }
- }
- };
-}
-
-/*
- END OF LOCAL INTERFACE BINDING ROUTINES
- */
-
-
-function wmjs_bind_interface_to_local(wid, ifce) {
- log(l_deb, "wmjs_bind_interface_to_local '" + wid.name + "' " + ifce.type);
- var i, count, count2, j, a_ifce, a_msg, par, a_par, k, nb_ok, ret, set_bind, a_wid;
- count = WidgetManager.num_widgets;
- ret = false;
- // this is the main loop to try to bind a widget to any other
- for (i = 0; i < count; i++) {
- a_wid = WidgetManager.get(i);
- if (!a_wid) continue;
- if (a_wid == wid) continue;
- if (!a_wid.activated) continue;
- count2 = a_wid.num_interfaces;
- // now that we know this is a valid widget and not the same as wid
- // loop on all its interfaces to find one of the right type
- for (j = 0; j < count2; j++) {
- a_ifce = a_wid.get_interface(j);
- if (a_ifce.type == ifce.type) break;
- }
- if (j == count2) continue;
-
- /*if our widget is already bound to this widget (multiple binding==true) or to any widget (multiple binding==false), skip it*/
- if (wid.is_interface_bound(ifce, ifce.multipleBinding ? a_wid : null)) {
- log(l_inf, 'Widget ' + wid.name + ' interface ' + ifce.type + ' is already bound');
- continue;
- }
- /*if our widget is already bound to this widget (multiple binding==true) or to any widget (multiple binding==false), skip it*/
- if (a_wid.is_interface_bound(a_ifce, a_ifce.multipleBinding ? wid : null)) {
- log(l_inf, 'Widget ' + a_wid.name + ' interface ' + a_ifce.type + ' is already bound');
- continue;
- }
-
- set_bind = 0;
- // we have found an interface of the right type in the other widget
- log(l_inf, 'Checking local widget ' + a_wid.name + ' for interface ' + ifce.type);
- // loop on the messages to check if they match
- for (j = 0; j < ifce.num_messages; j++) {
- var msg = ifce.get_message(j), l;
- //if (msg.is_input) continue; // JCD: remove test
- // does the other interface have this message
- // JCD: remove next line and take repetition of messages into account
- // a_msg = a_ifce.get_message(msg.name);
- for (l = 0; l < a_ifce.num_messages; l++) {
- a_msg = a_ifce.get_message(l);
- //alert(msg.name+" "+a_msg.name);
- if (a_msg.name == msg.name) {
- // the messages have matching names, check direction
- if (msg.is_input == a_msg.is_input) {
- log(l_inf, 'Local widget message for ' + msg.name + ' is not in direction ' + (msg.is_input ? 'output' : 'input'));
- continue;
- }
- // the messages have matching names and directions, check params
- if (msg.num_params != a_msg.num_params) {
- log(l_war, 'Local widget message ' + msg.name + ' does not have the same number of parameters');
- continue;
- }
- /*check all params*/
- nb_ok = 0;
- for (k = 0; k < msg.num_params; k++) {
- par = msg.get_param(k);
- a_par = a_msg.get_param(par.name);
- if (a_par != null && par.is_input != a_par.is_input) nb_ok ++;
- }
- if (nb_ok != msg.num_params) {
- log(l_war, 'Local widget message ' + msg.name + ' does not have the same input/output parameters');
- continue;
- }
- set_bind ++;
- // the messages match
- log(l_inf, 'Binding ' + wid.name + '.' + msg.name + ' to ' + a_wid.name + '.' + a_msg.name);
- /*OK let's bind this action: we only need to assign the output trigger, the input action will be called from the other widget*/
- if (msg.has_output_trigger) {
- wmjs_bind_output_trigger(wid, msg, wmjs_output_trigger_callback_local(msg, wid, a_msg, a_wid), a_wid);
- }
- /*OK let's bind this action: we only need to assign the output trigger, the input action will be called from the other widget*/
- if (a_msg.has_output_trigger) {
- wmjs_bind_output_trigger(a_wid, a_msg, wmjs_output_trigger_callback_local(a_msg, a_wid, msg, wid), wid);
- }
- }
- }
- }
- if (!set_bind) continue;
-
- /*create callback for programmatic action triggers*/
- ifce.invoke = wmjs_interface_invoke_callback_local(a_wid, a_ifce, 0);
- ifce.invokeReply = wmjs_interface_invoke_callback_local(a_wid, a_ifce, 1);
- /*create callback for programmatic action triggers*/
- a_ifce.invoke = wmjs_interface_invoke_callback_local(wid, ifce, 0);
- a_ifce.invokeReply = wmjs_interface_invoke_callback_local(wid, ifce, 1);
- a_wid.bind_interface(a_ifce, wid, 'localhost');
- wid.bind_interface(ifce, a_wid, 'localhost');
- ret = true;
- }
- return ret;
-}
-
-
-/*
- INTERFACE BINDING TO UPNP SERVICES ROUTINES
-
- This implemntation supports binding interfaces to existing UPnP services
- */
-
-/*create a listener function for input parameters*/
-function wmjs_upnp_action_listener(widget, par, msg) {
- log(l_deb, "wmjs_upnp_action_listener '" + widget.name + "' " + (par != null ? par.name : 'noPar') + " " + (msg != null ? msg.name : 'noMsg'));
- return function(value) {
- log(l_deb, "wmjs_upnp_action_listener/function '" + widget.name + "' " + (par != null ? par.name : 'noPar') + " " +
- (msg != null ? msg.name : 'noMsg') + " " + value);
- if (par != null) widget.set_input(par, value);
- if (msg != null) widget.call_input_action(msg);
- }
-}
-
-/*create a listener function for input parameters*/
-function wmjs_upnp_action_listener_script(widget, msg) {
- log(l_deb, 'wmjs_upnp_action_listener_script');
- return function() {
- var i, count, act, par, rval, msgHandler, args;
- act = arguments[0];
- log(l_deb, 'wmjs_upnp_action_listener_script/function:nb args ' + arguments.length);
- msgHandler = arguments[1];
- log(l_deb, 'wmjs_upnp_action_listener_script/function:msgh ' + msgHandler);
- args = new Array();
- count = msg.num_params;
- for (i = 0; i < count; i++) {
- par = msg.get_param(i);
- if (!par.is_input) continue;
- rval = act.GetArgumentValue(par.name);
- if (par.script_type == 'number') {
- args.push(parseInt(rval));
- } else if (par.script_type == 'boolean') {
- args.push(rval == 'true');
- } else {
- args.push(rval);
- }
- }
- msgHandler.onInvokeReply(args);
- }
-}
-
-
-/**/
-function wmjs_output_trigger_callback_upnp(service, widget, msg) {
- log(l_deb, 'wmjs_output_trigger_callback_upnp');
- return function(value) {
- log(l_deb, 'wmjs_output_trigger_callback_upnp/function ' + value);
- var i, pi, param_count = msg.num_params;
- var args = new Array();
- pi = 0;
- for (i = 0; i < param_count; i++) {
- var param = msg.get_param(i);
- if (param.is_input) continue;
- args[pi] = param.name;
- args[pi + 1] = widget.get_param_value(param);
- pi += 2;
- }
- log(l_inf, 'Calling UPnP Action ' + msg.name + " " + param_count);
- service.CallAction(msg.name, args);
- };
-}
-
-
-/*create the action callback*/
-function wmjs_message_setup_upnp(widget, service, msg) {
- log(l_deb, 'wmjs_message_setup_upnp ' + msg.name);
- /*first let's browse all the message params*/
- var rad, i, param_count, has_script_input;
- has_script_input = false;
- param_count = msg.num_params;
- for (i = 0; i < param_count; i++) {
- var param = msg.get_param(i);
- /*interface not valid for this service*/
- if (!service.HasAction(msg.name, param.name)) {
- if (!param.is_input) {
- log(l_war, 'Output param ' + param.name + ' not found in action - cannot bind action');
- return false;
- }
- continue;
- }
- /*this is a service -> widget param */
- if (param.is_input) {
- if (msg.has_input_action) {
- service.SetActionListener(msg.name, wmjs_upnp_action_listener(widget, param, null), param.name);
- } else {
- has_script_input = true;
- // todo: pas vrai d'apres JCD
- }
- }
- /*this is a widget -> service param , used in callback function*/
- }
- /*assign the output trigger*/
- if (msg.has_output_trigger) {
- var fun_name = 'call_' + msg.name;
- widget[fun_name] = wmjs_output_trigger_callback_upnp(service, widget, msg);
- wmjs_bind_output_trigger(widget, msg, widget[fun_name], service);
- }
- /*assign the input action*/
- if (msg.has_input_action) {
- service.SetActionListener(msg.name, wmjs_upnp_action_listener(widget, null, msg));
- } else if (has_script_input) {
- service.SetActionListener(msg.name, wmjs_upnp_action_listener_script(widget, msg), true);
- }
- return true;
-}
-
-
-function wmjs_interface_invoke_callback_upnp(service) {
- log(l_deb, 'wmjs_interface_invoke_callback_upnp');
- return function() {
- log(l_deb, 'wmjs_interface_invoke_callback_upnp/function');
- var args = new Array();
- var i, pi, ai, param_count, msg, ifce_msg;
-
- msg = arguments[0];
- ifce_msg = this.get_message(msg.msgName);
- param_count = ifce_msg.num_params;
- log(l_inf, 'UPnP invoke action ' + ifce_msg.name + ' - ' + msg.msgName);
-
- pi = 0;
- ai = 1;
- for (i = 0; i < param_count; i++) {
- var param = ifce_msg.get_param(i);
- if (param.is_input) continue;
-
- args[pi] = param.name;
- args[pi + 1] = arguments[ai];
- pi += 2;
- ai++;
- }
- service.CallAction(msg.msgName, args, msg);
- };
-}
-
-
-function wmjs_bind_interface_to_upnp(wid, ifce) {
- log(l_deb, "wmjs_bind_interface_to_upnp");
- var do_bind, is_upnp = false;
- var service = null;
-
- if (wid.originating_device) {
- service = wid.originating_device.FindService(ifce.type);
- } else if (wid.originating_device_ip) {
- service = UPnP.FindService(wid.originating_device_ip, ifce.type);
- } else {
- var j, dev_count = UPnP.DevicesCount;
- log(l_deb, 'wmjs_bind_interface_to_upnp nb ' + dev_count);
- for (j = 0; j < dev_count; j++) {
- device = UPnP.GetDevice(j);
- log(l_deb, "wmjs_bind_interface_to_upnp " + device.Name + ' - type: ' + ifce.type);
- /*do we have a UPnP service with the same interface type ?*/
- service = device.FindService(ifce.type);
-
- /*our widget is not bound to this service*/
- if (service) {
- if (!wid.is_interface_bound(ifce, service)) break;
- service = null;
- is_upnp = true;
- }
- }
- }
- if (!service) return is_upnp;
-
- /*our widget is already bound to this service*/
- if (wid.is_interface_bound(ifce, service)) {
- log(l_inf, 'Found UPnP Service for interface ' + ifce.type);
- return true;
- }
-
- log(l_inf, 'Found UPnP Service for interface ' + ifce.type);
- do_bind = 0;
- for (j = 0; j < ifce.num_messages; j++) {
- var msg = ifce.get_message(j);
- /*if we have a state variable in the service with the same name as the pin, bind it*/
- if (service.HasStateVariable(msg.name)) {
- var param = msg.get_param(0);
- if (param && (param.name == msg.name)) {
- /*set listeners for declarative action triggers*/
- log(l_deb, 'Found UPnP state variable for message ' + msg.name);
- service.SetStateVariableListener(wmjs_upnp_action_listener(wid, param, msg), param.name);
- do_bind = 1;
- }
- }
- /*if we have an action in the service with the same name as the pin, bind it*/
- else if (service.HasAction(msg.name)) {
- /*set listeners for declarative action triggers*/
- log(l_deb, 'Found UPnP action for message ' + msg.name);
- wmjs_message_setup_upnp(wid, service, msg);
- do_bind = 1;
- }
- /*NOTE: UPnP actions are only messageOut, messageIn are UPnP events and don't have output paramaters. We therefore never need to setup
- the invokeReply callback for interfaces matching UPnP services. !! This is not true for UPnP services created to publish an interface, eg serviceProvider="true".*/
- }
- if (do_bind) {
- /*create callback for programmatic action triggers*/
- log(l_inf, 'Binding widget ' + wid.name + ' interface ' + ifce.type + ' to host ' + service.Hostname);
- ifce.invoke = wmjs_interface_invoke_callback_upnp(service);
- /*bind interface*/
- wid.bind_interface(ifce, service, service.Hostname);
- }
- return true;
-}
-
-function wmjs_unbind_upnp_device(device)
-{
- var i, count, j, ifce_count;
- count = WidgetManager.num_widgets;
-
- for (i = 0; i < count; i++) {
- wid = WidgetManager.get(i);
- if (!wid) continue;
- if (!wid.activated) continue;
-
- ifce_count = wid.num_interfaces;
- for (j = 0; j < ifce_count; j++) {
- var ifce = wid.get_interface(j);
- /*do we have a UPnP service with the same interface type ?*/
- var service = device.FindService(ifce.type);
- if (!service) continue;
-
- /*unbind this interface*/
- if (wid.is_interface_bound(ifce, service)) {
- wid.unbind_interface(ifce, service);
- }
- }
- }
-}
-
-/*
- END OF INTERFACE BINDING TO UPNP SERVICES ROUTINES
- */
-
-//
-// section on widget migration
-//
-
-header = '<scpd xmlns="urn:schemas-upnp-org:service-1-0"><specVersion><major>1</major><minor>0</minor></specVersion><actionList>';
-middler = '</actionList><serviceStateTable>';
-footer = '</serviceStateTable></scpd>';
-standard_service_scpd = header+'<action><name>startWidget</name><argumentList><argument><name>widgetUrl</name><direction>in</direction><relatedStateVariable>s1</relatedStateVariable></argument><argument><name>widgetUUID</name><direction>in</direction><relatedStateVariable>s2</relatedStateVariable></argument><argument><name>widgetContext</name><direction>in</direction><relatedStateVariable>s3</relatedStateVariable></argument><argument><name>errorCode</name><direction>out</direction><relatedStateVariable>s4</relatedStateVariable></argument></argumentList></action>';
-{
- standard_service_scpd += '<action><name>requestCapabilitiesList</name><argumentList><argument><name>capabilitiesType</name><direction>out</direction><relatedStateVariable>s5</relatedStateVariable></argument><argument><name>capabilities</name><direction>out</direction><relatedStateVariable>s6</relatedStateVariable></argument></argumentList></action>';
- standard_service_scpd += '<action><name>listWidgets</name><argumentList><argument><name>widgetCodes</name><direction>out</direction><relatedStateVariable>s7</relatedStateVariable></argument><argument><name>widgetNames</name><direction>out</direction><relatedStateVariable>s8</relatedStateVariable></argument><argument><name>widgetIdentifiers</name><direction>out</direction><relatedStateVariable>s9</relatedStateVariable></argument></argumentList></action>';
- standard_service_scpd += '<action><name>getWidget</name><argumentList><argument><name>widgetCode</name><direction>in</direction><relatedStateVariable>s10</relatedStateVariable></argument><argument><name>errorCode</name><direction>out</direction><relatedStateVariable>s11</relatedStateVariable></argument>';
- standard_service_scpd += '<argument><name>widgetUrl</name><direction>out</direction><relatedStateVariable>s41</relatedStateVariable></argument><argument><name>widgetUUID</name><direction>out</direction><relatedStateVariable>s42</relatedStateVariable></argument><argument><name>widgetContext</name><direction>out</direction><relatedStateVariable>s43</relatedStateVariable></argument></argumentList></action>';
- standard_service_scpd += middler+'<stateVariable><name>s1</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s2</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s3</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s4</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s5</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s6</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s7</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s8</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s9</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s10</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s11</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s41</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s42</name><dataType>string</dataType></stateVariable>';
- standard_service_scpd += '<stateVariable><name>s43</name><dataType>string</dataType></stateVariable>'+footer;
-}
-
-//
-// migrate a widget by calling the appropriate startWidget message of the target
-// migration service
-//
-function wmjs_migrate_widget(render, widget) {
- if (WidgetManager.upnp) {
- var url, ctx, uri;
-
- url = widget.url;
- /*share the widget*/
- uri = UPnP.ShareResource(url, render.HostName);
-
- ctx = widget.get_context();
-
- if (ctx == null) ctx = "";
- log(l_inf, 'Migrating widget ' + url + ' to renderer ' + render.Name + ' as resource ' + uri);
- log(l_inf, 'Migration Context ' + ctx);
-
- // envoyer la methode startWidget sur render
- var args = new Array();
- args.push("widgetUrl");
- args.push(uri);
- args.push("widgetUUID");
- args.push(null);
- args.push("widgetContext");
- args.push(ctx);
- log(l_inf, "startWidget "+uri);
- log(l_inf, "startWidgetCtx "+ctx);
- alert("call StdServ "+render.Name+" "+render.standardService);
- var code = render.standardService.CallAction("startWidget", args);
- log(l_inf, "return code from standardService.CallAction is "+code);
- }
-}
-
-//
-// check whether the removed device was a publisher of MPEGUStandardService
-// if yes, remove it from the list
-//
-function wmjs_standard_service_remove(device) {
- var service = device.FindService("urn:mpeg-u:service:widget-manager:1");
- if (service != null) {
- var i = WidgetManager.MPEGUStandardServiceProviders.indexOf(device);
- if (i >= 0) {
- log(l_err, "migration service remove "+device.Name);
- WidgetManager.MPEGUStandardServiceProviders.splice(i, 1);
- } else log(l_err, "Trying to remove a standard service device which was not added first: "+device);
- }
-}
-
-//
-// add a migration service provider to the list and remember the service in the device
-//
-function wmjs_standard_service_add(device) {
- var service = device.FindService("urn:mpeg-u:service:widget-manager:1");
- if (service != null) {
- log(l_err, "migration service add "+device.Name);
- WidgetManager.MPEGUStandardServiceProviders.push(device);
- device.standardService = service;
- alert("add StdServ "+device.Name+" "+device.standardService);
- }
-}
-
-//
-// get the nth standard service provider (migration service)
-//
-function wmjs_get_mpegu_service_providers(index) {
- if (!WidgetManager.MPEGUStandardServiceProviders) {
- log(l_err, "uninitialized MPEGUStandardServiceProviders");
- return null;
- }
- if (index < 0 || index > WidgetManager.MPEGUStandardServiceProviders.length) {
- log(l_err, "index of MPEGUStandardServiceProviders out of bounds:"+index);
- return null;
- }
- return WidgetManager.MPEGUStandardServiceProviders[index];
-}
-
-function wmjs_create_standard_service() {
- //alert("create_standard_service");
- var name = "MPEG-U";
- var option = scene.get_option('General', 'DeviceName');
- if (option) name = option;
- WidgetManager.device = UPnP.CreateDevice("urn:mpeg-u:device:widget-manager:1", name+"@"+Sys.hostname);
- WidgetManager.device.enabled = 1;
- /* implement the response to a external call (messageOut of another widget) */
- WidgetManager.device.OnAction = wmjs_widget_standard_service_process_action;
- log(l_err, 'wmjs_create_standard_service');
- //log(l_inf, 'Service scpd ' + standard_service_scpd);
- /* WidgetManager.standardService = */
- var service = WidgetManager.device.SetupService("MPEG-U_Standard_Service", "urn:mpeg-u:service:widget-manager:1",
- "urn:mpeg-u:serviceId:widget-manager:1.001", standard_service_scpd);
- WidgetManager.device.Start();
- WidgetManager.MPEGUStandardServiceProviders = new Array();
- //alert("create_standard_service end");
-}
-
-/* generic processing of any action from outside for the standard MPEG-U service */
-function wmjs_widget_standard_service_process_action(action) {
- log(l_err, 'wmjs_widget_standard_service_process_action Action ' + action.Name);
- /* find the message matching the action in the interface */
- if (action.Name == "startWidget") {
- process_startWidget_action(action);
- } else if (action.Name == "requestCapabilitiesList"){
- process_requestCapabilitiesList_action(action);
- } else if (action.Name == "listWidgets") {
- process_listWidgets_action(action);
- } else if (action.Name == "getWidget") {
- process_getWidget_action(action);
- } else {
- log(l_inf, 'wmjs_widget_standard_service_process_action Action not found: ' + action.Name);
- }
-}
-
-//
-// processing of a request to start a widget (push migration or predefined "activateWidgetByUrl")
-//
-function process_startWidget_action(action) {
- log(l_err,"process start widget");
- // get action arguments
- var widgetUrl = action.GetArgument("widgetUrl");
- var widgetUUID = action.GetArgument("widgetUUID");
- var widgetContext = action.GetArgument("widgetContext");
- log(l_err,"start:"+widgetUrl+" "+widgetUUID+" "+widgetContext);
- // get widget
- if (widgetUrl == null && widgetUUID != null) {
- log(l_err, "unable to load a widget by UUID: unimplemented");
- action.SendReply(["errorCode", 1]);
- return;
- }
- var wid = WidgetManager.load(widgetUrl, null, widgetContext);
- WidgetManager.on_widget_add(wid);
- action.SendReply(["errorCode", 0]);
-}
-
-//
-// processing of a request for the list of capabilities
-//
-function process_requestCapabilitiesList_action(action) {
- //TODO
- alert("UNIMPLEMENTED in mpegu-core.js: request capabilities list");
-}
-
-//
-// processing of a request for the list of widgets (prelude to a pull migration)
-//
-function process_listWidgets_action(action) {
- log(l_err,"process list widgets");
- // list widget
- var count = WidgetManager.num_widgets, i, r1 = "", r2 = "", includeSpace = false;
- for (i = 0; i < count; i++) {
- var wid = WidgetManager.get(i);
- if (wid.activated) {
- if (includeSpace) {
- r1 += " ";
- } else {
- includeSpace = true;
- }
- r1 += i+1;
- r2 += wid.name.replace(whiteSpaceRegExp, '_')+" ";
- }
- }
- alert("sendReply widgetCodes=|"+r1+"| widgetNames=|"+r2+"|");
- action.SendReply(["widgetCodes", r1, "widgetNames", r2]);
-}
-
-//
-// processing of a pull migration request
-//
-function process_getWidget_action(action) {
- log(l_deb, "process get widget "+action+" "+action.Name);
- // get action arguments
- var widgetCode = action.GetArgument("widgetCode");
- log(l_deb, "get:"+widgetCode);
- // get widget
- var wid = WidgetManager.get(parseInt(widgetCode) - 1);
- var url, ctx, uri;
- url = wid.url;
- /*share the widget*/
- uri = UPnP.ShareResource(url);
- ctx = wid.get_context();
- if (ctx == null) ctx = "";
- log(l_inf, 'sendReply widget ' + url + ' as resource ' + uri);
- log(l_inf, 'with context ' + ctx);
- var args = new Array();
- args.push("errorCode");
- args.push(0);
- args.push("widgetUrl");
- args.push(uri);
- args.push("widgetUUID");
- args.push(null);
- args.push("widgetContext");
- args.push(ctx);
- action.SendReply(args);
- WidgetManager.on_widget_remove(wid);
-}
-
-//
-// end of migration service
-//
-
-/*
- INTERFACE PUBLISHING AS UPNP SERVICES ROUTINES
-
- This implementation supports publishing a widget interface in the network as a UPnP service. This is done
- by generating on the fly a new device associated with a widget, and one UPnP service per widget interface.
- The UPnP service description (SCPD) is generated on the fly from the interface description
- */
-
-function wmjs_make_interface_scpd(widget, ifce) {
- log(l_deb, "wmjs_make_interface_scpd");
- var variables = '', actions = '', vars, j, msg, k, param, numstatevar = 0;
- /*do actions*/
- for (j = 0; j < ifce.num_messages; j++) {
- msg = ifce.get_message(j);
- actions += '<action><name>' + msg.name + '</name><argumentList>';
- for (k = 0; k < msg.num_params; k++) {
- param = msg.get_param(k);
- actions += '<argument><name>' + param.name + '</name><direction>' + (param.is_input ? 'in' : 'out');
- actions += '</direction><relatedStateVariable>v' + numstatevar + '</relatedStateVariable></argument>';
- numstatevar++;
- }
- actions += '</argumentList></action>';
- }
- /*do variables*/
- for (k = 0; k < numstatevar; k++) {
- variables += '<stateVariable><name>v' + k + '</name><dataType>string</dataType></stateVariable>';
- }
- return header + actions + middler + variables + footer;
-}
-
-/* generic processing of any action from outside */
-function wmjs_widget_upnp_process_action(action) {
- log(l_err, 'wmjs_widget_upnp_process_action Action ' + action.Name + ' invoked on ' + action.Service.ifce.type);
- var i, ai, args, msg, has_output = false;
- /* find the message matching the action in the interface */
- msg = null;
- for (i = 0; i < action.Service.ifce.num_messages; i++) {
- msg = action.Service.ifce.get_message(i);
- if (msg.name == action.Name) break;
- msg = null;
- }
- if (msg == null) {
- log(l_inf, 'wmjs_widget_upnp_process_action Action not found: ' + action.Name + ' invoked on ' + action.Service.name);
- return;
- }
- args = new Array();
- ai = 0;
- /*assign action for any async callback from the scene (cf wmjs_upnp_action_response)*/
- action.Service.action = action;
- /* for each param in the found message */
- for (i = 0; i < msg.num_params; i++) {
- var param = msg.get_param(i);
- /* only process input params */
- if (!param.is_input) {
- has_output = true;
- continue;
- }
- if (msg.has_script_input) {
- /* input param is scripted, store argument value in args array */
- args[ai] = action.GetArgument(param.name);
- } else {
- /* input param is not scripted but declarative, store argument value directly in scene tree */
- this.widget.set_input(param, action.GetArgument(param.name));
- }
- ai++;
- }
- if (msg.has_input_action) {
- /* message is not scripted, call input action */
- this.widget.call_input_action(msg);
- } else if (msg.has_script_input) {
- /* message is scripted, call the script function specified in inputAction */
- this.widget.call_input_script(msg, args);
- }
- if (!has_output) {
- log(l_inf, 'wmjs_widget_upnp_process_action sending empty reply');
- action.SendReply();
- action.Service.action = null;
- }
-}
-
-function wmjs_upnp_event_sender(service, widget, msg) {
- return function(value) {
- log(l_deb, 'wmjs_upnp_event_sender/function ' + service.ifce.type + " " + widget.name + " " + msg.name);
- var i, pi, param_count = msg.num_params;
- var args = new Array();
- pi = 0;
- for (i = 0; i < param_count; i++) {
- var param = msg.get_param(i);
- if (param.is_input) continue;
- args[pi] = param.name;
- args[pi + 1] = widget.get_param_value(param);
- pi += 2;
- }
- log(l_inf, 'sending UPnP event ' + msg.name);
- service.CallAction(msg.name, args);
- };
-}
-
-function wmjs_upnp_action_response(service, widget, msg) {
- return function(value) {
- if (service.action == null) {
- // TODO this code avoids the bug that this function is called twice: find out why it is called twice!
- log(l_inf, 'wmjs_upnp_action_response/function DUPL(return) ' + service.ifce.type + " '" + widget.name + "' " + msg.name);
- return;
- }
- var i, pi, param_count = msg.num_params;
- var args = new Array();
- pi = 0;
- for (i = 0; i < param_count; i++) {
- var param = msg.get_param(i);
- if (param.is_input) continue;
- args[pi] = param.name;
- args[pi + 1] = widget.get_param_value(param);
- pi += 2;
- }
- log(l_inf, 'UPnP sending reply on action ' + service.action + ': ' + service.ifce.type + " '" + widget.name + "' " + msg.name);
- service.action.SendReply(args);
- service.action = null;
- };
-}
-
-
-function wmjs_upnp_action_response_script(service) {
- return function() {
- if (service.action == null) {
- // this code avoids the bug that this function is called twice: find out why it is called twice!
- return;
- }
- var i, pi, ai, param_count;
- var args = new Array();
- var msgHandler = arguments[0];
- var msg = service.ifce.get_message(msgHandler.msgName);
-
- pi = 0;
- ai = 1;
- for (i = 0; i < param_count; i++) {
- var param = msg.get_param(i);
- if (param.is_input) continue;
- args[pi] = param.name;
- args[pi + 1] = arguments[ai];
- pi += 2;
- ai++;
- }
- log(l_inf, 'UPnP sending reply on action ' + service.action);
- service.action.SendReply(args);
- service.action = null;
- };
-}
-
-
-function wmjs_create_upnp_service(widget, ifce) {
- var i, service, scpd, start_device = 0;
- var name;
-
- log(l_deb, 'widget device : ' + widget.device);
-
- /* at least one interface is a provider, so create a device - service or device names SHALL NOT CONTAIN SPACES*/
- name = widget.name.replace(whiteSpaceRegExp, '_');
- if (!widget.device) {
- //log(l_inf,'creating device');
- widget.device = UPnP.CreateDevice("urn:mpeg-u:device:provider-" + name + ":1", name);
- /* remember the widget in the device */
- widget.device.widget = widget;
- widget.device.enabled = 1;
- start_device = 1;
- /* implement the response to a external call (messageOut of another widget) */
- widget.device.OnAction = wmjs_widget_upnp_process_action;
- }
-
- /*service has already been created*/
- if (typeof(ifce.started) != 'undefined') return;
-
- log(l_inf, 'wmjs_create_upnp_service');
- scpd = wmjs_make_interface_scpd(widget, ifce);
- //log(l_inf, 'Service scpd ' + scpd);
- service = widget.device.SetupService(name, ifce.type, ifce.type + ".001", scpd);
- service.ifce = ifce;
-
- /* for each message in a provider interface */
- for (i = 0; i < ifce.num_messages; i++) {
- msg = ifce.get_message(i);
- /* if there is an output_trigger, a reply may be triggered after a call */
- if (msg.has_output_trigger) {
- if (msg.is_input) {
- /* output in an input message => this is a reply */
- var fun_name1 = 'respond_' + msg.name;
- widget[fun_name1] = wmjs_upnp_action_response(service, widget, msg);
- wmjs_bind_output_trigger(widget, msg, widget[fun_name1], service);
- } else {
- /* output in an output message => this is an event */
- var fun_name2 = 'send_event_' + msg.name;
- widget[fun_name2] = wmjs_upnp_event_sender(service, widget, msg);
- wmjs_bind_output_trigger(widget, msg, widget[fun_name2], service);
- }
- }
- /*if message is input, a reply may be sent*/
- else if (msg.is_input) {
- var j, has_out;
- has_out = 0;
- for (j = 0; j < msg.num_params; j++) {
- var param = msg.get_param(j);
- if (param.is_input) continue;
- has_out = 1;
- break;
- }
- if (has_out) {
- ifce.invokeReply = wmjs_upnp_action_response_script(service);
- }
- }
- }
- ifce.started = true;
-
- if (start_device) {
- //log(l_inf,"device start");
- widget.device.Start();
- }
-}
-
-
-/*
- END OF INTERFACE PUBLISHING AS UPNP SERVICES ROUTINES
- */
-
-/*********************************************************
- Start of implementation of core:in and core:out interfaces
- *********************************************************/
-
-coreIn = null, coreOut = null;
-
-//
-// function defining messages for the core:* interfaces implemented by the WM
-//
-function defineMessage(name, direction, executeFunction, params1, params2) {
- var msg = new Object();
- msg.name = name;
- msg.is_input = !direction; // the standard defines the point of view of the widget, not that of the WM
- msg.num_params = 0;
- // the executeFunction is the function implemented by widman.js and
- // which passes the buck to a function of the widget manager, if there is one
- if (executeFunction != null) msg.execute = executeFunction;
- // in a messageOut, params1 contains outputs and params2 contains inputs
- // in a messageIn, params1 contains inputs and params2 contains outputs
- if (direction) {
- if (params1 != null) {
- msg.paramsOut = params1;
- msg.num_params += params1.length;
- }
- if (params2 != null) {
- msg.paramsIn = params2;
- msg.num_params += params2.length;
- }
- } else {
- if (params1 != null) {
- msg.paramsIn = params1;
- msg.num_params += params1.length;
- }
- if (params2 != null) {
- msg.paramsOut = params2;
- msg.num_params += params2.length;
- }
- }
- //alert("Message defined: "+msg.name+' '+msg.num_params+' '+msg.is_input+' '+
- // (msg.paramsIn != null ? msg.paramsIn.length : 0)+' '+
- // (msg.paramsOut != null ? msg.paramsOut.length : 0));
- return msg;
-}
-
-//
-// function defining the parameter lists for messages
-// the direction of a parameter is implicit in its position in the paramsIn or paramsOut of a message
-//
-function defineParams() {
- var params = new Array();
- var i = 0;
- for (; i < arguments.length; i++) {
- params[i] = arguments[i];
- }
- return params;
-}
-
-//
-// get message by name in a core interface (core:in or core:out
-//
-function getMessage(core, s) {
- var i = 0;
- for (; i < core.length; i++) {
- if (core[i].name == s) return core[i];
- }
- return null;
-}
-
-//
-// get a parameter from a message by name
-//
-function hasParam(msg, name) {
- var i = 0;
- if (msg.paramsIn) {
- for (i = 0; i < msg.paramsIn.length; i++) {
- if (msg.paramsIn[i] == name) return true;
- }
- }
- if (msg.paramsOut) {
- for (i = 0; i < msg.paramsOut.length; i++) {
- if (msg.paramsOut[i] == name) return true;
- }
- }
- return false;
-}
-
-//
-// get a parameter from a message by index
-//
-/*function getParam(msg, i) {
- if (!msg.is_input) {
- if (msg.paramsIn) {
- if (i < msg.paramsIn.length) {
- return msg.paramsIn[i];
- } else {
- i -= msg.paramsIn.length;
- }
- }
- if (msg.paramsOut) {
- if (i < msg.paramsOut.length) {
- return msg.paramsOut[i];
- }
- }
- } else {
- if (msg.paramsOut) {
- if (i < msg.paramsOut.length) {
- return msg.paramsOut[i];
- } else {
- i -= msg.paramsOut.length;
- }
- }
- if (msg.paramsIn) {
- if (i < msg.paramsIn.length) {
- return msg.paramsIn[i];
- }
- }
- }
- return null;
-}*/
-
-//
-// get a parameter from a message by index
-//
-function getInputParam(msg, i) {
- if (!msg.is_input) {
- if (msg.paramsIn) {
- if (i < msg.paramsIn.length) {
- return msg.paramsIn[i];
- } else {
- return null;
- }
- }
- } else {
- if (msg.paramsOut) {
- if (i < msg.paramsOut.length) {
- return null;
- } else {
- i -= msg.paramsOut.length;
- }
- }
- if (msg.paramsIn) {
- if (i < msg.paramsIn.length) {
- return msg.paramsIn[i];
- }
- }
- }
- return null;
-}
-
-//
-// reconstruct the direction of a parameter of a message by its position
-//
-function paramDirection(msg, name) {
- var i = 0;
- if (msg.paramsIn) {
- for (i = 0; i < msg.paramsIn.length; i++) {
- if (msg.paramsIn[i] == name) return true;
- }
- }
- if (msg.paramsOut) {
- for (i = 0; i < msg.paramsOut.length; i++) {
- if (msg.paramsOut[i] == name) return false;
- }
- }
- return false;
-}
-
-function initCore() {
- /*
- Methods implementing messageIn of the core interfaces
- In these methods, this is the message and args is the list of arguments of the message
- widman.js, as the common part of all widget managers, does not implement these methods directly
- but passes the buck to specific WM implementations.
- In specific WM implementation, an initializer function should contain
- WidgetManager.coreOutSetSize = function (...) {...};
- or similar.
- */
- WidgetManager.coreOutSetSize = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.setSize" + argsString);
- };
-
- WidgetManager.coreOutShow = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.show" + argsString);
- };
-
- WidgetManager.coreOutHide = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.hide" + argsString);
- };
-
- WidgetManager.coreOutRequestActivate = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.requestActivate" + argsString);
- };
-
- WidgetManager.coreOutRequestDeactivate = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.requestDeactivate" + argsString);
- };
-
- WidgetManager.coreOutShowNotification = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.showNotification" + argsString);
- };
-
- WidgetManager.coreOutPlaceComponent = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.placeComponent" + argsString);
- };
-
- WidgetManager.coreOutGetAttention = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.getAttention" + argsString);
- };
- WidgetManager.coreOutInstallWidget = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.installWidget" + argsString);
- };
- WidgetManager.coreOutMigrateComponent = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.migrateComponent" + argsString);
- };
- WidgetManager.coreOutRequestMigrationTargets = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.requestMigrationTargets" + argsString);
- };
- WidgetManager.coreOutActivateTemporaryWidget = function(wid, args) {
- var i = 0, argsString = "";
- for (; i < args.length; i++) argsString += " " + args[i];
- log(l_deb, "*** defCoreOutImpl.activateTemporaryWidget" + argsString);
- };
- /*
- Define the core:* interfaces that the widget manager implements and provides to widgets
- The structure of messages is simplified.
- messageIn have first an array of paramsIn, then an array of paramsOut for a reply
- messageOut have first an array of paramsOut, then an array of paramsIn for reply
- Because of this simplification, getParam and defineMessage are dependent on the direction of the message
- The direction of a parameter is implicit in the fact that it is stored in paramsIn or paramsOut of the message
- */
- coreIn = new Array();
- coreOut = new Array();
- coreIn[0] = defineMessage("setSize", true, null, defineParams("width", "height", "dpi"));
- coreIn.setSizeMessage = coreIn[0];
- coreIn[1] = defineMessage("show", true, null);
- coreIn.showMessage = coreIn[1];
- coreIn[2] = defineMessage("hide", true, null);
- coreIn.hideMessage = coreIn[2];
- coreIn[3] = defineMessage("activate", true, null);
- coreIn.activateMessage = coreIn[3];
- coreIn[4] = defineMessage("deactivate", true, null);
- coreIn.deactivateMessage = coreIn[4];
- coreIn.type = "urn:mpeg:mpegu:schema:widgets:core:in:2010";
- coreOut[0] = defineMessage("setSize", false, coreOutSetSize, defineParams("width", "height"));
- coreOut.setSizeMessage = coreOut[0];
- coreOut[1] = defineMessage("show", false, coreOutShow);
- coreOut.showMessage = coreOut[1];
- coreOut[2] = defineMessage("hide", false, coreOutHide);
- coreOut.hideMessage = coreOut[2];
- coreOut[3] = defineMessage("requestActivate", false, coreOutRequestActivate, null,
- defineParams("returnCode"));
- coreOut.requestActivateMessage = coreOut[3];
- coreOut[4] = defineMessage("requestDeactivate", false, coreOutRequestDeactivate, null,
- defineParams("returnCode"));
- coreOut.requestDeactivateMessage = coreOut[4];
- coreOut[5] = defineMessage("showNotification", false, coreOutShowNotification,
- defineParams("message"), defineParams("returnCode"));
- coreOut.showNotificationMessage = coreOut[5];
- coreOut[6] = defineMessage("placeComponent", false, coreOutPlaceComponent,
- defineParams("componentID", "x", "y", "w", "h", "z-index", "transparency"),
- defineParams("returnCode"));
- coreOut.placeComponentMessage = coreOut[6];
- coreOut[7] = defineMessage("getAttention", false, coreOutGetAttention,
- null, defineParams("returnCode"));
- coreOut.getAttentionMessage = coreOut[7];
- coreOut[8] = defineMessage("installWidget", false, coreOutInstallWidget,
- defineParams("url"), defineParams("returnCode"));
- coreOut.installWidgetMessage = coreOut[8];
- coreOut[9] = defineMessage("migrateComponent", false, coreOutMigrateComponent,
- defineParams("componentId", "targetCode"), defineParams("returnCode"));
- coreOut.migrateComponentMessage = coreOut[9];
- coreOut[10] = defineMessage("requestMigrationTargets", false, coreOutRequestMigrationTargets,
- null, defineParams("targetCodes", "targetNames", "targetDescriptions"));
- coreOut.requestMigrationTargetsMessage = coreOut[10];
- coreOut[11] = defineMessage("activateTemporaryWidget", false, coreOutActivateTemporaryWidget,
- defineParams("url"), defineParams("returnCode"));
- coreOut.activateTemporaryWidget = coreOut[11];
- coreOut.type = "urn:mpeg:mpegu:schema:widgets:core:out:2010";
-}
-
-function coreOutRequestMigrationTargets(wid, args) {
- WidgetManager.coreOutRequestMigrationTargets(wid, args);
-}
-
-function coreOutSetSize(wid, args) {
- WidgetManager.coreOutSetSize(wid, args);
-}
-
-function coreOutShow(wid, args) {
- WidgetManager.coreOutShow(wid, args);
-}
-
-function coreOutHide(wid, args) {
- WidgetManager.coreOutHide(wid, args);
-}
-
-function coreOutRequestActivate(wid, args) {
- WidgetManager.coreOutRequestActivate(wid, args);
-}
-
-function coreOutRequestDeactivate(wid, args) {
- WidgetManager.coreOutRequestDeactivate(wid, args);
-}
-
-function coreOutShowNotification(wid, args) {
- WidgetManager.coreOutShowNotification(wid, args);
-}
-
-function coreOutPlaceComponent(wid, args) {
- WidgetManager.coreOutPlaceComponent(wid, args);
-}
-
-function coreOutGetAttention(wid, args) {
- WidgetManager.coreOutGetAttention(wid, args);
-}
-
-function coreOutInstallWidget(wid, args) {
- WidgetManager.coreOutInstallWidget(wid, args);
-}
-
-function coreOutActivateTemporaryWidget(wid, args) {
- WidgetManager.coreOutActivateTemporaryWidget(wid, args);
-}
-
-function coreOutMigrateComponent(wid, args) {
- WidgetManager.coreOutMigrateComponent(wid, args);
-}
-
-/*
- Methods of binding and callback of core:* interfaces
- */
-function wmjs_interface_invoke_callback_core(wid_src, ifce_dst, is_reply) {
- log(l_inf, "wmjs_interface_invoke_callback_core '" + ifce_dst.type + "' - reply " + is_reply);
- return function() {
- var i, ai = 0, param_count, msgHandler, msg_src, msg_dst;
- var args = new Array();
- msgHandler = arguments[0];
- /*get msg from source interface (this object)*/
- msg_src = this.get_message(msgHandler.msgName);
- msg_dst = getMessage(ifce_dst, msgHandler.msgName);
- //var argstring = "";
- //for (i = 0; i < msg_dst.num_params; i++) argstring += " "+getParam(msg_dst, i);
- //log(l_inf, argstring);
- //log(l_inf, (is_reply ? 'invokeReply ' : 'invoke ') + msg_src.name + ' on core.' + msg_dst.name + " nbpar:"+msg_src.num_params);
- param_count = msg_src.num_params;
- for (i = 0; i < param_count; i++) {
- var param = getInputParam(msg_dst, i);
- if (param == null) continue;
- args[ai] = arguments[ai+1];
- ai++;
- }
- log(l_inf, (is_reply ? 'invokeReply ' : 'invoke ') + msg_src.name + ' on core.' + msg_dst.name + " nb:"+ai);
- // call the method that implements the core:* message
- msg_dst.execute(wid_src, args);
- };
-}
-
-// function invokeReply for a reply from within a coreOut message
-function wmjs_core_out_invoke_reply() {
- var i, ai, param_count, is_script, msg_src, msg_dst, wid_dst;
- var args = new Array();
- is_script = 0;
- msg_src = arguments[0];
- msg_dst = arguments[1];
- wid_dst = arguments[2];
- log(l_inf, 'coreOut/invokeReply ' + msg_src.name + ' on core.' + msg_dst.name + ' to ' +wid_dst.name+ " nb:"+ai);
- if (msg_dst.has_script_input) is_script = 1;
- param_count = msg_src.num_params;
- ai = 3;
- for (i = 0; i < param_count; i++) {
- var param = msg_dst.get_param(i);
- if (! param.is_input) continue;
- if (is_script) {
- args[ai - 3] = arguments[ai];
- } else {
- wid_dst.set_input(param, arguments[ai]);
- }
- ai++;
- }
- if (msg_dst.has_input_action) {
- wid_dst.call_input_action(msg_dst);
- } else if (is_script) {
- wid_dst.call_input_script(msg_dst, args);
- }
-}
-
-// get an interface by type in WidgetManager, since getInterfaceHandlersByType is not accessible
-function getInterfaceByType(widget, type) {
- for (var i = 0; i < widget.num_interfaces; i++) {
- var ifce = widget.get_interface(i);
- if (ifce.type == type) return ifce;
- }
- return null;
-}
-
-function wmjs_bind_interface_to_core_service(wid, ifce) {
- if (ifce.type == "urn:mpeg:mpegu:schema:widgets:core:in:2010") {
- // core:in
- return wmjs_bind_interface_to_core_service1(wid, ifce, coreIn);
- } else if (ifce.type == "urn:mpeg:mpegu:schema:widgets:core:out:2010") {
- // core:out
- return wmjs_bind_interface_to_core_service1(wid, ifce, coreOut);
- }
- // not an interface to core services
- return false;
-}
-
-function wmjs_bind_interface_to_core_service1(wid, ifce, core) {
- // loop on the messages to check if they match
- log(l_inf, 'Bind interface to core service ' + wid.name + " " + ifce.type);
- var set_bind = 0, nb_ok, j, k, a_msg;
- for (j = 0; j < ifce.num_messages; j++) {
- var msg = ifce.get_message(j);
- // does the other interface have this message
- a_msg = getMessage(core, msg.name);
- if (!a_msg) {
- // no, it does not have this message, so leave
- log(l_inf, 'No core message for ' + msg.name);
- continue;
- }
- // the messages have matching names, check direction
- if (msg.is_input == a_msg.is_input) {
- log(l_inf, 'core message for ' + msg.name + ' is not in direction ' + (msg.is_input ? 'output' : 'input'));
- continue;
- }
- // the messages have matching names and directions, check params
- if (msg.num_params != a_msg.num_params) {
- log(l_war, 'core message ' + msg.name + ' does not have the same number of parameters '
- + msg.num_params + ' ' + a_msg.num_params);
- var paramstring = "";
- for (k = 0; k < msg.num_params; k++) {
- par = msg.get_param(k);
- paramstring += " " + par.name;
- }
- log(l_deb, paramstring);
- continue;
- }
- /*check all params*/
- nb_ok = 0;
- for (k = 0; k < msg.num_params; k++) {
- par = msg.get_param(k);
- //log(l_inf, " "+par.name+" "+hasParam(a_msg, par.name)+" "+par.is_input+" "+paramDirection(a_msg, par.name));
- if (hasParam(a_msg, par.name) != null && par.is_input != paramDirection(a_msg, par.name)) nb_ok ++;
- }
- if (nb_ok != msg.num_params) {
- log(l_war, 'core message ' + msg.name + ' does not have the same input/output parameters '+nb_ok+" "+msg.num_params);
- continue;
- }
- set_bind ++;
- // the messages match
- log(l_inf, 'Binding ' + wid.name + '.' + msg.name + ' to core.' + a_msg.name);
- /*OK let's bind this action: we only need to assign the output trigger, the input
- action will be called from the other widget*/
- if (msg.has_output_trigger) {
- wmjs_bind_output_trigger(wid, msg, wmjs_output_trigger_callback_core(msg, wid, a_msg), WidgetManager);
- }
- }
- if (!set_bind) return false;
- /*create callback for programmatic action triggers*/
- ifce.invoke = wmjs_interface_invoke_callback_core(wid, core, 0);
- // ifce.invokeReply = wmjs_interface_invoke_callback_core(wid, core, 1);
- wid.bind_interface(ifce, null, 'localhost');
- return true;
-}
-
-function wmjs_output_trigger_callback_core(msg_out, wid_src, msg_in) {
- log(l_deb, "wmjs_output_trigger_callback_core");
- return function() {
- log(l_deb, "wmjs_output_trigger_callback_core/function '" + wid_src.name + "'");
- var param_count = msg_out.num_params;
- var args = new Array();
- var ai = 0, i;
- log(l_inf, 'Invoking Widget(' + wid_src.name + ').' + msg_out.name);
- for (i = 0; i < param_count; i++) {
- var param = msg_out.get_param(i);
- if (param.is_input) continue;
- args[ai] = wid_src.get_param_value(param);
- ai++;
- }
- msg_in.execute(wid_src, args);
- };
-}
-
-
-//
-// send a core:in message with no parameter
-//
-function wmjs_corein_message() {
- if (arguments.length < 2) return;
- var widget = arguments[0];
- var message = arguments[1];
-
- for (var i=0; i<widget.num_interfaces; i++) {
- var ifce = widget.get_interface(i);
- if (ifce.type != 'urn:mpeg:mpegu:schema:widgets:core:in:2010') continue;
-
- for (var j=0; j<ifce.num_messages; j++) {
- var msg = ifce.get_message(j);
- if (msg.name == message) {
- if (msg.has_script_input) {
- var jsargs = new Array();
- /*for each input descibed in the manifest, get the input script value and stack it in the argument list*/
- for (var k=0; k<msg.num_params; k++) {
- par = msg.get_param(k);
- if (!par.is_input) continue;
- for (var l=2; l<arguments.length; l+=2) {
- if (arguments[l]==par.name) {
- jsargs.push(arguments[l+1]);
- break;
- }
- }
- }
- widget.call_input_script(msg, jsargs);
- } else if (msg.has_input_action) {
- /*for each input descibed in the manifest, set the widget input value*/
- for (var k=0; k<msg.num_params; k++) {
- par = msg.get_param(k);
- if (!par.is_input) continue;
- for (var l=2; l<arguments.length; l+=2) {
- if (arguments[l]==par.name) {
- widget.set_input(par, arguments[l+1]);
- break;
- }
- }
- }
- widget.call_input_action(msg);
- }
- }
- }
- }
-}
-
-/*
- End of implementation of core:in and core:out interfaces
- */
+++ /dev/null
-#######################################################################################
-# Hardcoded PROTO node which displays object without taking into account user transforms
-#######################################################################################
-EXTERNPROTO Untransform [
- exposedField MFNode children []
-]
-[ "urn:inet:gpac:builtin:Untransform"]
-
-
-
-#######################################################################################
-# Main Scene
-#######################################################################################
-
-DEF GPAC_UI OrderedGroup {
- children [
- Background2D { backColor 1 1 1}
-
- DEF UI_ROOT Untransform {
- children [
- ]
- }
-
- DEF GUIScript Script {
- field SFNode root USE GPAC_UI
- field SFNode ui_root USE UI_ROOT
-
- url "mpegu-wm.js"
- }
- ]
-}
+++ /dev/null
-//This software module was originally developed by Telecom Paris in the
-//course of the development of MPEG-U Widgets (ISO/IEC 23007-1) standard.
-//
-//This software module is an implementation of a part of one or
-//more MPEG-U Widgets (ISO/IEC 23007-1) tools as specified by the MPEG-U Widgets
-//(ISO/IEC 23007-1) standard. ISO/IEC gives users of the MPEG-U Widgets
-//(ISO/IEC 23007-1) free license to this software module or modifications
-//thereof for use in hardware or software products claiming conformance to
-//the MPEG-U Widgets (ISO/IEC 23007-1). Those intending to use this software
-//module in hardware or software products are advised that its use may
-//infringe existing patents.
-//The original developer of this software module and his/her company, the
-//subsequent editors and their companies, and ISO/IEC have no liability
-//for use of this software module or modifications thereof in an implementation.
-//Copyright is not released for non MPEG-U Widgets (ISO/IEC 23007-1) conforming
-//products.
-//Telecom Paris retains full right to use the code for his/her own purpose,
-//assign or donate the code to a third party and to inhibit third parties from
-//using the code for non MPEG-U Widgets (ISO/IEC 23007-1) conforming products.
-//
-//This copyright notice must be included in all copies or derivative works.
-//
-//Copyright (c) 2009.
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////
-//
-// Authors:
-// Jean Le Feuvre, (c) 2007-2010 Telecom Paris
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-// 01122011 AMD1 startWidget implemented
-// TODO AMD1 listWidgets getWidget requestCapabilitiesList
-
-//Initialize the main UI script
-function initialize() {
- //var icon;
- var i, count, wid;
-
- scene.caption = 'MPEG-U @ Osmo4';
-
- display_width = parseInt(scene.get_option('Widgets', 'LastWMWidth'));
- display_height = parseInt(scene.get_option('Widgets', 'LastWMHeight'));
-
- if (display_width && display_height) {
- scene.set_size(display_width, display_height);
- } else {
- display_width = scene.screen_width;
- display_height = scene.screen_height;
- }
-
- //request event listeners on the window - GPAC specific extensions !!!
- root.addEventListener('resize', on_resize, 0);
- root.addEventListener('zoom', on_zoom, 0);
- root.addEventListener('scroll', on_scroll, 0);
-
- widget_default_size = 200;
- scene_width = 0;
-
- wctl_iconsize = new SFVec2f(24, 24);
- icon_size = 48;
- dock_height = 48;
- info_height = 32;
- toggle_bar_height = 16;
- screen_dpi = scene.get_horizontal_dpi();
-
- widget_remote_candidate = null;
- has_upnp = eval("(typeof(UPnP) != 'undefined');");
- if (has_upnp) {
- UPnP.onMediaRendererAdd = onMediaRendererAdd;
- UPnP.onMediaConnect = onMediaConnect;
- UPnP.BindRenderer();
- upnp_renders = null;
- }
-
- /*setup dock*/
- widget_screen_visible = false;
-
- /*widget subtree*/
- widget_display = new SFNode('Transform2D');
- ui_root.children[0] = widget_display;
-
- /*widget manager page*/
- widget_screen = new SFNode('Layer2D');
- ui_root.children[1] = widget_screen;
-
- /*all other UI elements subtree*/
- dlg_display = new SFNode('Transform2D');
- ui_root.children[2] = dlg_display;
-
- infobar = text_label('', 'MIDDLE');
- ui_root.children[3] = infobar;
-
- /*our dock*/
- dock = new SFNode('Transform2D');
- ui_root.children[4] = dock;
-
- /*init the widget manager*/
- Browser.loadScript('mpegu-core.js', true);
- log_level = l_inf;
- widget_manager_init();
-
- WidgetManager.on_widget_remove = widget_remove;
- WidgetManager.on_widget_add = widget_insert;
- WidgetManager.coreOutSetSize = widget_request_size;
- WidgetManager.coreOutShow = widget_request_show;
- WidgetManager.coreOutHide = widget_request_hide;
- WidgetManager.coreOutRequestActivate = widget_request_activate;
- WidgetManager.coreOutRequestDeactivate = widget_request_deactivate;
- WidgetManager.coreOutShowNotification = widget_request_notification;
- WidgetManager.coreOutPlaceComponent = widget_place_component;
- WidgetManager.coreOutGetAttention = widget_request_attention;
- WidgetManager.coreOutInstallWidget = widget_install_widget;
- WidgetManager.coreOutMigrateComponent = widget_migrate_component;
- WidgetManager.coreOutRequestMigrationTargets = widget_request_migration_targets;
-
- nb_widgets_on_screen = 0;
- first_visible_widget = 0;
- setup_icons();
-
- /*restore our widgets*/
- widgets_init();
-
- //let's do the layout
- layout();
-}
-
-function new_timeout(time)
-{
- var obj = new SFNode('TimeSensor');
-
- obj.cycleInterval = time;
- obj.start = function(when) {
- var t = this.getTime();
- this.startTime = when + this.getTime();
- };
- obj.stop = function(when) {
- this.stopTime = when + this.getTime();
- };
- obj.on_event = null;
- obj.event = function(val) {
- if (this.on_event) this.on_event(val);
- };
- Browser.addRoute(obj, 'fraction_changed', obj, obj.event);
- return obj;
-}
-
-function rectangle()
-{
- var obj = new SFNode('Shape');
-
- obj.appearance = new SFNode('Appearance');
- obj.appearance.material = new SFNode('Material2D');
- obj.appearance.material.filled = TRUE;
- obj.appearance.material.emissiveColor = new SFColor(0.7, 0.7, 0.8);
- obj.appearance.material.lineProps = new SFNode('LineProperties');
- obj.appearance.material.lineProps.width = 2;
- obj.appearance.material.lineProps.lineColor = new SFColor(0, 0, 0);
-
- obj.geometry = new SFNode('Curve2D');
- obj.geometry.point = new SFNode('Coordinate2D');
- temp = obj.geometry.type;
- temp[0] = 7;
- temp[1] = 1;
- temp[2] = 7;
- temp[3] = 1;
- temp[4] = 7;
- temp[5] = 1;
- temp[6] = 7;
- temp[7] = 6;/*close*/
-
- obj.set_size = function(w, h) {
- var hw, hh, rx, ry;
- var temp;
- hw = w/2;
- hh = h/2;
-
- /*compute default rx/ry*/
- ry = rx = 10;
- if ( (2*rx>=hw) || (2*ry>=hh)) rx = ry = 6;
-
- temp = this.geometry.point.point;
- temp[0] = new SFVec2f(hw-rx, hh);
- temp[1] = new SFVec2f(hw, hh);/*bezier ctrl point*/
- temp[2] = new SFVec2f(hw, hh-ry);
- temp[3] = new SFVec2f(hw, -hh+ry);
- temp[4] = new SFVec2f(hw, -hh);/*bezier control point*/
- temp[5] = new SFVec2f(hw-rx, -hh);
- temp[6] = new SFVec2f(-hw+rx, -hh);
- temp[7] = new SFVec2f(-hw, -hh);/*bezier control point*/
- temp[8] = new SFVec2f(-hw, -hh+ry);
- temp[9] = new SFVec2f(-hw, hh-ry);
- temp[10] = new SFVec2f(-hw, hh);/*bezier control point*/
- temp[11] = new SFVec2f(-hw+rx, hh);
- };
- obj.set_color = function(r, g, b) {
- this.appearance.material.emissiveColor.r = r;
- this.appearance.material.emissiveColor.g = g;
- this.appearance.material.emissiveColor.b = b;
- };
- return obj;
-}
-
-function icon_button(url, label, no_back)
-{
- var obj = new SFNode('Transform2D');
- obj.children[0] = new SFNode('Transform2D');
- obj.children[0].scale.x = 0;
- obj.children[0].children[0] = rectangle();
-
- obj.children[1] = new SFNode('Layer2D');
- obj.children[1].size.x = icon_size;
- obj.children[1].size.y = icon_size;
- obj.children[1].children[0] = new SFNode('Inline');
- obj.children[1].children[0].url[0] = url;
-
- obj.touch = new SFNode('TouchSensor');
- obj.children[1].children[1] = obj.touch;
- obj.button_click = NULL;
- obj.down = false;
- obj.over = false;
- obj.on_active = function(value) {
- if (value) {
- this.down = true;
- } else {
- if (this.down && this.over && this.button_click) this.button_click();
- this.down = false;
- }
- };
- obj.button_over = on_icon_over;
- obj.on_over = function(value) {
- this.over = value;
- if (!no_back)
- this.children[0].scale.x = value ? 1 : 0;
- if (this.button_over) this.button_over(value);
- };
- Browser.addRoute(obj.touch, 'isOver', obj, obj.on_over);
- Browser.addRoute(obj.touch, 'isActive', obj, obj.on_active);
- obj.label = label;
- obj.hide = function() { this.scale.x = this.scale.y = 0;};
- obj.show = function() { this.scale.x = this.scale.y = 1;};
- obj.set_size = function(x, y) {
- this.children[0].children[0].set_size(x, y);
- this.children[1].size.x = x;
- this.children[1].size.y = y;
- };
- return obj;
-}
-
-function text_label(label, justify)
-{
- var obj = new SFNode('Transform2D');
- obj.children[0] = new SFNode('Shape');
- obj.children[0].appearance = new SFNode('Appearance');
- obj.children[0].appearance.material = new SFNode('Material2D');
- obj.children[0].appearance.material.filled = TRUE;
- obj.children[0].appearance.material.emissiveColor = new SFColor(0, 0, 0);
- obj.children[0].geometry = new SFNode('Text');
- obj.children[0].geometry.string[0] = label;
- obj.children[0].geometry.fontStyle = new SFNode('FontStyle');
- obj.children[0].geometry.fontStyle.justify[0] = justify;
- obj.children[0].geometry.fontStyle.justify[1] = 'MIDDLE';
- obj.children[0].geometry.fontStyle.size = 20;
- obj.set_label = function(value) {
- this.children[0].geometry.string[0] = value;
- };
- return obj;
-}
-
-
-function text_rect(label)
-{
- var obj = new SFNode('Transform2D');
- obj.children[0] = rectangle();
- obj.children[0].set_color(0.7, 0.7, 0.8);
-
- obj.children[1] = new SFNode('Shape');
- obj.children[1].appearance = new SFNode('Appearance');
- obj.children[1].appearance.material = new SFNode('Material2D');
- obj.children[1].appearance.material.filled = TRUE;
- obj.children[1].appearance.material.emissiveColor = new SFColor(0, 0, 0);
- obj.children[1].geometry = new SFNode('Text');
- obj.children[1].geometry.string[0] = label;
- obj.children[1].geometry.fontStyle = new SFNode('FontStyle');
- obj.children[1].geometry.fontStyle.justify[0] = 'MIDDLE';
- obj.children[1].geometry.fontStyle.justify[1] = 'MIDDLE';
- obj.children[1].geometry.fontStyle.size = 20;
- obj.children[2] = new SFNode('TouchSensor');
-
- obj.set_size = function(w, h) {
- this.children[0].set_size(w, h);
- };
-
-
- obj.over = false;
- obj.on_over = function(value) {
- this.children[0].set_color(0.7, value ? 0.5 : 0.7, 0.8);
- this.over = value;
- };
- Browser.addRoute(obj.children[2], 'isOver', obj, obj.on_over);
-
- obj.down = false;
- obj.button_click = null;
- obj.on_active = function(value) {
- if (value) {
- this.down = true;
- } else {
- if (this.down && this.over && this.button_click) this.button_click();
- this.down = false;
- }
- };
- Browser.addRoute(obj.children[2], 'isActive', obj, obj.on_active);
-
- return obj;
-}
-
-function new_widget_control(widget)
-{
- var obj = new SFNode('Transform2D');
-
- obj.children[0] = new SFNode('Transform2D');
-
- obj.children[0].children[0] = rectangle();
-
- obj.children[0].children[1] = new SFNode('TouchSensor');
-
-
- obj.component_bound=false;
- obj.show_ctrl = true;
- obj.onClick = function(value) {
- if (!value) return;
- this.show_ctrl = !this.show_ctrl;
- if (this.show_ctrl) {
- var i, comps, idx;
- this.children[0].children[0].appearance.material.transparency = 0;
- this.children[1].scale.x = 1;
- this.children[3].scale.x = 1;
-
- for (i=0; i<widget_display.children.length; i++) {
- if (widget_display.children[i]==this) continue;
- if (widget_display.children[i].show_ctrl) {
- widget_display.children[i].onClick(true);
- }
- }
- //widget is a component, do not push on top but hide some controls
- if (widget.is_component) {
- if (this.component_bound) {
- this.children[1].children[0].hide(); //close
- this.children[1].children[1].hide(); //remove
- this.children[1].children[4].hide(); //resize
- }
- return;
- }
- //otherwise push widget on top
- idx=0;
- widget_display.removeChildren[idx++] = this;
- widget_display.addChildren[idx++] = this;
- //and push components
- comps = widget.components;
- for (i=0; i<comps.length; i++) {
- if (comps[i].widget_control.component_bound) {
- widget_display.removeChildren[idx++] = comps[i].widget_control;
- widget_display.addChildren[idx++] = comps[i].widget_control;
- }
- }
-
- } else {
- this.children[0].children[0].appearance.material.transparency = 1;
- this.children[1].scale.x = 0;
- this.children[3].scale.x = 0;
- }
- };
- Browser.addRoute(obj.children[0].children[1], 'isActive', obj, obj.onClick);
-
- obj.children[1] = new SFNode('Transform2D');
- obj.children[1].children[0] = icon_button('icons/process-stop.svg', 'Close', 0);
- obj.children[1].children[0].button_click = function() {
- if (widget.discardable) widget_remove(widget);
- else widget_close(widget, 0);
- };
-
- obj.children[1].children[1] = icon_button('icons/user-trash.svg', 'Uninstall', 0);
- obj.children[1].children[1].button_click = function() { widget_remove(widget); }
-
- obj.children[1].children[2] = icon_button('icons/applications-internet.svg', 'Push to remote display', 0);
- obj.children[1].children[2].button_click = function() {
- if (has_upnp && UPnP.MediaRenderersCount) {
- widget_remote_candidate = widget;
- on_upnpopen();
- }
- };
-
- obj.children[1].children[3] = icon_button('icons/dialog-information.svg', 'Widget Information', 0);
- obj.children[1].children[3].button_click = function() {
- display_widget_info(widget);
- };
-
- obj.children[1].children[4] = icon_button('icons/media-record.svg', 'Resize', 1);
- obj.children[1].children[4].children[1].children[2] = new SFNode('PlaneSensor2D');
- obj.children[1].children[4].children[1].children[2].maxPosition = new SFVec2f(-1, -1);
-
- obj.prev_x=0;
- obj.prev_y=0;
- obj.onSize = function(value) {
- if (widget.width + 2*(value.x - this.prev_x)<0) return;
- if (widget.height + 2*(this.prev_y-value.y)<0) return;
-
- widget.width += 2*(value.x - this.prev_x);
- this.prev_x = value.x;
- widget.height += 2*(this.prev_y - value.y);
- this.prev_y = value.y;
- this.set_size(widget.width, widget.height);
- };
- Browser.addRoute(obj.children[1].children[4].children[1].children[2], 'translation_changed', obj, obj.onSize);
-
- obj.children[2] = new SFNode('Layer2D');
- obj.inline = new SFNode('Inline');
- obj.children[2].children[0] = obj.inline;
-
-
- obj.children[3] = new SFNode('Transform2D');
- obj.children[3].children[0] = new SFNode('Shape');
- obj.children[3].children[0].appearance = new SFNode('Appearance');
- obj.children[3].children[0].appearance.material = new SFNode('Material2D');
- obj.children[3].children[0].appearance.material.filled = TRUE;
- obj.children[3].children[0].appearance.material.transparency = 0.5;
- obj.children[3].children[0].appearance.material.emissiveColor = new SFColor(0.6, 0.6, 0.6);
- obj.children[3].children[0].geometry = new SFNode('Rectangle');
- obj.children[3].children[0].geometry.size = new SFVec2f(50, 50);
- obj.children[3].children[1] = new SFNode('PlaneSensor2D');
- obj.children[3].children[1].maxPosition = new SFVec2f(-1, -1);
- obj.children[3].children[1].offset = new SFVec2f(widget.x, widget.y);
- obj.onMove = function(value) {
- if (this.maximized) return;
- this.translation = value;
- widget.x = value.x;
- widget.y = value.y;
- this.refresh_layout(false, null);
- };
- Browser.addRoute(obj.children[3].children[1], 'translation_changed', obj, obj.onMove);
-
- obj.children[3].children[2] = new SFNode('TouchSensor');
- obj.last_ts = 0;
- obj.onMaximize = function(value, timestamp) {
- if (!value) return;
- if (timestamp - this.last_ts < 0.5) {
- if (this.maximized) {
- this.maximized = false;
- this.translation.x = widget.x;
- this.translation.y = widget.y;
- this.set_size(this.prev_width, this.prev_height);
- } else {
- this.maximized = true;
- this.prev_width = widget.width;
- this.prev_height = widget.height;
- this.translation.x = 0;
- this.translation.y = -info_height;
- this.set_size(display_width, display_height - 2*info_height);
- }
- }
- this.last_ts = timestamp;
- };
- Browser.addRoute(obj.children[3].children[2], 'isActive', obj, obj.onMaximize);
-
- obj.set_size = function(w, h) {
- var i, x, s;
- s = 24;
- this.children[2].size.x = w;
- this.children[2].size.y = h;
-
- this.children[1].children[0].translation.y = this.children[1].children[1].translation.y = this.children[1].children[2].translation.y = this.children[1].children[3].translation.y = this.children[1].children[4].translation.y = h/2 + s/2;
-
- this.children[0].children[0].set_size(w+s, h+s);
- this.children[3].children[0].geometry.size.x = w;
- this.children[3].children[0].geometry.size.y = h;
-
- this.children[1].children[0].set_size(s, s);
- this.children[1].children[1].set_size(s, s);
- this.children[1].children[2].set_size(s, s);
- this.children[1].children[3].set_size(s, s);
- this.children[1].children[4].set_size(s, s);
- this.children[1].children[0].translation.x = -w/2;
- this.children[1].children[1].translation.x = -w/4;
- this.children[1].children[2].translation.x = 0;
- this.children[1].children[3].translation.x = w/4;
- this.children[1].children[4].translation.x = w/2;
-
- //set widget input params
- widget.width = w;
- widget.height = h;
- widget.set_input('width', w);
- widget.set_input('height', h);
- this.refresh_layout(true, null);
- //call core:in
- WidgetManager.corein_message(widget, 'setSize', 'width', w, 'height', w, 'dpi', screen_dpi);
- };
- obj.refresh_layout = function(send_resize, comp_target) {
- var i;
- var x, y, w, h, scale_x, scale_y;
- var comps;
-
- /*local to subscene transformation not known*/
- if (!this.sub_w) return;
- if (!this.sub_h) return;
-
- comps = widget.components;
- for (i=0; i<comps.length; i++) {
- var comp = comps[i];
- if (!comp.widget_control.component_bound) continue;
-
- //compute scale from Widget Manager coord system to widget internal coordinate system
- scale_x = this.sub_vp_w / this.sub_w;
- scale_y = this.sub_vp_h / this.sub_h;
-
- w = comp.widget_control.place_w * scale_x;
- h = comp.widget_control.place_h * scale_y;
-
- x = this.translation.x - widget.width/2 + this.sub_vp_x + comp.widget_control.place_x * scale_x + w/2;
- comp.widget_control.translation.x = x;
-
- y = widget.height/2 + this.translation.y - h/2 - this.sub_vp_y - comp.widget_control.place_y * scale_y;
- comp.widget_control.translation.y = y;
-
- if (send_resize || (comp_target==comp))
- comp.widget_control.set_size(w, h);
- }
- };
-
- obj.hide = function() {
- this.scale.x = 0;
- WidgetManager.corein_message(widget, 'hide');
- };
- obj.show = function() {
- this.scale.x = 1;
- WidgetManager.corein_message(widget, 'show');
- };
-
- obj.show_remote = function () {
- if (WidgetManager.upnp && UPnP.MediaRenderersCount) {
- this.children[1].children[2].show();
- } else {
- this.children[1].children[2].hide();
- }
- };
- obj.show_remove = function(show) {
- if (show) this.children[1].children[1].show();
- else this.children[1].children[1].hide();
- };
-
- obj.flash = function() {
- var time = new_timeout(0.25);
- time.loop = true;
- time.ctrl = this;
- time.on_event = function(val) {
- var scale = (val<0.5) ? 1+val : 2-val;
- this.ctrl.scale.x = this.ctrl.scale.y = scale;
- };
- time.stop(1);
- time.start(0);
- };
- obj.maximized = false;
- obj.show_remote();
- obj.onClick(true);
- return obj;
-}
-
-
-
-function on_icon_over(value)
-{
- infobar.set_label(value ? this.label : '');
-}
-
-function display_widget_info(wid)
-{
- var info_dlg = new SFNode('Transform2D');
- var i, j, k, info;
- var y, txt, pref;
-
- infobar.set_label('Widget ' + wid.name + ' Information');
-
- info = text_rect('Close');
- info_dlg.children[0] = info;
- info.button_click = function() {
- dlg_display.children.length = 0;
- widget_display.scale.x = 1;
- infobar.set_label('');
- layout();
- };
-
- info = text_rect('Widget Metadata');
- info_dlg.children[info_dlg.children.length] = info;
- info.visible = false;
- info.button_click = function() {
- this.visible = !this.visible;
- layout();
- };
- i=3;
- info.children[i++] = text_label('id: ' + wid.identifier + ' - shortname: '+wid.shortName + ' - name: '+wid.name, 'BEGIN');
- info.children[i++] = text_label('version: '+wid.version, 'BEGIN');
- info.children[i++] = text_label('content type: ' + wid.mainMimeType + ' - content encoding: '+wid.mainEncoding, 'BEGIN');
- info.children[i++] = text_label('default size: Width = ' + wid.defaultWidth + ' Height = '+wid.defaultHeight, 'BEGIN');
- info.children[i++] = text_label('license: '+wid.license, 'BEGIN');
- info.children[i++] = text_label('license ref: '+wid.licenseHref, 'BEGIN');
- info.children[i++] = text_label('description: '+wid.description, 'BEGIN');
- info.children[i++] = text_label('author name: '+wid.authorName + ' (mail: '+wid.authorEmail+')', 'BEGIN');
- info.children[i++] = text_label('author href: '+wid.authorHref, 'BEGIN');
- info.children[i++] = text_label('view modes: '+wid.viewmodes, 'BEGIN');
- info.children[i++] = text_label('UUID: '+wid.uuid, 'BEGIN');
- info.children[i++] = text_label('Discardable: '+wid.discardable, 'BEGIN');
- info.children[i++] = text_label('Muliple Instances: '+wid.discardable, 'BEGIN');
- var icons = wid.icons;
- for (j=0; j<icons.length; j++) {
- info.children[i++] = text_label('icon #'+(j+1)+': ' + icons[j].src, 'BEGIN');
- }
-
- info = text_rect('Widget Manager Info');
- info_dlg.children[info_dlg.children.length] = info;
- info.visible = false;
- info.button_click = function() {
- this.visible = !this.visible;
- layout();
- };
- i=3;
- info.children[i++] = text_label('nb instances: '+wid.num_instances + ' nb components: '+wid.num_components, 'BEGIN' );
- info.children[i++] = text_label('Permanently installed: '+wid.permanent + ' - is component: '+wid.is_component, 'BEGIN' );
- if (wid.is_component) {
- info.children[i++] = text_label('parent widget name' + wid.parent.name, 'BEGIN');
- }
- if (wid.originating_device_ip) {
- info.children[i++] = text_label('Widget was pushed from device IP '+wid.originating_device_ip, 'BEGIN' );
- }
- info.children[i++] = text_label('Section name in GPAC config file: '+wid.section, 'BEGIN' );
- info.children[i++] = text_label('UA Locale: ' + scene.get_option('core', 'lang'), 'BEGIN');
- info.children[i++] = text_label('widget src: ' + wid.url , 'BEGIN');
- info.children[i++] = text_label('config src: ' + wid.manifest , 'BEGIN');
- info.children[i++] = text_label('content src : '+wid.localizedSrc, 'BEGIN' );
-
- pref = wid.features;
- info = text_rect('Features (' + pref.length + ')' );
- info_dlg.children[info_dlg.children.length] = info;
- info.visible = false;
- info.button_click = function() {
- this.visible = !this.visible;
- layout();
- };
- i=3;
- for (j=0; j<pref.length; j++) {
- info.children[i++] = text_label('Feature #'+(j+1)+' name=\''+pref[j].name+'\' required=\''+pref[j].required+'\'', 'BEGIN');
- }
-
-
- pref = wid.preferences;
- info = text_rect('Preferences ('+pref.length+')');
- info_dlg.children[info_dlg.children.length] = info;
- info.visible = false;
- info.button_click = function() {
- this.visible = !this.visible;
- layout();
- };
- i=3;
- for (j=0; j<pref.length; j++) {
- var val = pref[j].value;
- if (val == '') val = scene.get_option(wid.section, pref[j].name);
- info.children[i++] = text_label('Preference #'+(j+1)+' name=\''+pref[j].name+'\' value=\''+val+'\' readOnly=\''+pref[j].readonly +'\'', 'BEGIN');
- }
-
- info = text_rect('Migration Context', 'BEGIN');
- info_dlg.children[info_dlg.children.length] = info;
- info.visible = false;
- info.button_click = function() {
- this.visible = !this.visible;
- layout();
- };
- i=3;
- txt=wid.get_context();
- while (1) {
- var idx = txt.indexOf('\n', 0);
- if (idx>0) {
- info.children[i++] = text_label(txt.substring(0, idx), 'BEGIN');
- txt = txt.substring(idx+1, txt.length);
- } else {
- info.children[i++] = text_label(txt, 'BEGIN');
- break;
- }
- }
-
- info_dlg.ifce_idx = info_dlg.children.length;
- info = text_rect('Interfaces (count: ' + wid.num_interfaces + ' - bound: ' + wid.num_bound_interfaces+')', 'BEGIN');
- info_dlg.children[info_dlg.ifce_idx] = info;
- info.visible = false;
- info.button_click = function() {
- this.visible = !this.visible;
- layout();
- };
- i=3;
- for (j=0; j<wid.num_interfaces; j++) {
- var idx;
- var ifce = wid.get_interface(j);
- var item = text_rect('Interface #' + (j+1) + ' type: '+ifce.type);
- info.children[i++] = item;
- item.visible = false;
- item.button_click = function() {
- this.visible = !this.visible;
- layout();
- };
- idx=3;
- item.children[idx++] = text_label('Multiple Binding: '+ifce.multipleBinding + ' - Service provider: '+ ifce.serviceProvider + ' - bound: ' + wid.is_interface_bound(ifce) , 'BEGIN');
- for (k=0; k<ifce.num_messages; k++) {
- var string, l;
- var msg = ifce.get_message(k);
- string = ' Message #'+ (k+1) + ': ' + msg.name + '(';
- for (l=0; l<msg.num_params; l++) {
- par = msg.get_param(l);
- string += (par.is_input ? 'in' : 'out') + ':' +par.name + ' ';
- }
- string += ')';
- item.children[idx++] = text_label(string, 'BEGIN');
- }
- }
-
- info_dlg.set_size = function(w, h) {
- var i, j, y, dy;
- y = h/2 - 20;
-
- for (i=0; i<this.children.length; i++) {
- var item = this.children[i];
- item.translation.x = 0;
- item.translation.y = y;
- item.set_size(w, 20);
- y -= 20;
- if (!i) continue;
-
- dy = 0;
- for (j=3; j<item.children.length; j++) {
- if (item.visible) {
- item.children[j].scale.x = 1;
- dy -= 20;
- item.children[j].translation.y = dy;
- if (i<this.ifce_idx) {
- item.children[j].translation.x = -w/2+10;
- } else {
- item.children[j].set_size(w-20, 20);
- var ddy=0;
- var k, sitem;
- sitem = item.children[j];
- for (k=3; k<sitem.children.length; k++) {
- if (item.children[j].visible) {
- sitem.children[k].scale.x = 1;
- sitem.children[k].translation.x = -w/2+10;
- ddy -= 20;
- sitem.children[k].translation.y = ddy;
- } else {
- sitem.children[k].scale.x = 0;
- }
- }
- dy+=ddy;
- }
- } else {
- item.children[j].scale.x = 0;
- }
- }
- y += dy;
- }
- };
-
- dlg_display.children[0] = info_dlg;
- widget_display.scale.x = 0;
- layout();
-}
-
-
-function widget_insert(widget)
-{
- /*insert the widget icon*/
- if (widget.permanent && !widget.is_component)
- insert_widget_icon(widget, 0);
-
- /*and load the widget - comment this line to disable auto load of widget*/
- widget_launch(widget);
-}
-
-function setup_icons()
-{
- var icon;
-
- //Widgets Icon
- icon = icon_button('icons/applications-system.svg', 'Available Widgets', 0);
- icon.button_click = function () {
- widget_screen_visible = !widget_screen_visible;
- layout();
- };
- dock.children[0] = icon;
-
- //Get Widget Icon
- icon = icon_button('icons/document-save.svg', 'Get Widget', 0);
- icon.button_click = function () {
- widget_get();
- };
- dock.children[1] = icon;
-
- //Widgets add Icon
- icon = icon_button('icons/list-add.svg', 'Add Widgets', 0);
- icon.button_click = function () {
- widget_browse();
- };
- dock.children[2] = icon;
-
-
- icon = icon_button('icons/user-trash.svg', 'Remove all widgets', 0);
- icon.button_click = function () {
- while (1) {
- var wid = WidgetManager.get(0);
- if (wid==null) break;
- widget_close(wid, 1);
- }
- widget_screen.children.length = 0;
- layout();
- };
- dock.children[3] = icon;
-
- //exit Icon
- icon = icon_button('icons/emblem-unreadable.svg', 'Exit', 0);
- icon.button_click = function() { scene.exit(); };
- dock.children[4] = icon;
-}
-
-
-
-/*dock layout*/
-function dock_layout() {
- var i;
-
- dock.translation.y = (dock_height - display_height)/2;
- infobar.translation.y = display_height/2 - info_height/2;
-
- num_in_dock = dock.children.length;
- tot_len = num_in_dock*icon_size;
-
- if (tot_len>display_width) {
- start_x = (icon_size-display_width)/2;
- } else {
- start_x = (icon_size-tot_len)/2;
- }
- /*translate / size all items in the dock*/
- for (i=0;i<num_in_dock; i++) {
- dock.children[i].set_size(icon_size, icon_size);
- dock.children[i].translation.x = start_x + i*icon_size;
- }
-}
-
-function widget_screen_layout(dir)
-{
- var count, i, start_x, start_y, spread_x, nb_wid_h, nb_wid_v, nb_wid;
-
- if (!widget_screen_visible) {
- widget_screen.size.x = 0;
- widget_screen.size.y = 0;
- return;
- }
-
- widget_screen.size.x = display_width;
- widget_screen.size.y = display_height;
-
- start_x = (icon_size/2-display_width)/2;
- start_y = (display_height-icon_size/2)/2 - info_height;
- start_x = (icon_size-display_width)/2;
- start_y = (display_height-icon_size)/2 - icon_size/2 - info_height;
-
- count = widget_screen.children.length;
- if (first_visible_widget<0) first_visible_widget=0;
-
- for (i=0; i<count; i++) {
- var wid = widget_screen.children[i];
- wid.hide();
- }
-
- nb_wid_h = Math.floor(display_width / icon_size);
- if (!nb_wid_h) nb_wid_h=1;
-
- nb_wid_v = Math.floor((display_height-dock_height-icon_size) / icon_size);
- if (!nb_wid_v) nb_wid_v=1;
-
- spread_x = (display_width / nb_wid_h) - icon_size;
- start_x += spread_x/2;
-
- nb_wid = (nb_wid_h*nb_wid_v);
- if (dir<0) {
- first_visible_widget -= nb_wid;
- if (first_visible_widget < 0) first_visible_widget = 0;
- }
- else if (dir>0) {
- first_visible_widget += nb_wid;
- }
-
- for (i=0; i<count; i++) {
- var wid;
- if (i +first_visible_widget >= count) {
- break;
- }
- wid = widget_screen.children[i +first_visible_widget];
- wid.show();
- wid.set_size(icon_size, icon_size);
- wid.translation.x = start_x;
- wid.translation.y = start_y;
- start_x += icon_size + spread_x;
- if (start_x + icon_size / 2 >= display_width/2) {
- start_x = (icon_size-display_width)/2 + spread_x/2;
- start_y -= icon_size;
- }
- nb_widgets_on_screen = i+1;
- if (start_y - icon_size < (dock_height-display_height)/2) {
- i++;
- break;
- }
- }
-}
-
-//performs layout on all contents
-function layout() {
- var i, list, start_x;
-
- scene.set_option('Widgets', 'LastWMWidth', '' + display_width);
- scene.set_option('Widgets', 'LastWMHeight', '' + display_height);
-
-
- if (WidgetManager.num_widgets) {
- dock.children[0].show();
- } else {
- dock.children[0].hide();
- }
- if (dlg_display.children.length) {
- widget_display.scale.x = 0;
- widget_screen_visible = false;
- }
- //layout all icons in the dock
- dock_layout();
- widget_screen_layout(0);
-
- if (dlg_display.children.length) {
- list = dlg_display.children;
- for (i=0; i<list.length; i++) {
- var dlg = list[i];
- if (typeof (dlg.set_size) != 'undefined') dlg.set_size(display_width, display_height-icon_size-info_height);
- dlg.translation.y = (icon_size-info_height)/2;
- }
- }
- else if (widget_screen_visible) {
- widget_display.scale.x = 0;
- } else {
- widget_display.scale.x = 1;
- list = widget_display.children;
- for (i=0; i<list.length; i++) {
- var widctrl = list[i];
- if (widctrl.maximized) {
- widctrl.translation.y = - info_height;
- widctrl.set_size(display_width, display_height - 2*info_height);
- }
- }
- }
-}
-
-//resize event callback
-function on_resize(evt) {
- display_width = evt.width;
- display_height = evt.height;
- layout();
-}
-//zoom event callback
-function on_zoom(evt) {
- display_width = evt.width;
- display_height = evt.height;
- layout();
-}
-//scroll event callback
-function on_scroll(evt) {
- layout();
-}
-
-//starts a widget
-function on_widget_launch() {
- if (this.widget.visible) {
- var awid;
- if (!this.widget.multipleInstances) return;
- awid = WidgetManager.open(this.widget.manifest, null);
- widget_launch(awid);
- } else {
- widget_launch(this.widget);
- }
-}
-
-function widget_get_icon(widget)
-{
- var icon = 'icons/process-stop.svg';
- var preferredIconType = '.svg';
- for (var i = 0; i < widget.icons.length; i++) {
- icon = widget.icons[i].relocated_src;
- if (widget.icons[i].relocated_src.indexOf(preferredIconType) > 0) {
- break;
- }
- }
- return icon;
-}
-
-//initialize GPAC widget manager and load all widgets
-function widgets_init() {
-
- count = WidgetManager.num_widgets;
- for (i=0; i<count; i++) {
- wid = WidgetManager.get(i);
- if (wid == null) continue;
- wid.device = null;
- wid.device_ip = null;
- if (wid.in_panel == true) {
- icon = icon_button(widget_get_icon(wid), wid.name, 0);
- icon.tooltip = wid.name;
- icon.widget = wid;
- icon.button_click = on_widget_launch;
-
- wid.icon_dock = icon;
- widget_screen.children[widget_screen.children.length] = wid.icon_dock;
- }
- if (wid.visible) {
- widget_launch(wid);
- }
- }
-}
-
-function on_widget_size(value) {
- //remember variables
- this.width = value.x;
- this.height = value.y;
- //and set widget input params
- this.set_input('width', value.x);
- this.set_input('height', value.y);
-}
-
-function on_widget_move(value) {
- this.x = value.x;
- this.y = value.y;
-}
-
-//widget close function
-function widget_close(widget, force_remove)
-{
- var is_comp = widget.is_component;
- if (widget.visible) {
- widget.visible = false;
- WidgetManager.corein_message(widget, 'hide');
- WidgetManager.corein_message(widget, 'deactivate');
- widget.deactivate();
- widget.scene_container.removeChildren[0] = widget.widget_control;
- /*force disconnect of main resource - we do this because we are not sure when the widget_control will be destroyed due to JS GC*/
- widget.widget_control.inline.url.length = 0;
- }
- if (!is_comp && (!widget.permanent || force_remove)) {
- WidgetManager.unload(widget, false);
- }
-}
-
-function on_widget_close(value) {
- widget_close(this, 0);
-}
-
-//widget remove function (close and unregister)
-function widget_remove(wid) {
- if (typeof(wid.icon_dock) != 'undefined')
- widget_screen.removeChildren[0] = wid.icon_dock;
- widget_close(wid, 0);
- layout();
-}
-
-function on_widget_control(value)
-{
- var i, count;
- if (!value) return;
- count = this.scene_container.children.length;
- for (i=0; i<count; i++) {
- if (this.scene_container.children[i] == this.widget_control) {
- this.scene_container.removeChildren[0] = this.widget_control;
- this.scene_container.children[this.scene_container.children.length] = this.widget_control;
- return;
- }
- }
-}
-
-//widget launcher function
-function widget_launch(wid) {
- var widg_ctrl;
-
- //assign default size to the widget
- if (wid.width == undefined) {
- wid.width = wid.defaultWidth;
- if (wid.width == 0) wid.width = widget_default_size;
- }
- if (wid.height == undefined) {
- wid.height = wid.defaultHeight;
- if (wid.height == 0) wid.height = widget_default_size;
- }
- if (wid.x== undefined) wid.x = 0;
- if (wid.y== undefined) wid.y = 0;
-
- widg_ctrl = new_widget_control(wid);
- widg_ctrl.component_bound = false;
-
- wid.visible = true;
-
- widg_ctrl.set_size(wid.width, wid.height);
- widg_ctrl.translation.x = wid.x;
- widg_ctrl.translation.y = wid.y;
-
- wid.widget_control = widg_ctrl;
- wid.scene_container = widget_display;
-
- widg_ctrl.show_remove( (!wid.discardable && wid.icon_dock) ? 1 : 0);
-
- widg_ctrl.sub_width = 0;
- widg_ctrl.sub_height = 0;
- widg_ctrl.sub_x = 0;
- widg_ctrl.sub_y = 0;
- widg_ctrl.sub_vp_w = 0;
- widg_ctrl.sub_vp_h = 0;
-
- widg_ctrl.inline.addEventListener('gpac_vp_changed',
- function(evt) {
- widg_ctrl.sub_vp_w = evt.width;
- widg_ctrl.sub_vp_h = evt.height;
- widg_ctrl.sub_vp_x = evt.offset_x;
- widg_ctrl.sub_vp_y = evt.offset_y;
- widg_ctrl.sub_w = evt.vp_width;
- widg_ctrl.sub_h = evt.vp_height;
- widg_ctrl.refresh_layout(true, null);
- },
- 0);
-
- /*this will setup the scene graph for the widget in order to filter input and output communication pins*/
- wid.activate(widg_ctrl.inline);
-
- widg_ctrl.inline.url[0] = wid.main;
- widget_display.addChildren[0] = widg_ctrl;
-
- /*send notifications once the widget scene is loaded*/
- wid.on_load = function () {
- WidgetManager.corein_message(this, 'activate');
- WidgetManager.corein_message(this, 'show');
- WidgetManager.corein_message(this, 'setSize', 'width', 50, 'height', 50, 'dpi', 96);
- };
-
- if (widget_screen_visible) {
- widget_screen_visible = 0;
- layout();
- }
- //
- if (log_level > l_inf) {
- var i = 0;
- alert(">>>>>>>>>>>>> "+wid.name+" interfaces:");
- for (;i < wid.num_interfaces; i++) {
- alert(""+wid.get_interface(i).type);
- }
- }
- //
-}
-
-
-//core out install widget implementation JCD
-function widget_install_widget(widget, args)
-{
- var uri = args[0], j;
- var count = WidgetManager.num_widgets;
- for (j=0; j<count; j++) {
- var wid = WidgetManager.get(j);
- if (wid.url==uri) break;
- }
- if (j==count) {
- new_wid = WidgetManager.open(uri, null);
- if (new_wid!=null) {
- insert_widget_icon(new_wid, 1);
- }
- }
-}
-
-//core out migrate component implementation JCD
-function widget_migrate_component(widget, args)
-{
- if (has_upnp && UPnP.MediaRenderersCount) {
- widget_remote_candidate = widget.get_component(args[0]);
- if (widget_remote_candidate==null) {
- log(l_err, 'Component '+args[0]+' cannot be found in widget '+widget.name);
- return;
- }
- if (args.length > 1 && args[1] != null) {
- var render = WidgetManager.MPEGUStandardServiceProviders[parseInt(args[1])];
- WidgetManager.migrate_widget(render, widget_remote_candidate);
- widget_close(widget_remote_candidate, 0);
- widget_remote_candidate = null;
- } else {
- on_upnpopen();
- }
- }
-}
-
-// core out request migration targets JCD
-function widget_request_migration_targets(wid, args)
-{
- var count = WidgetManager.MPEGUStandardServiceProviders.length,
- codes = new Array(), names = new Array(), descriptions = new Array(), i;
- for (i = 0; i < count; i++) {
- var render = WidgetManager.MPEGUStandardServiceProviders[i];
- codes.push(""+i);
- names.push(render.Name);
- descriptions.push(render.HostName +" "+ render.UUID);
- }
- i = null;
- var ifce_count = wid.num_interfaces, j;
- for (j = 0; j < ifce_count; j++) {
- var ifce = wid.get_interface(j);
- if (ifce.type == "urn:mpeg:mpegu:schema:widgets:core:out:2010") {
- i = ifce;
- break;
- }
- }
- if (i != null) {
- wmjs_core_out_invoke_reply(coreOut.requestMigrationTargetsMessage, i.get_message("requestMigrationTargets"),
- wid, codes, names, descriptions);
- }
-
-}
-
-function widget_request_size(widget, args)
-{
- if (args.length==2) {
- w = (typeof args[0] == 'string') ? parseInt(args[0]) : args[0];
- h = (typeof args[1] == 'string') ? parseInt(args[1]) : args[1];
- widget.widget_control.set_size(w, h);
- }
-}
-
-function widget_request_show(widget, args)
-{
- widget.widget_control.show();
-}
-
-function widget_request_hide(widget, args)
-{
- widget.widget_control.hide();
-}
-
-function widget_request_activate(widget, args)
-{
- if (!widget.visible)
- widget_launch(widget);
-}
-
-function widget_request_deactivate(widget, args)
-{
- if (widget.visible)
- widget_close(widget, 0);
-}
-
-function widget_request_attention(widget, args)
-{
- if (widget.visible) {
- widget_display.removeChildren[0] = widget.widget_control;
- widget_display.addChildren[0] = widget.widget_control;
- widget.widget_control.flash();
- }
-}
-
-function widget_request_notification(widget, args)
-{
- var notif = text_rect('');
- notif.children[1].geometry.string[0] = 'Notification from widget';
- notif.children[1].geometry.string[1] = ' '+widget.name;
- notif.children[1].geometry.string[2] = ' ';
- notif.children[1].geometry.string[3] = args[0];
- dlg_display.children[0] = notif;
- notif.set_size(320, 240);
- notif.button_click = function() {
- dlg_display.removeChildren[0] = this;
- }
-}
-
-function widget_place_component(widget, args)
-{
- var comp = widget.get_component(args[0]);
-
- if (comp==null) {
- log(l_err, 'Component '+args[0]+' cannot be found in widget '+widget.name);
- return;
- }
- comp.widget_control.place_x = args[1];
- comp.widget_control.place_y = args[2];
- comp.widget_control.place_w = args[3];
- comp.widget_control.place_h = args[4];
- comp.widget_control.place_z = args[5];
- comp.widget_control.component_bound = true;
- widget.widget_control.refresh_layout(false, comp);
-}
-
-
-
-function insert_widget_icon(new_wid, no_layout) {
- var icon;
- icon = icon_button(widget_get_icon(new_wid), new_wid.name, 0);
- icon.tooltip = new_wid.name;
- new_wid.in_panel = true;
- new_wid.visible = false;
- new_wid.icon_dock = icon;
- icon.button_click = on_widget_launch;
- icon.widget = new_wid;
- widget_screen.addChildren[0] = new_wid.icon_dock;
- if (!no_layout) layout();
-}
-
-function scan_directory(dir)
-{
- var i, j, count, list, new_wid, uri;
- list = Sys.enum_directory(dir, '.xml;.wgt;.mgt', 0);
- for (i=0; i<list.length; i++) {
- uri = list[i].path + list[i].name;
- if (list[i].directory) {
- scan_directory(uri);
- } else {
- count = WidgetManager.num_widgets;
- for (j=0; j<count; j++) {
- var wid = WidgetManager.get(j);
- if (wid.url==uri) break;
- }
- if (j==count) {
- new_wid = WidgetManager.open(uri, null);
- if (new_wid!=null) {
- insert_widget_icon(new_wid, 1);
- }
- }
- }
- }
-}
-
-function widget_browse()
-{
- filebrowse = new SFNode('Transform2D');
- infobar.set_label('Select widget');
- dlg_display.children[0] = filebrowse;
-
- filebrowse.children[0] = icon_button('icons/emblem-unreadable.svg', 'Close', 0);
- filebrowse.children[0].button_click = function() {
- dlg_display.children.length = 0;
- widget_display.scale.x = 1;
- layout();
- }
-
- filebrowse.children[1] = icon_button('icons/go-previous.svg', 'Previous', 0);
- filebrowse.children[1].filebrowse = filebrowse;
- filebrowse.children[1].button_click = function () { this.filebrowse.layout(0) };
-
- filebrowse.children[2] = icon_button('icons/go-next.svg', 'Next', 0);
- filebrowse.children[2].filebrowse = filebrowse;
- filebrowse.children[2].button_click = function () { this.filebrowse.layout(1) };
-
- filebrowse.children[3] = icon_button('icons/go-up.svg', 'Up', 0);
- filebrowse.children[3].filebrowse = filebrowse;
- filebrowse.children[3].button_click = function () { this.filebrowse.browse(true) };
-
- filebrowse.children[4] = icon_button('icons/Folder.svg', 'Scan Directory', 0);
- filebrowse.children[4].filebrowse = filebrowse;
- filebrowse.children[4].button_click = function () {
- scan_directory(this.filebrowse.directory);
- WidgetManager.last_widget_dir = this.filebrowse.directory;
- dlg_display.children.length = 0;
- widget_display.scale.x = 0;
- widget_screen_visible = true;
- layout();
- }
- filebrowse.children[5] = text_label('', 'BEGIN');
- filebrowse.set_label = function(label) {
- filebrowse.children[5].set_label(label);
- }
- filebrowse.nb_tools = filebrowse.children.length;
-
- filebrowse.browse = function(go_up) {
- this.list = Sys.enum_directory(this.directory, '*.xml;*.wgt;*.mgt', go_up);
- if (this.list.length) {
- this.directory = this.list[0].path;
- this.set_label(this.directory);
- } else {
- this.set_label('');
- }
- this.first = 0;
- this.layout(0);
- }
- filebrowse.layout = function(type) {
- var w, h, i, y;
- this.children.length = this.nb_tools;
-
- this.children[1].hide();
- this.children[2].hide();
- if (this.directory == '')
- this.children[3].hide();
- else
- this.children[3].show();
-
- if (type==0) {
- this.first -= this.nb_items;
- if (this.first<0) this.first = 0;
- }
- else if (type) {
- this.first += this.nb_items;
- if (this.first + this.nb_items > this.list.length) this.first = this.list.length - this.nb_items;
- }
- if (this.first) this.children[1].show();
- if (this.first+this.nb_items < this.list.length) this.children[2].show();
-
- for (i=0; i<this.nb_items; i++) {
- var item;
- if (i+this.first>=this.list.length) break;
- item = text_rect(this.list[i+this.first].name);
- item.path = this.list[i+this.first].path;
- item.name = this.list[i+this.first].name;
- item.directory = this.list[i+this.first].directory;
- item.filebrowse = this;
- item.button_click = function() {
- if (this.directory) {
- this.filebrowse.directory = this.path + this.name;
- this.filebrowse.browse(false);
- } else {
- var value = this.path + this.name;
- dlg_display.children.length = 0;
- widget_display.scale.x = 1;
- widget_screen_visible = true;
- layout();
-
- var new_wid = WidgetManager.open(value, null);
- if (new_wid==null) return;
-
- WidgetManager.last_widget_dir = this.filebrowse.directory;
- insert_widget_icon(new_wid, 0);
- }
- }
- this.children[this.nb_tools+i] = item;
- }
- this.set_size(this.width, this.height);
- }
-
-
- filebrowse.set_size = function(w, h) {
- var i, x, y, isize, nbi;
- isize = 24;
- if (w>display_width - isize) w = display_width - isize;
-
- this.width = w;
- this.height = h;
-
- i = 1;
- while ((i+1)*isize <= h - isize) i++;
-
- if (i != this.nb_items) {
- this.nb_items = i;
- this.layout(0);
- return;
- }
- x = -w/2 + isize/2;
- y = h/2 - isize/2;
-
- for (i=0;i<this.nb_tools;i++) {
- if (this.nb_tools>i+1) {
- this.children[i].set_size(isize, isize);
- }
- this.children[i].translation.x = x;
- this.children[i].translation.y = y;
- x += isize;
- }
- y-=isize;
- while (i<this.children.length) {
- this.children[i].set_size(w, isize);
- this.children[i].translation.x = 0;
- this.children[i].translation.y = y;
- y-=isize;
- i++;
- }
- }
- filebrowse.nb_items = 0;
- filebrowse.directory = WidgetManager.last_widget_dir;
- filebrowse.browse(0);
-
- widget_display.scale.x = 0;
- layout();
-}
-
-function onMediaRendererAdd(name, uuid, is_add)
-{
- var i, count;
-
- count = WidgetManager.num_widgets;
- for (i=0; i<count; i++) {
- wid = WidgetManager.get(i);
- if (wid == null) continue;
- if (!wid.widget_control) continue;
- wid.widget_control.show_remote();
- }
-
- if (upnp_renders) upnp_renders.refresh();
-}
-
-function on_upnpopen()
-{
- upnp_renders = new SFNode('Transform2D');
- upnp_renders.nb_items = 0;
- upnp_renders.refresh = function () {
- var i, count, render, item, start_y, w;
- this.children.length = 0;
- count = WidgetManager.MPEGUStandardServiceProviders.length;
- if (count+1>this.nb_items) count = this.nb_items-1;
-
- item = text_rect('Close');
- item.button_click = function() {
- dlg_display.children.length = 0;
- upnp_renders=null;
- widget_display.scale.x = 1;
- infobar.set_label('');
- }
- this.children[this.children.length] = item;
-
- for (i=0; i<count; i++) {
- render = WidgetManager.MPEGUStandardServiceProviders[i];
- item = text_rect(render.Name);
- item.render = render;
-
- item.button_click = function() {
- dlg_display.children.length = 0;
- upnp_renders=null;
- widget_display.scale.x = 1;
- infobar.set_label('');
-
- WidgetManager.migrate_widget(this.render, widget_remote_candidate);
- widget_close(widget_remote_candidate, 0);
- widget_remote_candidate = null;
- }
- this.children[this.children.length] = item;
- }
- this.set_size(this.width, this.height);
- }
-
- upnp_renders.set_size = function (w, h) {
- var i, count, start_y, w;
-
- this.width = w<300 ? w : 300;
- this.height = h;
-
- i = 1;
- while ((i+1)*icon_size <= h - icon_size) i++;
- if (i != this.nb_items) {
- this.nb_items = i;
- this.refresh();
- return;
- }
- count = this.children.length;
- start_y = this.height/2 - icon_size - 4;
- for (i=0; i<count; i++) {
- this.children[i].set_size(this.width, icon_size);
- this.children[i].translation.y = start_y;
- start_y-=icon_size+2;
- }
- }
-
- infobar.set_label('Select remote display');
- dlg_display.children[0] = upnp_renders;
- widget_display.scale.x = 0;
- layout();
-}
-
-
-function onMediaConnect(url, src_ip)
-{
- if (WidgetManager.probe(url)) {
- var new_wid = WidgetManager.open(url, src_ip);
- if (new_wid==null) {
- return;
- }
- widget_insert(new_wid);
- }
-}
-
-// widget get: UI for listWidgets and getWidget
-// added by Jean-Claude Dufourd, modeled on filebrowse
-function widget_get() {
- alert("widget_get");
- widgetbrowse = new SFNode('Transform2D');
- infobar.set_label('Select widget manager');
- dlg_display.children[0] = widgetbrowse;
-
- widgetbrowse.children[0] = icon_button('icons/emblem-unreadable.svg', 'Close', 0);
- widgetbrowse.children[0].button_click = function() {
- dlg_display.children.length = 0;
- widget_display.scale.x = 1;
- layout();
- };
-
- widgetbrowse.children[1] = text_label('', 'BEGIN');
- widgetbrowse.set_label = function(label) {
- widgetbrowse.children[1].set_label(label);
- };
-
- widgetbrowse.nb_tools = widgetbrowse.children.length;
-
- // this function builds the whole UI the first time
- widgetbrowse.layout = function() {
- alert("widgetbrowse.layout");
- var w, h, i, y;
- this.children.length = this.nb_tools;
- for (i = 0; i < this.nb_items; i++) {
- var item;
- if (i >= this.list.length) {
- break;
- }
- item = text_rect(this.list[i].Name);
- item.wm = this.list[i];
- item.widgetbrowse = this;
- item.button_click = function() {
- alert("click to select wm: "+this.wm.Name);
- this.widgetbrowse.wm = this.wm;
- this.wm.standardService.SetActionListener("listWidgets", get_widget_callback(this.wm, this.widgetbrowse), true);
- this.wm.standardService.CallAction("listWidgets", new Array());
- };
- this.children[this.nb_tools + i] = item;
- }
- this.set_size(this.width, this.height);
- };
-
- widgetbrowse.set_size = function(w, h) {
- alert("widgetbrowse.set_size "+w+" "+h);
- var i, x, y, isize, nbi;
- isize = 24;
- if (w > display_width - isize) {
- w = display_width - isize;
- }
- this.width = w;
- this.height = h;
- i = 1;
- while ((i + 1) * isize <= h - isize) {
- i++;
- }
- if (i != this.nb_items) {
- this.nb_items = i;
- this.layout(0);
- return;
- }
- x = -w / 2 + isize / 2;
- y = h / 2 - isize / 2;
- for (i = 0; i < this.nb_tools; i++) {
- if (this.nb_tools > i + 1) {
- this.children[i].set_size(isize, isize);
- }
- this.children[i].translation.x = x;
- this.children[i].translation.y = y;
- x += isize;
- }
- y -= isize;
- while (i < this.children.length) {
- this.children[i].set_size(w, isize);
- this.children[i].translation.x = 0;
- this.children[i].translation.y = y;
- y -= isize;
- i++;
- }
- };
-
- widgetbrowse.nb_items = WidgetManager.MPEGUStandardServiceProviders.length;
- widgetbrowse.list = WidgetManager.MPEGUStandardServiceProviders;
- widgetbrowse.set_label('Select Widget Manager');
- widgetbrowse.layout(0);
- widget_display.scale.x = 0;
- layout();
-}
-
-function get_widget_callback(device, widgetbrowse) {
- alert("get_widget_callback "+device.Name+" "+widgetbrowse);
- return function() {
- // msgHandler is the first argument, the next arguments are from the reply to listWidgets
- var act = arguments[0];
- var act1 = act.GetArgumentValue("widgetCodes");
- var act2 = act.GetArgumentValue("widgetNames");
- alert("callback |"+act1+"| |"+act2+"|");
- widgetbrowse.set_label("Select Widget");
- var w, h, i, y;
- act1 = act1.split(" ");
- act2 = act2.split(" ");
- widgetbrowse.children.length = widgetbrowse.nb_tools;
- for (i = 0; i < act2.length; i++) {
- if (act1[i]=="" || act2[i]=="") continue;
- var item = text_rect(act2[i]);
- item.widgetCode = act1[i];
- item.widgetName = act2[i];
- item.widgetbrowse = widgetbrowse;
- item.button_click = function() {
- alert("selected widget: "+this.widgetName);
- dlg_display.children.length = 0;
- widget_display.scale.x = 1;
- widget_screen_visible = true;
- layout();
- var arr = new Array();
- arr[0] = "widgetCode";
- arr[1] = this.widgetCode;
- this.widgetbrowse.wm.standardService.SetActionListener("getWidget", get_widget_callback2, true);
- this.widgetbrowse.wm.standardService.CallAction("getWidget", arr);
- };
- widgetbrowse.children[this.nb_tools + i] = item;
- }
- widgetbrowse.set_size(widgetbrowse.width, widgetbrowse.height);
- }
-}
-
-function get_widget_callback2() {
- // msgHandler is the first argument, the next arguments are from the reply to listWidgets
- alert("callback2-1");
- var act = arguments[0];
- var act1 = act.GetArgumentValue("widgetUrl");
- var act2 = act.GetArgumentValue("widgetContext");
- alert("callback2-2 " + act1 + " " + act2);
- var wid = WidgetManager.load(act1, null, act2);
- WidgetManager.on_widget_add(wid);
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- MPEG-U Widget Manager sample
-
- (c) 2010 Telecom Paris
- Author: Jean Le Feuvre (jean dot lefeuvre at telecom-paris dot fr)
-
-This software module was originally developed by Telecom Paris in the
-course of the development of MPEG-U Widgets (ISO/IEC 23007-1) standard.
-
-This software module is an implementation of a part of one or
-more MPEG-U Widgets (ISO/IEC 23007-1) tools as specified by the MPEG-U Widgets
-(ISO/IEC 23007-1) standard. ISO/IEC gives users of the MPEG-U Widgets
-(ISO/IEC 23007-1) free license to this software module or modifications
-thereof for use in hardware or software products claiming conformance to
-the MPEG-U Widgets (ISO/IEC 23007-1). Those intending to use this software
-module in hardware or software products are advised that its use may
-infringe existing patents.
-The original developer of this software module and his/her company, the
-subsequent editors and their companies, and ISO/IEC have no liability
-for use of this software module or modifications thereof in an implementation.
-Copyright is not released for non MPEG-U Widgets (ISO/IEC 23007-1) conforming
-products.
-Telecom Paris retains full right to use the code for his/her own purpose,
-assign or donate the code to a third party and to inhibit third parties from
-using the code for non MPEG-U Widgets (ISO/IEC 23007-1) conforming products.
-
-This copyright notice must be included in all copies or derivative works.
-
-Copyright (c) 2009.
-
--->
-
-<XMT-A xmlns="urn:mpeg:mpeg4:xmta:schema:2002" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:mpeg4:xmta:schema:2002 xmt-a.xsd">
- <Header>
- </Header>
- <Body>
- <Replace>
- <Scene>
- <!-- Built-in BIFS prototype of GPAC which undo all user transforms (zoom and pan) -->
- <ProtoDeclare name="Untransform" protoID="1" locations=""urn:inet:gpac:builtin:Untransform"">
- <field name="children" type="Nodes" vrml97Hint="exposedField">
- <nodes/>
- </field>
- </ProtoDeclare>
-
- <!-- Main scene -->
- <OrderedGroup DEF="GPAC_UI">
- <children>
- <Background2D backColor="1 1 1"/>
- <ProtoInstance name="Untransform" DEF="UI_ROOT"/>
- <Script DEF="GUIScript" url="mpegu-wm.js">
- <field name="root" type="Node" vrml97Hint="field">
- <node>
- <OrderedGroup USE="GPAC_UI"/>
- </node>
- </field>
- <field name="ui_root" type="Node" vrml97Hint="field">
- <node>
- <ProtoInstance name="Untransform" USE="UI_ROOT"/>
- </node>
- </field>
- </Script>
- </children>
- </OrderedGroup>
- </Scene>
- </Replace>
- </Body>
-</XMT-A>
+++ /dev/null
-var movie1 = "../widgets/media/local_video/movies/Clovis Cornillac.mp4";
-var movie2 = "../widgets/media/local_video/movies/Airheads2001_edit.mp4";
-var movie3 = "../widgets/media/local_video/movies/CH Video - Alberto Alessi.mp4";
-var movie4 = "../widgets/media/local_video/movies/Crossing2001_edit.mp4";
-var movie5 = "../widgets/media/local_video/movies/EnemyAtT2001_512kb.mp4";
-var movie6 = "../widgets/media/local_video/movies/KAMI2001_512kb.mp4";
-var movie7 = "../widgets/media/local_video/movies/PipeDrea2001_512kb.mp4";
-var movie8 = "../widgets/media/local_video/movies/LAUTRETE2001_512kb.mp4";
-var movie9 = "../widgets/media/local_video/movies/Unexpect2001_512kb.mp4";
-var movie0 = "../widgets/media/local_video/movies/Animatrix_The_Second_Renaissance_l.mp4";
-
-var xlinkns = 'http://www.w3.org/1999/xlink';
-
-/* override the print function to use SVG alert */
-print = alert;
-
-/*******************************************************************************
- *Global elements referenced in this script
- ******************************************************************************/
-
-/* Root of the SVG document presenting the widgets, the dock ...*/
-var root;
-/* The dock element presents the widget icons or simplified representations */
-var dock;
-/* The movie element presents the media content, widgets are added on top of it */
-var movie;
-/* The widget_display element contains the full representation of all activated widgets, it is on top of the movie element */
-var widget_display;
-/* The display element contains things to be displayed on top of the widgets */
-var display;
-
-
-function create_icon(url, short_name) {
- var icon_g;
- icon_g = document.createElement('g');
- icon_g.short_name = short_name;
-
- var back_rect;
- back_rect = document.createElement('rect');
- back_rect.setAttribute('fill', 'url(#inactiveGradient)');
- back_rect.setAttribute('rx', 5);
- back_rect.setAttribute('stroke', 'black');
- back_rect.setAttribute('stroke-width', 1);
- icon_g.appendChild(back_rect);
-
- var icon;
- icon = document.createElement('animation');
- icon.setAttributeNS(xlinkns ,'href', url);
- icon_g.appendChild(icon);
-
- var text;
- text = document.createElement('textArea');
- text.setAttribute('fill', 'white');
- text.textContent = short_name;
- icon_g.appendChild(text);
-
- return icon_g;
-}
-
-function set_icon_active(icon, value) {
- var back_rect;
- back_rect = icon.firstElementChild;
- if (!value) back_rect.setAttribute('fill', 'url(#inactiveGradient)');
- else back_rect.setAttribute('fill', 'url(#activeGradient)');
-}
-
-function set_icon_visible(icon, value) {
- if (value) icon.setAttribute('display', 'inline');
- else icon.setAttribute('display', 'none');
-}
-
-function set_icon_position(icon, x, y) {
- icon.setAttribute('transform', 'translate('+x+','+y+')');
-}
-
-function set_icon_size(icon, w, h) {
- var back_rect = icon.firstElementChild;
- back_rect.setAttribute('width', w);
- back_rect.setAttribute('height', h);
-
- var anim = back_rect.nextElementSibling;
- anim.setAttribute('x', 5*w/8);
- anim.setAttribute('y', -10);
- anim.setAttribute('width', 1.2*h);
- anim.setAttribute('height', 1.2*h);
-
- var tA = anim.nextElementSibling;
- tA.setAttribute('x', icon_spacing);
- tA.setAttribute('y', 5);
- tA.setAttribute('height', h);
- if (w > 100) {
- tA.setAttribute('font-size', h/3);
- tA.setAttribute('width', w/1.8);
- } else {
- tA.setAttribute('font-size', h/5);
- tA.setAttribute('width', 4*w/8);
- }
-}
-
-function add_widget_to_dock(wid) {
- var wid_icon_url = null;
- var icon;
- var preferredIconType = '.svg';
- for (var i = 0; i < wid.icons.length; i++) {
- wid_icon_url = wid.icons[i].relocated_src;
- if (wid.icons[i].relocated_src.indexOf(preferredIconType) > 0) {
- break;
- }
- }
- if (wid_icon_url == null) wid_icon_url = 'icons\\applications-system.svg';
- //alert(wid_icon_url);
- icon = create_icon(wid_icon_url, wid.name);
- icon.widget = wid;
- set_icon_visible(icon, false);
- dock.appendChild(icon);
- wid.icon_dock = icon;
-}
-
-
-function resize() {
- /*dummy values, assign upon window resize event*/
- alert('Size:'+root.viewport.width+'x'+root.viewport.height);
- display_width = root.viewport.width;//scene.screen_width;
- display_height = root.viewport.height;//scene.screen_height;
-
- nb_icon_max = 4;
- if (display_width > 800) {
- out_spacing = 30;
- icon_spacing = 10;
- } else {
- out_spacing = 10;
- icon_spacing = 4;
- }
- dock_width = display_width;
- icon_width = (dock_width-((nb_icon_max-1)*icon_spacing+2*out_spacing))/nb_icon_max;
-
- dock_height = display_height/10;
- icon_height = dock_height+4;
-
- movie.setAttribute('width', display_width);
- if (is_dock_visible) {
- movie.setAttribute('height', display_height - dock_height);
- } else {
- movie.setAttribute('height', display_height);
- }
-
- dock.setAttribute('transform', 'translate(0, '+(display_height-dock_height)+')');
-
- var dock_back = dock.firstElementChild.firstElementChild;
- dock_back.setAttribute('x', 0);
- dock_back.setAttribute('y', 0);
- dock_back.setAttribute('height', dock_height);
- dock_back.setAttribute('width', dock_width);
-
- var left_arrow = dock_back.nextElementSibling;
- left_arrow.setAttribute('x', 0);
- left_arrow.setAttribute('y', 0);
- left_arrow.setAttribute('height', dock_height - 5);
- left_arrow.setAttribute('width', out_spacing);
-
- var right_arrow = left_arrow.nextElementSibling;
- right_arrow.setAttribute('x', dock_width-out_spacing);
- right_arrow.setAttribute('y', 0);
- right_arrow.setAttribute('height', dock_height-5);
- right_arrow.setAttribute('width', out_spacing);
-
- dock_layout();
- alert('ok');
-}
-
-/*******************************************************************************
- * Global Initialization function, called when the SVG document is loaded
- * Initializes global variables (elements)
- * Finds the available widgets and add them to the dock
- ******************************************************************************/
-function initialize() {
- /* root of the SVG document presenting the widgets, the dock ...*/
- root = document.documentElement;
-
- /* The dock presents the widget icons or simplified representations */
- dock = document.getElementById('dock');
-
- /* The movie element presents the media content, widgets are added on top of it */
- movie = document.getElementById('movie');
-
- /* The widget display element contains the full representation of all activated widgets, it is on top of the movie_inline element */
- widget_display = document.getElementById('widget_display');
-
- /* The display element contains things to be displayed on top of the widgets */
- display = document.getElementById('display');
-
- is_dock_visible = false;
- if (!is_dock_visible) dock.setAttribute('display', 'none');
-
- activate = new Array();
- selected_widget_index = 0;
- first_displayed_widget_index = 0;
- nb_widgets_visible = 0;
- current_widget_pos = 0;
- next_widget_pos = 0;
- vertical_spacing = 10;
- vertical_offset = 0;
-
- /* if the WidgetManager object is not defined (this is a GPAC extension), we define a dummy one to enable debugging in Opera for example */
- if (typeof WidgetManager == 'undefined') {
- WidgetManager = new Object;
- WidgetManager.initialize = function () {}
- WidgetManager.num_widgets = 8;
- WidgetManager.get = function(i) {
- var wid = new Object;
- if (i < 2) {
- wid.icon = 'widgets/clock/appointment-new.svg';
- wid.main = 'widgets/clock/appointment-new.svg';
- wid.name = 'Clock';
- wid.visible = false;
- wid.x = 0;
- wid.y = 0;
- wid.width = 100;
- wid.height = 100;
- } else {
- wid.icon = 'icons/audio-volume-high.svg';
- wid.main = 'icons/audio-volume-high.svg';
- wid.name = 'Music';
- wid.visible = false;
- wid.x = 0;
- wid.y = 0;
- wid.width = 100;
- wid.height = 100;
- }
- return wid;
- }
- WidgetManager.unload = function (wid) {}
- }
-
- /* Setup the GPAC Widget Manager - this will also scan the available widgets */
- widget_manager_init();
-
- /* scan all the widgets from the widget manager, create an iconic view, set its size, add it to the dock element but make it invisible */
- var i;
- nb_widgets = WidgetManager.num_widgets;
- for (i=0; i<nb_widgets; i++) {
- var wid = WidgetManager.get(i);
- if (wid == null) continue;
- add_widget_to_dock(wid);
- activate[i] = true;
- }
-
- //resize();
-
- root.addEventListener('keyup', on_key_up, false);
-
- /* register the callback to be notified of incoming widgets */
- has_upnp = (typeof UPnP != 'undefined');
- alert('has upnp:'+ has_upnp);
- if (has_upnp) {
- /* setting the callback to allow other devices to push their widgets */
- UPnP.onMediaConnect = onMediaConnect;
- UPnP.onMediaStop = onMediaStop;
- UPnP.onMediaPause = onMediaPause;
- UPnP.onMediaPlay = onMediaPlay;
- /* Tell GPAC that the calls to the main Renderer (like open, ...) must be forwared to this scene */
- UPnP.BindRenderer();
- }
-
-}
-
-function dock_layout() {
-
- alert('dock layout first='+ first_displayed_widget_index+ '/' + nb_widgets+' active='+selected_widget_index);
- var i;
- var docFirstIcon = dock.firstElementChild.nextElementSibling;
- /* for all icons before the first visible, make them invisible */
- var child = docFirstIcon;
- i = 0;
- while (child && i < first_displayed_widget_index) {
- set_icon_visible(child, false);
- alert('setting child '+i+' invisible'+(i == selected_widget_index ? '*' :' ')+ ' '+child.getAttribute('transform'));
- child = child.nextElementSibling;
- i++;
- }
-
- /* for all icons from the first visible, make them visible and set their position
- and for all the icons after the max number of icons, make them invisible */
- i = first_displayed_widget_index;
- var start_x = out_spacing;
- while (child && i < nb_widgets) {
- if (i >= (first_displayed_widget_index+nb_icon_max)) {
- set_icon_visible(child, false);
- alert('setting child '+i+' invisible'+(i == selected_widget_index ? '*' :' ')+ ' '+child.getAttribute('transform'));
- } else {
- var offset_x = start_x + (i-first_displayed_widget_index)*(icon_width+icon_spacing);
- set_icon_visible(child, true);
- if (i == selected_widget_index) set_icon_active(child, true);
- else set_icon_active(child, false);
- set_icon_size(child, icon_width, icon_height);
- set_icon_position(child, offset_x, dock_height-icon_height);
-// alert('setting child '+i+' visible'+(i == selected_widget_index ? '*' :' ')+ ' '+child.getAttribute('transform'));
- }
- child = child.nextElementSibling;
- i++;
- }
-}
-
-function focusNextWidget() {
- alert('next');
- if (selected_widget_index < nb_widgets - 1) selected_widget_index++;
- if (selected_widget_index > first_displayed_widget_index + nb_icon_max -1 && first_displayed_widget_index + nb_icon_max < nb_widgets) first_displayed_widget_index++;
- dock_layout();
-}
-
-function focusPrevWidget() {
- alert('prev');
- if (selected_widget_index > 0) selected_widget_index--;
- if (first_displayed_widget_index > selected_widget_index && first_displayed_widget_index > 0) first_displayed_widget_index--;
-
- dock_layout();
-}
-
-function on_key_up(evt) {
- alert(evt.keyIdentifier + ' released '+evt.keyCode);
- if (evt.keyIdentifier == 'Right' || evt.keyCode == 39) {
- focusNextWidget();
- } else if (evt.keyIdentifier == 'Left' || evt.keyCode == 37) {
- focusPrevWidget();
- } else if (evt.keyIdentifier == 'Up') {
- vertical_offset += root.viewport.width / 3;
- widget_display.setAttribute('transform', 'translate(0,'+vertical_offset+')');
- } else if (evt.keyIdentifier == 'Down') {
- vertical_offset -= root.viewport.width / 3;
- widget_display.setAttribute('transform', 'translate(0,'+vertical_offset+')');
- } else if (evt.keyIdentifier == 'Enter') {
- if (is_dock_visible) {
- if (activate[selected_widget_index]) {
- widget_launch(WidgetManager.get(selected_widget_index), widget_display);
- activate[selected_widget_index] = false;
- nb_widgets_visible++;
- if (nb_widgets_visible == 1) {
- }
- } else {
- widget_close(WidgetManager.get(selected_widget_index));
- activate[selected_widget_index] = true;
- nb_widgets_visible--;
- if (nb_widgets_visible == 0) {
-
- }
- }
- }
- } else if (evt.keyIdentifier == 'F1') {
- dock_toggle_visible();
- } else if (evt.keyIdentifier == 'U+0030') {
- movie.setAttributeNS(xlinkns, 'href', movie0);
- } else if (evt.keyIdentifier == 'U+0031') {
- movie.setAttributeNS(xlinkns, 'href', movie1);
- } else if (evt.keyIdentifier == 'U+0032') {
- movie.setAttributeNS(xlinkns, 'href', movie2);
- } else if (evt.keyIdentifier == 'U+0033') {
- movie.setAttributeNS(xlinkns, 'href', movie3);
- } else if (evt.keyIdentifier == 'U+0034') {
- movie.setAttributeNS(xlinkns, 'href', movie4);
- } else if (evt.keyIdentifier == 'U+0035') {
- movie.setAttributeNS(xlinkns, 'href', movie5);
- } else if (evt.keyIdentifier == 'U+0036') {
- movie.setAttributeNS(xlinkns, 'href', movie6);
- } else if (evt.keyIdentifier == 'U+0037') {
- movie.setAttributeNS(xlinkns, 'href', movie7);
- } else if (evt.keyIdentifier == 'U+0038') {
- movie.setAttributeNS(xlinkns, 'href', movie8);
- } else if (evt.keyIdentifier == 'U+0039') {
- movie.setAttributeNS(xlinkns, 'href', movie9);
- }
-}
-
-function widget_close(widget) {
- alert('widget_close:'+widget.name);
- if (typeof widget.deactivate != 'undefined') {
- widget.deactivate();
- } else {
- wid.visible = false;
- }
- next_widget_pos -= widget.height + vertical_spacing;
- widget.scene_container.removeChild(widget.widget_control);
- /*force disconnect of main resource - we do this because we are not sure when the widget_control will be destroyed due to JS GC*/
- widget.widget_control.firstElementChild.setAttributeNS(xlinkns, 'href', '');
- //widget.widget_control.firstElementChild.removeAttributeNS(xlinkns, 'href');
-}
-
-/* todo ...*/
-function widget_remove(wid)
-{
- WidgetManager.unload(wid);
-}
-
-/* Function that starts to present the Widget Full representation */
-function widget_launch(wid, scene_container) {
- alert('widget_launch:'+wid.name);
-
- var widg_ctrl, anim;
-
- //assign default size to the widget
- wid.width = root.viewport.width / 3;
- wid.height = root.viewport.width / 3;
-
- var w = wid.width;
- var h = wid.height;
- alert('w '+w + ' h '+h);
-
- widg_ctrl = document.createElement('g');
- widg_ctrl.wid = wid;
-// widg_ctrl.setAttribute('transform', 'translate('+(nb_widgets_visible>=2?600:0)+','+400*nb_widgets_visible+')');
-// var y = (nb_widgets_visible%2)*310;
-// var x = ((nb_widgets_visible - nb_widgets_visible%2)/2*310);
- var x = 0;
- var y = next_widget_pos;
- next_widget_pos += h+vertical_spacing;
-
- alert('x:'+x+', y:' +y);
- widg_ctrl.setAttribute('transform', 'translate('+x+','+y+')');
-
- anim = document.createElement('animation');
- anim.setAttributeNS(xlinkns, 'href', wid.main);
- anim.setAttribute('width', w);
- anim.setAttribute('height', h);
- anim.setAttribute('preserveAspectRatio', 'xMidYMid');
-
- widg_ctrl.appendChild(anim);
-
- wid.widget_control = widg_ctrl;
- wid.scene_container = scene_container;
- /*this will setup the scene graph for the widget in order to filter input and output communication pins*/
- wid.on_load = function() {
- alert('wid.on_load:'+this.name);
- WidgetManager.bind(this);
- }
- wid.activate(anim);
- scene_container.appendChild(widg_ctrl);
-}
-
-function dock_toggle_visible() {
- if (is_dock_visible) {
- dock.setAttribute('display', 'none');
- movie.setAttribute('height', display_height);
- is_dock_visible = false;
- } else {
- dock.setAttribute('display', 'inline');
- is_dock_visible = true;
- movie.setAttribute('height', display_height - dock_height);
- }
-}
-
-
-function onMediaConnect(url, src_ip)
-{
- alert('onMediaConnect :\"'+url+'\"');
-
- if (WidgetManager.probe(url) ) {
- var new_wid = WidgetManager.open(url, src_ip);
- if (new_wid==null) return;
-
- add_widget_to_dock(new_wid);
- for (var i = nb_widgets; i < WidgetManager.num_widgets; i++) {
- activate[i] = true;
- }
- nb_widgets = WidgetManager.num_widgets;
- dock_layout();
- } else {
- alert('invalid widget extension');
- /* TODO if this is not a widget url, we should probably change the movie being played */
- }
-}
-
-function onMediaStop()
-{
- alert('Media Stop');
- movie.endElement();
-}
-function onMediaPause()
-{
- alert('Media pause');
- movie.pauseElement();
-}
-function onMediaPlay()
-{
- alert('Media Play');
- movie.resumeElement();
-}
+++ /dev/null
-<svg width="1600" height="1024" xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
- xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" preserveAspectRatio="none"
- viewport-fill="black">
- <script xlink:href="mpegu-core.js"/>
- <script xlink:href="tv_wm_gui.js"/>
- <defs>
- <radialGradient id="activeGradient" cx="1" cy="1" r="1.5">
- <stop offset="0" stop-color="blue" stop-opacity="1"/>
- <stop offset="1" stop-color="black" stop-opacity="1"/>
- </radialGradient>
- <radialGradient id="inactiveGradient" cx="1" cy="1" r="1.5">
- <stop offset="0" stop-color="grey" stop-opacity="1"/>
- <stop offset="1" stop-color="black" stop-opacity="1"/>
- </radialGradient>
- </defs>
- <rect width="1600" height="1024" fill="gray"/>
- <video id="movie" x="0" y="0" width="1600" restart="always" preserveAspectRatio="none" height="1024"
- repeatCount="indefinite" xlink:href="../widgets/media/local_video/movies/Clovis Cornillac.mp4"/>
- <g id="widget_display"/>
- <g id="display"/>
- <g id="dock">
- <g>
- <rect rx="2" stroke="black" stroke-width="1" fill="url(#inactiveGradient)"/>
- <animation x="0" y="0" width="10" height="30" preserveAspectRatio="none"
- xlink:href="icons/go-previous.svg"/>
- <animation x="310" y="0" width="10" height="30" preserveAspectRatio="none" xlink:href="icons/go-next.svg"/>
- </g>
- </g>
- <handler ev:event="load">initialize();</handler>
- <handler ev:event="resize">resize();</handler>
-</svg>